#東方弾幕風
#Title[波符「赤眼催眠(マインドシェイカー)」 Easy]
#Text[永夜抄5面:鈴仙スペルのクローン]
#ScriptVersion[2]
script_enemy_main {
let name = "波符「赤眼催眠(マインドシェイカー)」";
let imgBoss = "script\img\ExRumia.png";
let csd = GetCurrentScriptDirectory;
let shotData = csd ~ "shot_pellet.txt";
let shotRed = 1;
let shotBlue = 6;
let xIni = GetCenterX;
let yIni = GetClipMinY + 128;
let onPhantasm = false;
@Initialize {
CutIn(YOUMU, name, "", 0, 0, 0, 0);
SetLife(2000);
SetTimer(49);
SetScore(25000000);
SetDamageRate(5, 5);
LoadGraphic(imgBoss);
SetTexture(imgBoss);
setGraphicStop;
LoadUserShotData(shotData);
TMain;
}
@MainLoop {
SetCollisionA(GetX, GetY, 32);
SetCollisionB(GetX, GetY, 16);
yield;
}
@DrawLoop {
DrawGraphic(GetX, GetY);
}
@Finalize {
DeleteGraphic(imgBoss);
}
task TMain {
let typeRed = shotRed;
let typeBlue = shotBlue;
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 dir = rand(-180, 180);
let right = true;
loop(2) {
nwayCircle(48, v, dir, type, right);
dir += 3.75;
right = ! right;
}
}
function shot2(v, type) {
let dir = rand(-180, 180);
let right = true;
ascent(i in 0..2) {
loop(2) {
nwayCircle(24, v[i], dir, type, right);
dir += 3.75;
right = ! right;
}
}
}
sub phantasm {
let wStop = 100;
onPhantasm = true;
TimeStop(wStop, 0, 0, 1);
MotionBlurEx(SHOT, wStop, 128, ALPHA);
wait(wStop);
onPhantasm = false;
}
task TMagicShot(x, y, v, angle, type, right) {
let obj = Obj_Create(OBJ_SHOT);
let dx;
let dy = 0.2;
if(right) { dx = 0.25; } else { dx = -0.25; }
Obj_SetX(obj, x);
Obj_SetY(obj, y);
Obj_SetAngle(obj, angle);
ObjShot_SetGraphic(obj, type);
while(! Obj_BeDeleted(obj)) {
Obj_SetSpeed(obj, v);
Obj_SetAlpha(obj, 255);
Obj_SetCollisionToPlayer(obj, true);
while(! onPhantasm) {
yield;
}
Obj_SetSpeed(obj, 0);
Obj_SetAlpha(obj, 128);
Obj_SetCollisionToPlayer(obj, false);
while(onPhantasm) {
Obj_SetX(obj, Obj_GetX(obj) + dx);
Obj_SetY(obj, Obj_GetY(obj) + dy);
yield;
}
}
}
function nwayCircle(way, v, dir, type, right) {
let span = 360 / way;
let angle = dir;
loop(way) {
TMagicShot(GetX, GetY, v, angle, type, right);
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; }
}
}