
#Title[さとりボス通常１]
#Text[]
#Image[]
#BackGround[]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

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

	@Initialize{
	SetX(GetCenterX);
	SetY(GetClipMinY + 120);
	SetLife(7000);
	SetTimer(69);
	SetDamageRate(200,30);

	LoadGraphic(imgboss42);
	SetTexture(imgboss42);
	SetGraphicRect(0,0,63,63);
	Shot(2);
	}

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

	@DrawLoop{
	DrawGraphic(GetX,GetY);
	}

	@Finalize{
	MasicPointAddNormal(5);
	DeleteGraphic(imgboss42);
	}

	task Move(){
	loop{
	yield;
	}
	}

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

	let a = 120;
	let b = 40;
	let addangle = 4;
	let angleAA = 0;
	let angleAB = 180;
	let angleBA = 180;
	let angleBB = 0;
	loop{
	let x = GetX;
	let y = GetY;

	loop(45 * (1 + level)){
	CreateShot01(x + a * cos(angleAA)+b * cos(angleAB),y + a * sin(angleAA)+b * sin(angleAB),1.5,angleAB,RED12,30);
	CreateShot01(x + a * cos(angleBA)+b * cos(angleBB),y + a * sin(angleBA)+b * sin(angleBB),1.5,angleBB,BLUE12,30);	
	CreateShot01(x - a * cos(angleAA)+b * cos(angleAB),y + a * sin(angleAA)+b * sin(angleAB),1.5,180+angleAB,RED12,30);
	CreateShot01(x - a * cos(angleBA)+b * cos(angleBB),y + a * sin(angleBA)+b * sin(angleBB),1.5,180+angleBB,BLUE12,30);	
	angleAA += addangle / (1 + level);
	angleAB += 52.7 / (1 + level);
	angleBA -= addangle / (1 + level);
	angleBB -= 52.7 / (1 + level);
	loop(5 - level){yield;}
	}
	CreateShot01(x,y,2,86,RED03,20);
	CreateShot01(x,y,2,94,BLUE03,20);
	loop(45 * (1 + level)){
	CreateShot01(x + a * cos(angleAA)+b * cos(angleAB),y + a * sin(angleAA)+b * sin(angleAB),1.5,angleAB,RED12,30);
	CreateShot01(x + a * cos(angleBA)+b * cos(angleBB),y + a * sin(angleBA)+b * sin(angleBB),1.5,angleBB,BLUE12,30);
	CreateShot01(x - a * cos(angleAA)+b * cos(angleAB),y + a * sin(angleAA)+b * sin(angleAB),1.5,180+angleAB,RED12,30);
	CreateShot01(x - a * cos(angleBA)+b * cos(angleBB),y + a * sin(angleBA)+b * sin(angleBB),1.5,180+angleBB,BLUE12,30);	
	angleAA += addangle / (1 + level);
	angleAB += 52.7 / (1 + level);
	angleBA -= addangle / (1 + level);
	angleBB -= 52.7 / (1 + level);
	loop(5 - level){yield;}
	}
	CreateShot01(x,y,2,90,RED03,20);
	CreateShot01(x,y,2,90,BLUE03,20);
	}
	}
}