Working on some Chen card replications. But meanwhile, let's have a bit of Koishi. (Please improve.)
#TouhouDanmakufu
#Title[Ancestor Test]
#Text[This is a description.]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main {
let BossImage = "script\img\ExRumia.png";
let frame = -120;
let round = 0;
let x = 10;
let a = 0;
let b = 0;
let c = 0;
let num = 20;
let Spell = true;
let Survival = false;
let Final = false;
let CutInGraphic = GetCurrentScriptDirectory~"Cut.png";
function ExMove(length, height) {
if(GetPlayerX < GetX) {
if(GetX - length <= GetClipMinX) { SetMovePosition03(GetX + length, rand(height - 60, height + 60), 10, 6); } else { SetMovePosition03(GetX - length, rand(height - 60, height + 60), 10, 6); }
} else {
if(GetX + length >= GetClipMaxX) { SetMovePosition03(GetX - length, rand(height - 60, height + 60), 10, 6); } else { SetMovePosition03(GetX + length, rand(height - 60, height + 60), 10, 6); }
}
}
@Initialize {
if(Spell) { SetLife(630); SetDamageRate(20, 5); } else { SetLife(2400); SetDamageRate(100, 40); }
SetTimer(120);
if(Survival) { SetDurableSpellCard; }
if(Spell) { if(Final) { SetScore(1000000); } else { SetScore(1200000); } SetEnemyMarker(true); MagicCircle(true);
SetInvincibility(90); CutIn(KOUMA, "表象「夢枕にご先祖総立ち」", CutInGraphic, 0, 0, 182, 222); }
Concentration01(90); if(Final) { SetEffectForZeroLife(120, 255, 1); }
SetX(GetClipMinX-100); SetY(GetCenterY/2); SetMovePosition03(GetCenterX, GetCenterY-80, 9, 10);
LoadGraphic(BossImage);
//AtMain(); //Expert;
}
@MainLoop {
SetCollisionA(GetX, GetY, 32);
SetCollisionB(GetX, GetY, 24);
if(frame > 0 && frame < 120 && frame % 6 == 0) {
ascent(i in 0..15) {
ReflectBullet(GetClipMinX+x, GetClipMaxY, 8, a-90+5, AQUA02, i*2);
ReflectBullet(GetClipMaxX-x, GetClipMaxY, 8, -a-90-5, AQUA02, i*2);
}
x+=15;
a+=1;
}
if(frame > 120 && frame <= 240 && frame % 6 == 0) {
ascent(i in 0..15) {
ReflectBullet(GetClipMinX+x, GetClipMaxY, 8, a-90, AQUA02, i*2);
ReflectBullet(GetClipMaxX-x, GetClipMaxY, 8, -a-90, AQUA02, i*2);
}
x+=15;
a+=1;
}
if(frame > 300 && frame <= 540) {
if(frame % 20 == 0) {
loop(num) {
CreateShot01(GetX, GetY, 5, b, AQUA04, 30);
b+=360/num;
}
b+=3;
}
if(frame % 10 == 0) {
TurnBullet(GetX, GetY, 3, c, AQUA22, 30);
c+=9.25;
}
}
if(frame == 540) { frame = -60; a = 0; x = 10; }
if(x >= 150) { a = 0; x = 10; }
frame++;
yield;
}
let animation = 0;
@DrawLoop {
DrawText("Yuxii", 40, 36, 15, 255);
SetTexture(BossImage);
animation++;if(animation==600){animation=0;}
if(GetSpeedX()==0){if(animation<=300){SetGraphicRect(64,1,127,64);}else if(animation>300&&animation<=600){SetGraphicRect(0,1,63,64);}}
else if(GetSpeedX()>0){SetGraphicRect(192,1,255,64);}
else if(GetSpeedX()<0){SetGraphicRect(128,1,191,64);}
SetGraphicAngle(0, 0, 0);
SetGraphicScale(1, 1);
SetRenderState(ALPHA);
SetAlpha(255);
SetColor(255, 255, 255);
DrawGraphic(GetX, GetY);
}
@Finalize {
DeleteGraphic(BossImage);
}
task ReflectBullet(x, y, v, angle, graphic, delay){
let obj = Obj_Create(OBJ_SHOT);
let counter = 0;
Obj_SetPosition(obj, x, y);
Obj_SetAngle(obj, angle);
ObjShot_SetGraphic(obj, graphic);
ObjShot_SetDelay(obj, delay);
ObjShot_SetBombResist(obj, true);
Obj_SetSpeed(obj, v);
while( !Obj_BeDeleted (obj) ) {
if(counter<=3){
if(Obj_GetX(obj) <= GetClipMinX || Obj_GetX(obj) >= GetClipMaxX) {
Obj_SetAngle(obj, 180-angle);
counter++;
}
if(Obj_GetY(obj) <= GetClipMinY) {
Obj_SetAngle(obj, -angle);
counter++;
}
}
yield;
}
}
task TurnBullet(x, y, v, angle, graphic, delay){
let obj = Obj_Create(OBJ_SHOT);
let counter = 0;
Obj_SetPosition(obj, x, y);
Obj_SetAngle(obj, angle);
ObjShot_SetGraphic(obj, graphic);
ObjShot_SetDelay(obj, delay);
ObjShot_SetBombResist(obj, true);
Obj_SetSpeed(obj, v);
while( !Obj_BeDeleted (obj) ) {
counter++;
if(counter == 75) {
Obj_SetAngle(obj, atan2(GetPlayerY-Obj_GetY(obj), GetPlayerX-Obj_GetX(obj)));
}
yield;
}
}
}
Also, please disregard "Yuxii". Whatever that is.
EDIT: Made sort of harder.