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

script_enemy_main
{
#include_function ".\弾幕集.txt"


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

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

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

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

	@MainLoop{
	ChackBonus;
	SetCollisionA(GetX,GetY,36);
	SetCollisionB(GetX,GetY,24);
	yield;
	}

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	DeleteGraphic(imgboss62);
	MasicPointAddSpellCard;
	loop(90 + scorebonus * 3){
	let x = rand(GetX-32,GetX+32);
	let y = rand(GetY-32,GetY+32);
	CreateItem(ITEM_SCORE,x,y);}
	SetCommonData("ON_SPELL",0);
	}

	task RainbowBreak(level){
	let Angle;
	loop(120){yield;}
	loop{
	Angle = 0;
	loop(level + 2){
	loop(60){
	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-= 3;
	}
	Angle = 0;
	loop(120){yield;}
	}
	loop(120){yield;}
	}
}

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