
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Utsuho_AnimeLib.txt";
	
	tex_enemy=filedir~"Utsuho_Main.png";
	
	@Initialize
	{
		SetLife(2200);
		SetTimer(49);
		EnemyBossInitialize;
		SetAnimetion(tex_enemy);
	}
	@MainLoop{EnemyBossMainLoopSystem(50,invincible);yield;}
	@DrawLoop{EnemyBossDrawLoop;}
	@Finalize{EnemyBossFinalize;}
	
	
	
	task MainThread_Standard{}
	task MainThread_Advanced{}
	
	task MainThread_Unlimited
	{
		yield;
		wait(60);
		let r=1;
		if(rand_int(0,1)){r=-r;}
		loop
		{
			local
			{
				let wt=100;
				SetMovePositionHermite(cenX+240*r,minY+160,0,0,0,0,wt);
				SetAction(ACT_MOVE,wt);
				let i=0;
				let L=20;
				loop(L)
				{
					let p=270+i*r+rand(-15,15);
					let way=9;
					let wide=240;
					let angle=p-wide/2;
					let gra=46;
					let delay=15;
					while(angle<=p+wide/2+1)
					{
						let speed=5;
						while(speed>4)
						{
							CreateShot02(GetX,GetY,0,angle,speed/60,speed,gra,delay);
							speed/=1.1;
						}
						angle+=wide/(way-1);
					}
					
					if(absolute(i)<120){i+=11;}
					wait(ceil(wt/L));
				}
				loop(3)
				{
					let wt=100;
					SetMovePositionHermite(cenX-240*r,minY+rand(100,180),0,0,0,0,wt);
					SetAction(ACT_MOVE,wt);
					let L=20;
					loop(L)
					{
						let p=270+i*r+rand(-15,15);
						let way=7;
						let wide=240;
						let angle=p-wide/2;
						let gra=46;
						let delay=15;
						while(angle<=p+wide/2+1)
						{
							let speed=5;
							while(speed>4)
							{
								CreateShot02(GetX,GetY,0,angle,speed/120,speed,gra,delay);
								speed/=1.1;
							}
							angle+=wide/(way-1);
						}
						wait(ceil(wt/L));
					}
					r=-r;
				}
			}
			let wt=75;
			SetMovePositionHermite(cenX,minY+180,0,0,0,0,wt);
			SetAction(ACT_MOVE,wt);
			wait(wt);
			let i=0;
			loop(8)
			{
				let p=GetAngleToPlayer+i;
				let way=9;
				let speed=7;
				let angle=p;
				let gra=49;
				let delay=10;
				while(angle<p+360)
				{
					CreateShot02(GetX,GetY,0,angle,speed/60,speed,gra,delay);
					angle+=360/way;
				}
				i+=360/way/2;
				wait(10);
			}
			wait(30);
		}
	}
	
}

#include_script".\Utsuho_SunShot.txt"
