#東方弾幕風
#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,127,127);
	Shot(100,0,45,12,5);
	Shot(150,10,45,12,10);
	Shot(200,0,45,12,15);
	Shot(250,10,45,12,20);
	}

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

	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	DeleteGraphic(imgboss);

	loop(30){
	let x = rand(GetX-32,GetX+32);
	let y = rand(GetY-32,GetY+32);
	CreateItem(ITEM_SCORE,x,y);}
	}

	task Shot(firstwait,angle,wait,way,n){
	let angle;
	let angleA;
	loop(firstwait){yield;}
	loop{
	angle = 0;
	loop(360 / wait){
	loop(wait){yield;}
	loop(9){CreateShot02(GetX,GetY,2,angle,0,0,RED02,0);angle+=40;}
	}
	angle = n;
	let angleA = angle;
	loop(way){
	CreateShotA(1,GetX,GetY,0);
	SetShotDataA(1,0,1,angleA,0,0,2,GREEN02);
	SetShotDataA(1,30,NULL,NULL,0.9,0.2,3,GREEN02);
	CreateShotA(2,0,0,10);
	SetShotDataA(2,0,1,angleA-90,0,0,2,ORANGE23);
	CreateShotA(3,0,0,10);
	SetShotDataA(3,0,1,angleA+90,0,0,2,ORANGE23);
	AddShot(30,1,2,0);
	AddShot(30,1,3,0);
	CreateShotA(2,0,0,10);
	SetShotDataA(2,0,1,angleA-90,0,0,2,AQUA23);
	CreateShotA(3,0,0,10);
	SetShotDataA(3,0,1,angleA+90,0,0,2,AQUA23);
	AddShot(50,1,2,0);
	AddShot(50,1,3,0);
	CreateShotA(2,0,0,10);
	SetShotDataA(2,0,1,angleA-90,0,0,2,ORANGE23);
	CreateShotA(3,0,0,10);
	SetShotDataA(3,0,1,angleA+90,0,0,2,ORANGE23);
	AddShot(70,1,2,0);
	AddShot(70,1,3,0);
	CreateShotA(2,0,0,10);
	SetShotDataA(2,0,1,angleA-90,0,0,2,AQUA23);
	CreateShotA(3,0,0,10);
	SetShotDataA(3,0,1,angleA+90,0,0,2,AQUA23);
	AddShot(90,1,2,0);
	AddShot(90,1,3,0);
	CreateShotA(2,0,0,10);
	SetShotDataA(2,0,1,angleA-90,0,0,2,ORANGE23);
	CreateShotA(3,0,0,10);
	SetShotDataA(3,0,1,angleA+90,0,0,2,ORANGE23);
	AddShot(110,1,2,0);
	AddShot(110,1,3,0);
	CreateShotA(2,0,0,10);
	SetShotDataA(2,0,1,angleA-90,0,0,2,AQUA23);
	CreateShotA(3,0,0,10);
	SetShotDataA(3,0,1,angleA+90,0,0,2,AQUA23);
	AddShot(130,1,2,0);
	AddShot(130,1,3,0);
	CreateShotA(2,0,0,10);
	SetShotDataA(2,0,1,angleA-90,0,0,2,ORANGE23);
	CreateShotA(3,0,0,10);
	SetShotDataA(3,0,1,angleA+90,0,0,2,ORANGE23);
	AddShot(150,1,2,0);
	AddShot(150,1,3,0);
	CreateShotA(2,0,0,10);
	SetShotDataA(2,0,1,angleA-90,0,0,2,AQUA23);
	CreateShotA(3,0,0,10);
	SetShotDataA(3,0,1,angleA+90,0,0,2,AQUA23);
	AddShot(170,1,2,0);
	AddShot(170,1,3,0);
	CreateShotA(2,0,0,10);
	SetShotDataA(2,0,1,angleA-90,0,0,2,ORANGE23);
	CreateShotA(3,0,0,10);
	SetShotDataA(3,0,1,angleA+90,0,0,2,ORANGE23);
	AddShot(190,1,2,0);
	AddShot(190,1,3,0);
	SetShotKillTime(1,300);
	FireShot(1);
	angleA -= 30;
	}
	}
	}

}