#TouhouDanmakufu
#Title[Spell 5]
#Text[An attempt at making a spell]
#Player[REIMU]
#ScriptVersion[2]
#PlayLevel[Normal]
script_enemy_main{
let CSD = GetCurrentScriptDirectory;
let imgBoss = CSD ~ "system\touhoucharacter1.png";
let cut = CSD ~ "system\touhoucharacter3.png";
let shot = CSD ~ "supershot.txt";
CutIn(YOUMU,"ugyk - i8uyg -",cut,0,0,360,290);
@Initialize{
SetLife(5000);
SetTimer(60);
SetScore(250000);
LoadGraphic(imgBoss);
LoadGraphic(cut);
LoadUserShotData(shot);
SetMovePosition02(GetCenterX,GetCenterY,0);
SetInvincibility(120);
SetDamageRate(100,18);
fire;
fireb;
firec;
}
@MainLoop{
SetCollisionA(GetX,GetY,32);
SetCollisionB(GetX,GetY,16);
yield;
}
@DrawLoop{
SetTexture(imgBoss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,110,110);
SetGraphicScale(0.7,0.7);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX,GetY);
}
@BackGround{}
@Finalize{
DeleteGraphic(imgBoss);
DeleteGraphic(cut);
}
task fire{
wait(60);
loop{
bullet(GetX,GetY,3,rand(0,359),112,0);
wait(4);
yield;
}
}
task fireb{
wait(60);
let ang = GetCenterX;
let angl = GetCenterX;
loop{
loop(20){CreateShot01(ang,GetClipMinY,5,90,BLUE03,0); ang+=8;}
wait(30);
loop(20){CreateShot01(angl,GetClipMinY,5,90,BLUE03,0); angl-=8;}
wait(30);
yield;
}
}
task firec{
wait(60);
loop{
CreateShot01(GetX,GetY,5,90,BLUE03,0);
wait(30);
yield;
}
}
task bullet(x,y,v,dir,graphic,delay){
let obj=Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj,x,y);
Obj_SetSpeed(obj,v);
Obj_SetAngle(obj,dir);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
ObjShot_SetBombResist(obj, true);
while(!Obj_BeDeleted(obj)){
if(Obj_GetY(obj) > GetClipMaxY){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir-90,AQUA03,0);
}
if(Obj_GetX(obj) > GetClipMaxX){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir-90,AQUA03,0);
}
if(Obj_GetY(obj) < GetClipMinY){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir-90,AQUA03,0);
}
if(Obj_GetX(obj) < GetClipMinX){CreateShot01(Obj_GetX(obj),Obj_GetY(obj),2,dir-90,AQUA03,0);
}
yield;}
}
task bulletb(x,y,v,dir,graphic,delay){
let obj=Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj,x,y);
Obj_SetSpeed(obj,v);
Obj_SetAngle(obj,dir);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,delay);
ObjShot_SetBombResist(obj, true);
let count = 0;
while(!Obj_BeDeleted(obj)){
count++;
if(count%20[<10){Obj_SetAngle(obj, Obj_GetAngle(obj)+1);}else{Obj_SetAngle(obj, Obj_GetAngle(obj)-1);}
yield;}
}
function wait(w){loop(w){yield;}}
}