#東方弾幕風
#Title[破虹「レインボーストライク」]
#Text[]
#Image[]
#BackGround[]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

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


	let name    = "破虹「レインボーストライク」";

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

	@Initialize{
	CutIn(YOUMU,name,"",0,0,0,0);
	SetX(xini);
	SetY(yini);
	SetLife(1700);
	SetTimer(89);
	SetScore(500000);
	SetDamageRate(35,0);
	SetInvincibility(150);

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

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	DeleteGraphic(imgboss);
	CreateItem(ITEM_1UP,GetX,GetY);
	}

	task RainbowBreak(){
	let Angle;
	loop(120){yield;}
	loop{
	Angle = 0;
	loop(3){
	loop(120){
	CreateShotA(1,32 + 384 * cos(Angle),80 + 48 * sin(Angle),20);
	SetShotDataA(1,0,0,rand(0,360),0,0,0,RED04);
	SetShotDataA(1,140,0,NULL,rand(0,0.02),rand(0.01,0.5),1,RED04);
	FireShot(1);
	CreateShotA(2,32 + 384 * cos(Angle),88 + 48 * sin(Angle),20);
	SetShotDataA(2,0,0,rand(0,360),0,0,0,ORANGE04);
	SetShotDataA(2,140,0,NULL,rand(0,0.02),rand(0.01,0.5),1.2,ORANGE04);
	FireShot(2);
	CreateShotA(3,32 + 384 * cos(Angle),96 + 48 * sin(Angle),20);
	SetShotDataA(3,0,0,rand(0,360),0,0,0,YELLOW04);
	SetShotDataA(3,140,0,NULL,rand(0,0.02),rand(0.01,0.5),1.4,YELLOW04);
	FireShot(3);
	CreateShotA(4,32 + 384 * cos(Angle),104 + 48 * sin(Angle),20);
	SetShotDataA(4,0,0,rand(0,360),0,0,0,GREEN04);
	SetShotDataA(4,140,0,NULL,rand(0,0.02),rand(0.01,0.5),2,GREEN04);
	FireShot(4);
	CreateShotA(5,32 + 384 * cos(Angle),112 + 48 * sin(Angle),20);
	SetShotDataA(5,0,0,rand(0,360),0,0,0,AQUA04);
	SetShotDataA(5,140,0,NULL,rand(0,0.02),rand(0.01,0.5),2.5,AQUA04);
	FireShot(5);
	CreateShotA(6,32 + 384 * cos(Angle),120 + 48 * sin(Angle),20);
	SetShotDataA(6,0,0,rand(0,360),0,0,0,BLUE04);
	SetShotDataA(6,140,0,NULL,rand(0,0.02),rand(0.01,0.5),3,BLUE04);
	FireShot(6);
	CreateShotA(7,32 + 384 * cos(Angle),120 + 48 * sin(Angle),20);
	SetShotDataA(7,0,0,rand(0,360),0,0,0,PURPLE04);
	SetShotDataA(7,140,0,NULL,rand(0,0.02),rand(0.01,0.5),3.5,PURPLE04);
	FireShot(7);
	Angle-= 1.5;
	}
	Angle = 0;
	loop(120){yield;}
	}
	loop(120){yield;}
	}
}

	task Shot(){
	RainbowBreak();
	loop{
	yield;
	}
	}
}