
#Title[HXq{XʏP]
#Text[]
#Image[]
#BackGround[]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
	#include_function ".\eW.txt"

	@Initialize{
	SetX(GetCenterX);
	SetY(GetClipMinY + 120);
	SetLife(8000);
	SetTimer(59);
	SetDamageRate(250,50);

	LoadGraphic(imgboss53);
	SetTexture(imgboss53);
	SetGraphicRect(0,0,127,127);
	Shot(3);
	}

	@MainLoop{
	ChackBonus;
	SetCollisionA(GetX,GetY,24);
	SetCollisionB(GetX,GetY,24);
	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	MasicPointAddNormal(6);
	DeleteGraphic(imgboss53);
	}

	task Move(){
	loop{
	yield;
	}
	}



	task Shot(level){
	function Wait(time){loop(time){yield;}}
	Wait(90);
	
	function ShotAA(level){
	let angle = 90;
	loop(level * 6 + 14){
	Allshot(2.2,angle,level * 10 + 15,RED21,20);
	Wait(9);
	angle += 0.5;
	}
	}

	function ShotAB(level){
	let angle = 90;
	loop(level * 6 + 14){
	Allshot(2.2,angle,level * 10 + 15,AQUA21,20);
	Wait(9);
	angle -= 0.5;
	}
	}

	function ShotBA(level){
	Allshot(2.6,90,level * 8 + 18,YELLOW02,20);
	Wait(12);
	Allshot(2.6,90+180/(level * 8 + 18),level * 8 + 18,YELLOW02,20);
	Wait(12);
	Allshot(2.6,90,level * 8 + 18,YELLOW02,20);
	}

	function ShotBB(level){
	Allshot(2.6,90,level * 8 + 18,GREEN02,20);
	Wait(12);
	Allshot(2.6,90+180/(level * 8 + 18),level * 8 + 18,GREEN02,20);
	Wait(12);
	Allshot(2.6,90,level * 8 + 18,GREEN02,20);
	}

	loop{
	ShotAA(level);
	ShotBA(level);
	ShotAB(level);
	ShotBB(level);
	}
	}

}