
#Title[幽々子ボス通常２]
#Text[]
#Image[]
#BackGround[]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

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

	@Initialize{
	SetX(GetCenterX);
	SetY(GetClipMinY + 120);
	SetLife(8000);
	SetTimer(59);
	SetDamageRate(250,50);

	LoadGraphic(imgboss53);
	SetTexture(imgboss53);
	SetGraphicRect(0,0,127,127);
	Shot(2);
	}

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	MasicPointAddNormal(6);
	DeleteGraphic(imgboss53);
	}

	task Move(level){
	function Wait(time){loop(time){yield;}}

	Wait(30);
	loop{
	SetMovePositionRandom01(rand_int(-2,2)*32,rand(-16,16),1,GetClipMinX + 64,GetClipMinY,GetClipMaxX - 64,128);
	Wait(90 - level * 10);
	}
	}



	task Shot(level){
	function Wait(time){loop(time){yield;}}
	Wait(180);
	
	function AllFastShot(x,y,speed,angle,fast,maxspeed,bullet,delay,way){
	loop(way){
	CreateShot02(x,y,speed,angle,fast,maxspeed,bullet,delay);
	angle += 360 / way;
	}
	}

	function JikiShot(x,y,speed1,speed2,angleA,angleB,fast,maxspeed,bullet,delay,wait){
	CreateShotA(1,GetX,GetY,10);
	SetShotDataA(1,0,speed1,angleA,0,0,speed1,bullet);
	SetShotDirectionType(PLAYER);
	SetShotDataA(1,30,speed2,angleB,0,fast,maxspeed,bullet);
	SetShotDirectionType(ABSOLUTE);
	FireShot(1);
	}

	task AllFastShotTask(level){
	loop{
	if(level == 0){break;}
	Wait(60 - level * 10);
	AllFastShot(GetX,GetY,0.01,90+rand(-10,10),0.02,1.5 + level * 0.5,GREEN22,20,15 + level * 10);
	}
	}

	AllFastShotTask(level);
	loop{
	loop(20){
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer,20,0.06,2.5,AQUA22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer,-20,0.06,2.5,AQUA22,10,20);
	if(level >= 1){
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+30,20,0.06,2.5,AQUA22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+30,-20,0.06,2.5,AQUA22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-30,20,0.06,2.5,AQUA22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-30,-20,0.06,2.5,AQUA22,10,20);
	}
	if(level >= 2){
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+60,20,0.06,2.5,AQUA22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+60,-20,0.06,2.5,AQUA22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-60,20,0.06,2.5,AQUA22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-60,-20,0.06,2.5,AQUA22,10,20);
	}
	if(level == 3){
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+90,20,0.06,2.5,AQUA22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+90,-20,0.06,2.5,AQUA22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-90,20,0.06,2.5,AQUA22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-90,-20,0.06,2.5,AQUA22,10,20);
	}
	Wait(6);
	}
	loop(20){
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+20,0,0.06,2.5,BLUE22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-20,0,0.06,2.5,BLUE22,10,20);
	if(level >= 1){
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+40,0,0.06,2.5,BLUE22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+40,0,0.06,2.5,BLUE22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-40,0,0.06,2.5,BLUE22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-40,0,0.06,2.5,BLUE22,10,20);
	}
	if(level >= 2){
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+60,0,0.06,2.5,BLUE22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+60,0,0.06,2.5,BLUE22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-60,0,0.06,2.5,BLUE22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-60,0,0.06,2.5,BLUE22,10,20);
	}
	if(level == 3){
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+80,0,0.06,2.5,BLUE22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer+80,0,0.06,2.5,BLUE22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-80,0,0.06,2.5,BLUE22,10,20);
	JikiShot(GetX,GetY,2,0,GetAngleToPlayer-80,0,0.06,2.5,BLUE22,10,20);
	}
	Wait(6);
	}
	}
	}

}