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

script_enemy_main
{
	#include_function ".\eW.txt"

	@Initialize{
	SetX(GetCenterX);
	SetY(GetClipMinY + 120);
	SetLife(4700);
	SetTimer(39);
	SetDamageRate(200,30);

	LoadGraphic(imgboss2);
	SetTexture(imgboss2);
	SetGraphicRect(0,0,127,127);
	Shot();
	}

	@MainLoop{
	ChackBonus;
	SetCollisionA(GetX,GetY,24);
	SetCollisionB(GetX,GetY,24);
	SetCommonData("ALICE_X",GetX);
	SetCommonData("ALICE_Y",GetY);
	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	MasicPointAddNormal(3);
	DeleteGraphic(imgboss2);
	}

	task Move(){
	loop{
	yield;
	}
	}

	task Shot(){
	function Wait(time){loop(time){yield;}}
	Wait(60);
	let x = GetCommonData("ALICE_X");
	let y = GetCommonData("ALICE_Y");
	CreateEnemyFromScript("DOLL1",x,y,0,0,0);
	CreateEnemyFromScript("DOLL1",x,y,0,45,1);
	CreateEnemyFromScript("DOLL1",x,y,0,90,2);
	CreateEnemyFromScript("DOLL1",x,y,0,135,3);
	CreateEnemyFromScript("DOLL1",x,y,0,180,4);
	CreateEnemyFromScript("DOLL1",x,y,0,225,5);
	CreateEnemyFromScript("DOLL1",x,y,0,270,6);
	CreateEnemyFromScript("DOLL1",x,y,0,315,7);
	loop{
	yield;
	}
	}
}

script_enemy DOLL1
{
#include_function ".\eW.txt"

	@Initialize{
	SetX(GetX+64*cos(GetAngle));
	SetY(GetY+64*sin(GetAngle));
	SetLife(1000);
	SetScore(1000);
	SetDamageRate(0,0);

	SetTexture(imgboss2);
	SetGraphicRect(766,0,798,32);
	Shot(0);
	Move();
	}

	@MainLoop{
	ChackBonus;

	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	}

	task Move(){
	let x = GetCommonData("ALICE_X")+64*cos(GetAngle);
	let y = GetCommonData("ALICE_Y")+64*sin(GetAngle);
	SetMovePosition02(x,y,60);
	loop(60){yield;}
	loop{
	yield;
	}
	}

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

	task ShotA(level){
	let angle	= 90;
	let way		= [4,5,6,7];
	let speed	= [2,2,2,2];
	let wait	= [50,45,40,30];
	let bullet	= [RED04,GREEN04,BLUE04,YELLOW04,PURPLE04,AQUA04,ORANGE04,WHITE04];
	let a		= GetArgument;

	loop{
	ascent(let i in 0..way[level]){
	CreateShot01(GetX,GetY,speed[level],angle+(360/way[level]*i),bullet[a],20);
	}
	a++;
	if(a > 7){a -= 7;}
	loop(wait[level]){yield;}
	angle += 60 / (level + 1);
	}
	}

	Wait(45);
	ShotA(0);
	loop{
	yield;
	}
	}
}