#TouhouDanmakufu
#Title[Beatrix Spell 1: Little Mermaid]
#Text[Test of EoSD Difficulty system.]
#BackGround[]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main{
let CSD = GetCurrentScriptDirectory;
let imgBoss = CSD ~ "img\Beatrix.png";
let back = CSD ~ "white.png";
let SupaShot = GetCurrentScriptDirectory~"\Supershot.txt";
let Difficulty = 2;
@Initialize{
SetLife(4500);
SetTimer(80);
SetScore(350000);
SetInvincibility(120);
LoadUserShotData(SupaShot);
SetMovePosition01(GetCenterX,GetCenterY,5);
LoadGraphic(imgBoss);
LoadGraphic(back);
CutIn(YOUMU,"Mermaid sign: Mortal Soul",NULL,0,0,0,0);
mainTask;
}
@MainLoop{
SetCollisionA(GetX,GetY,32);
SetCollisionB(GetX,GetY,16);
yield;
}
@DrawLoop{
SetTexture(imgBoss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,54,58);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX,GetY);
}
@BackGround{
SetTexture(NULL);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,1024,1024);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetCenterX,GetCenterY);
}
@Finalize{
DeleteGraphic(imgBoss);
}
task mainTask{
yield;
mainFire;
movement;
}
task movement{
SetMovePosition01(GetCenterX,120,5);
yield;
}
task mainFire{
let xplus = 0;
let mxsp = 2;
let line = 0;
let xplus = (GetClipMinX/2)/3;
loop{
line = rand_int(0,5);
loop(16+line){
CreateShot02(GetClipMinX+xplus,GetClipMinY,2,90,-0.2,mxsp+0.2,175,0);
xplus+=GetClipMaxX/(16+line);
mxsp+=0.1;
yield;
}
xplus = 0;
mxsp = 2;
line = rand_int(0,5);
wait(10);
loop(16+line){
CreateShot02(GetClipMaxX-xplus,GetClipMinY,2,90,0.1,mxsp+0.2,175,0);
xplus+=GetClipMaxX/(16+line);
mxsp+=0.1;
yield;
}
xplus = 0;
mxsp = 2;
wait(10);
xplus = (GetClipMinX/2)/3;
loop(3){
BookBullet(GetCenterX+100+xplus,GetClipMinY,5,90,243,0);
BookBullet(GetCenterX-100-xplus,GetClipMinY,5,90,243,0);
xplus+=(GetClipMaxX/2)/3;
wait(20);
}
wait(120);
}
}
function wait(w){
loop(w){yield;}
}
task BookBullet(x,y,v,d,graphic,delay){
let obj = Obj_Create(OBJ_SHOT);
let bounce = 0;
Obj_SetPosition(obj,x,y);
Obj_SetSpeed(obj,v);
Obj_SetAngle(obj,d);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
while(!Obj_BeDeleted(obj)){
CreateShot02(Obj_GetX(obj),Obj_GetY(obj),rand(2,5),d+180+rand(-20,20),-0.1,-3,173,20);
yield;
}
}
}
For some reason, it fires two lines like I want it to the first time, but the second time... it only fires a half line, and then a full line. What have I done wrong? Or, why does this happen?