#東方弾幕風
#Title[アリス通常１]
#Text[]
#Image[]
#BackGround[]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
	#include_function ".\弾幕集.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;
	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 ".\弾幕集.txt"

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

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

	@MainLoop{
	ChackBonus;

	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	}

	task Move(){
	let x = GetCommonData("ALICE_X")+160*cos(GetAngle);
	let y = GetCommonData("ALICE_Y")+160*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	= 45;
	let way		= [4,5,6,7];
	let speed	= [2,2,2,2];
	let wait	= [100,80,60,50];
	let bullet	= [RED04,GREEN04,BLUE04,YELLOW04,PURPLE04,AQUA04,ORANGE04,WHITE04];
	let a		= GetArgument;

	loop{
	ascent(let i in 0..way[level]){
	ReflectShot(GetX,GetY,speed[level],angle+(360/way[level]*i),1,true,true,true,false,bullet[a],20);
	}
	loop(wait[level]){yield;}
	angle += 15;
	}
	}

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