
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Sakuya_AnimeLib.txt";
	
	tex_enemy=filedir~"Sakuya_Main.png";
	
	@Initialize
	{
		SetLife(3000);
		SetTimer(47);
		EnemyBossInitialize;
		SetAnimetion(tex_enemy);
	}
	@MainLoop{EnemyBossMainLoopSystem(50,invincible);yield;}
	@DrawLoop{EnemyBossDrawLoop;}
	@Finalize{EnemyBossFinalize;}
	
	
	
	task MainThread_Standard
	{
		yield;
		SetMovePositionHermite(cenX,minY+150,0,0,0,0,100);
		SetAction(ACT_MOVE,100);
		wait(180);
		let r=1;
		if(rand_int(0,1)){r=-r;}
		loop
		{
			let i=rand(0,360);
			let sp=0;
			loop(20)
			{
				let way=24;
				let angle=i;
				let delay=10;
				let lp=0;
				while(angle<i+360)
				{
					let v=30;
					let sx=GetX+v*cos(angle);
					let sy=GetY+v*sin(angle);
					if(lp%2)
					{
						let speed=0.8+sp;
						let gra=175;
						ReflectShot(sx,sy,speed,angle,1,true,true,true,false,gra,delay);
					}
					else
					{
						let speed=1.2+sp*2;
						let gra=176;
						CreateShot01(sx,sy,speed,angle,gra,delay);
					}
					angle+=360/way;
					lp++;
				}
				sp+=0.1;
				i+=0.75*r;
				wait(2);
			}
			wait(60);
			SetMovePositionHermite(cenX+rand(-60,60),minY+rand(140,160),0,0,0,0,100);
			SetAction(ACT_MOVE,100);
			wait(180);
			r=-r;
		}
	}
	
	task MainThread_Advanced{}
	task MainThread_Unlimited{}
	
}