#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["Minoriko NonSpell 05"]
#include"./LoadGraphics.txt"
#include"./../Functions/Enemy_Functions.txt"
#include"./../Functions/Effects/Effects.txt"

let bossObj;
let bossX;
let bossY;
let dam = 0;

let short = GetCurrentScriptDirectory ~ "./../Sounds/se_ch00.wav";
#include"./DrawBoss.txt"

@Initialize{
	bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
	SetAutoDeleteObject(true);
	ObjEnemy_Regist(bossObj);
	SetCommonData("ForceLifebar",1);
	SetCommonData("Timer",1);
	SetCommonData("End",0);
	LoadShotData;
	animateBossM;
	mainTask;
	TEnd;

	LoadSound(short);}

@Event{
	alternative(GetEventType())
	case(EV_REQUEST_LIFE){SetScriptResult(1);}
	case(EV_REQUEST_TIMER){SetScriptResult(100);}}

@MainLoop{
	bossX = ObjMove_GetX(bossObj);
	bossY = ObjMove_GetY(bossObj);

	ObjEnemy_SetDamageRate(bossObj, 0, 0);
	ObjEnemy_SetIntersectionCircleToShot(bossObj,bossX,bossY,24);
	ObjEnemy_SetIntersectionCircleToPlayer(bossObj,bossX,bossY,32);
	yield;}

@Finalize{}

task mainTask{wait(1);let r = 0;
	loop(80){PowerS(bossX+r*cos(r*15),bossY+r*sin(r*15));r+=1;}r = 0;
	loop(80){Point(bossX+r*cos(r*15+180),bossY+r*sin(r*15+180));r+=1;}
	ascent(i in 0..25){Fruit(bossX+80*cos(i*14.4),bossY+80*sin(i*14.4));}
	ObjMove_SetDestAtWeight(bossObj,192,192,4,3);
	wait(90);
	THarvesterWreath(2.3,180,1);wait(30);
	THarvesterWreath(2.0,150,-1);wait(60);
	MakeConcentrationA1(bossObj,"MAPLE",255,0,0,55);
	PlaySE(short);wait(100);
	Obj_SetVisible(bossObj,false);
	wait(60);
	ObjEnemy_SetLife(bossObj,0);}