#東方弾幕風
#Title[心壊「ブレイク・オブ・マインド」]
#Text[]
#Image[]
#BackGround[]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
#include_function ".\フランドール.txt"


	let name    = "心壊「ブレイク・オブ・マインド」";

	//初期位置
	let xini    =GetCenterX;
	let yini    =GetCenterY;

	@Initialize{
	CutIn(YOUMU,name,"",0,0,0,0);
	SetX(GetCenterX);
	SetY(GetClipMinY + 120);
	SetLife(750);
	SetTimer(100);
	SetScore(500000);
	SetDamageRate(17,0);
	SetInvincibility(300);

	LoadGraphic(imgboss);
	SetTexture(imgboss);
	SetGraphicRect(0,0,63,63);
	Shot(100,0,45,8);
	Shot(150,10,45,8);
	Shot(200,0,45,8);
	Shot(250,10,45,8);
	}

	@MainLoop{
	if(OnBomb() == false){
	SetCollisionA(GetX,GetY,24);
	SetCollisionB(GetX,GetY,24);}

	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	DeleteGraphic(imgboss);
	}

	task Shot(firstwait,angle,wait,way){
	let angle;
	let angleA;
	loop(firstwait){yield;}
	angle = 0;
	loop{
	loop(360 / wait){
	loop(wait){yield;}
	loop(9){CreateShot02(GetX,GetY,2,angle,0,0,RED02,0);angle+=40;}
	}
	angle = rand(0,180);
	loop(way){
	CreateShotA(1,GetX,GetY,0);
	SetShotDataA(1,0,1,angle,0,0,2,ORANGE23);
	SetShotDataA(1,30,NULL,NULL,0.9,0.2,3,ORANGE23);
	angleA = angle - 30;
	loop(7){
	CreateShotA(2,0,0,0);
	SetShotDataA(2,0,2,angleA,0.2,0,2,ORANGE23);
	AddShot(60,1,2,0);
	CreateShotA(3,0,0,0);
	SetShotDataA(3,0,2,angleA,-0.2,0,2,ORANGE23);
	AddShot(60,1,3,0);
	angleA += 10;}
	CreateShotA(4,GetX,GetY,0);
	SetShotDataA(4,0,1,angle,0,0,2,AQUA23);
	SetShotDataA(4,30,NULL,NULL,-0.3,0.2,3,AQUA23);
	angleA = angle - 30;
	loop(7){
	CreateShotA(5,0,0,0);
	SetShotDataA(5,0,2,angleA,0,0,2,AQUA23);
	AddShot(60,4,5,0);
	CreateShotA(6,0,0,0);
	SetShotDataA(6,0,2,angleA,-0.2,0,2,ORANGE23);
	AddShot(60,4,6,0);
	angleA += 10;}
	AddShot(60,3,4,0);
	FireShot(1);
	FireShot(4);
	angle += 360 / way;
	}
	}
	}

}