
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Ran_AnimeLib.txt";
	
	tex_enemy=filedir~"Ran_Main.png";
	
	@Initialize
	{
		SetLife(3500);
		SetTimer(40);
		EnemyBossInitialize;
		SetAnimetion(tex_enemy);
	}
	@MainLoop{EnemyBossMainLoopSystem(50,invincible);yield;}
	@DrawLoop{EnemyBossDrawLoop;}
	@Finalize{EnemyBossFinalize;}
	
	
	
	task MainThread_Standard{}
	
	task MainThread_Advanced
	{
		yield;
		SetMovePositionHermite(cenX,minY+100,0,0,0,0,100);
		SetAction(ACT_MOVE,100);
		SetRoll(100);
		wait(200);
		let r=1;
		if(rand_int(0,1)){r=-r;}
		let lp=0;
		loop
		{
			let p=GetAngleToPlayer+180;
			let way=24+lp%2;
			let speed=[4,2];
			let angle=p;
			let gra=[108,109];
			let delay=10;
			while(angle<p+360)
			{
				ascent(a in 0..length(speed))
				{
					SetShot(GetX,GetY,speed[a],angle,gra[a],delay);
				}
				angle+=360/way;
			}
			
			task SetShot(let sx,let sy,let spd,let ag,let gra,let delay)
			{
				let speed=[spd,spd*0.8,spd*0.9];
				local
				{
					ascent(a in 0..2)
					{
						CreateShot01(sx,sy,speed[a],ag,gra,delay);
					}
				}
				local
				{
					let wide=3;
					let angle=ag-wide/2;
					while(angle<=ag+wide/2+1)
					{
						CreateShot01(sx,sy,speed[2],angle,gra,delay);
						angle+=wide;
					}
				}
			}
			wait(35);
			lp++;
			if(!(lp%5))
			{
				let wt=80;
				SetMovePositionHermite(cenX+rand(-60,60),minY+rand(90,120),0,0,0,0,wt);
				SetAction(ACT_MOVE,wt);
				SetRoll(wt);
			}
		}
	}
	task MainThread_Unlimited{}
	
}