#東方弾幕風
#Title[波符「赤眼催眠(マインドシェイカー)」 Easy]
#Text[永夜抄5面:鈴仙スペルのクローン]
#ScriptVersion[2]
script_enemy_main {
let name = "波符「赤眼催眠(マインドシェイカー)」";
let imgBoss = "script\img\ExRumia.png";
let xIni = GetCenterX;
let yIni = GetClipMinY + 128;
@Initialize {
CutIn(YOUMU, name, "", 0, 0, 0, 0);
SetLife(2000);
SetTimer(49);
SetScore(25000000);
SetDamageRate(5, 5);
LoadGraphic(imgBoss);
SetTexture(imgBoss);
setGraphicStop;
TMain;
}
@MainLoop {
SetCollisionA(GetX, GetY, 32);
SetCollisionB(GetX, GetY, 16);
yield;
}
@DrawLoop {
DrawGraphic(GetX, GetY);
}
@Finalize {
DeleteGraphic(imgBoss);
}
task TMain {
let typeRed = RED11;
let typeBlue = BLUE11;
let wShot1 = 50;
let wShot2 = 25;
yield;
TRate;
standBy;
loop {
shot1(1, typeRed);
wait(wShot1);
phantasm;
shot2(1.25, 0.95, typeRed);
wait(wShot2);
shot2(1.05, 0.85, typeBlue);
wait(wShot2);
}
}
task TRate {
wait(500);
SetDamageRate(60, 60);
}
sub standBy {
let wIni = 120;
SetMovePosition02(xIni, yIni, wIni);
setGraphicMove;
SetInvincibility(wIni);
wait(wIni);
setGraphicPose;
}
function shot1(v, type) {
let way = 48;
let dir = rand(-180, 180);
nwayCircle(way, v, dir , type, true );
nwayCircle(way, v, dir + 3.75, type, false);
}
function shot2(v1, v2, type) {
let way = 24;
let dir = rand(-180, 180);
nwayCircle(way, v1, dir , type, true );
nwayCircle(way, v1, dir + 3.75, type, false);
nwayCircle(way, v2, dir + 7.50, type, true );
nwayCircle(way, v2, dir + 11.25, type, false);
}
sub phantasm {
wait(100);
}
function nwayCircle(way, v, dir, type, right) {
let span = 360 / way;
let angle = dir;
loop(way) {
CreateShot01(GetX, GetY, v, angle, type, 0);
angle += span;
}
}
sub setGraphicStop { SetGraphicRect( 0, 0, 64, 64); }
sub setGraphicPose { SetGraphicRect( 64, 0, 128, 64); }
sub setGraphicLeft { SetGraphicRect(128, 0, 192, 64); }
sub setGraphicRight { SetGraphicRect(192, 0, 256, 64); }
sub setGraphicMove {
if(GetSpeedX < 0) {
setGraphicLeft;
} else {
setGraphicRight;
}
}
function wait(w) {
loop(w) { yield; }
}
}