
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Utsuho_AnimeLib.txt";
	
	tex_enemy=filedir~"Utsuho_Main.png";
	
	@Initialize
	{
		SetLife(4000);
		SetTimer(47);
		EnemyBossInitialize;
		SetAnimetion(tex_enemy);
	}
	@MainLoop{EnemyBossMainLoopSystem(50,invincible);yield;}
	@DrawLoop{EnemyBossDrawLoop;}
	@Finalize{EnemyBossFinalize;}
	
	
	
	task MainThread_Standard{}
	task MainThread_Advanced{}
	
	task MainThread_Unlimited
	{
		yield;
		SetMovePositionHermite(cenX,minY+140,0,0,0,0,100);
		SetAction(ACT_MOVE,100);
		wait(120);
		let r=1;
		if(rand_int(0,1)){r=-r;}
		loop
		{
			let i=rand(0,360);
			let wt=40;
			loop(7)
			{
				let way=9;
				let speed=5;
				let angle=i;
				let gra=49;
				let delay=10;
				while(angle<i+360)
				{
					let obj=CreateShot02(GetX,GetY,0,angle,speed/100,speed,gra,delay);
					Sub(obj,wt);
					angle+=360/way;
				}
				i+=360/way/2;
				wt+=8;
				wait(40);
			}
			task Sub(let obj,let wt)
			{
				wait(wt);
				if(Obj_BeDeleted(obj)){return;}
				let p=rand(0,360);
				let way=12;
				
				let speed=1.6;
				let ag=p;
				let gra=22;
				let delay=10;
				while(ag<p+360)
				{
					let v=25;
					let sx=Obj_GetX(obj)+v*cos(ag);
					let sy=Obj_GetY(obj)+v*sin(ag);
					let angle=ag+rand(-5,5);
					CreateShot02(sx,sy,0,angle,speed/160,speed,gra,delay);
					ag+=360/way;
				}
			}
			SetMovePositionHermite(cenX+rand(-80,80),minY+rand(120,150),0,0,0,0,100);
			SetAction(ACT_MOVE,100);
			wait(140);
		}
	}
	
}

#include_script".\Utsuho_SunShot.txt"
