#Title[dʏR]
#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(1);
	}

	@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 x1 = GetClipMaxX;
	let x2 = GetClipMinX;
	let y = rand(GetY - 40 , GetY + 100);
	loop{
	CreateShotA(1,x1,y,30);
	SetShotDataA(1,0,rand(1,2.5+level*0.5),180,0,0,0,bullet);
	SetShotDataA(1,60,2,90,0,0,0,bullet);
	FireShot(1);
	loop(25 - level * 5){yield;}
	CreateShotA(2,x2,y,30);
	SetShotDataA(2,0,rand(1,2.5+level*0.5),0,0,0,0,bullet);
	SetShotDataA(2,60,2,90,0,0,0,bullet);
	FireShot(2);
	loop(25 - level * 5){yield;}
	}
	}

	let bullet = [RED01,BLUE01,GREEN01,ORANGE01,AQUA01];
	let a = 4;
	loop(5){
	YouShot(bullet[a],level);
	Wait(5 - level);
	a--;
	}
	loop{
	loop(80 - level * 8){yield;}
	WideShot01(GetX,GetY,3,GetAngleToPlayer,17,level * 4 + 5,BLUE04,20);
	}
	}
}