#Title[dʏQ]
#Text[]
#Image[]
#BackGround[]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
	#include_function ".\eW.txt"

	@Initialize{
	SetX(GetCenterX);
	SetY(GetClipMinY + 120);
	SetLife(5000);
	SetTimer(99);
	SetDamageRate(100,200);

	LoadGraphic(imgboss73);
	SetTexture(imgboss73);
	SetGraphicRect(0,0,127,127);
	Shot(2);
	}

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	MasicPointAddNormal(10);
	DeleteGraphic(imgboss73);
	}

	task Move(){
	loop{
	yield;
	}
	}

	task Shot(level){
	function Wait(time){loop(time){yield;}}

	task YouShot(bullet,level){
	let angle = 0;
	let x = rand(GetCenterX - 120,GetCenterX + 120);
	let y = rand(GetY - 20 , GetY + 100);
	loop(200){
	CreateShot01(x,y,2,angle,bullet,30);
	loop(10 - level){yield;}
	angle += 14.7 - level * 2;
	}
	}

	let bullet = [RED01,BLUE01,GREEN01,ORANGE01,AQUA01];
	let a = 4;
	loop{
	Wait(100 - level * 20);
	if(a < 0){a = 4;}
	YouShot(bullet[a],level);
	a--;
	}
	}
}