script_enemy_main
{
	#include_script".\..\..\EnemySystem.txt";
	
	@Initialize
	{
		point=0;
		EnemyInitialize(300);
		MoveThread;
	}
	@MainLoop{EnemyMainLoopSystem(10);yield;}
	@DrawLoop{}
	@Finalize{EnemyFinalize;}
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Standard{}
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Advanced
	{
	}
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Unlimited
	{
		State;
		Concentration01(30);
		wait(20);
		
		let r=-1;
		if(GetX<cenX){r=-r;}
		
		let i=rand(0,360);
		loop(40)
		{
			let way=4;
			let speed=[2,3];
			let angle=i;
			let gra=14;
			let delay=0;
			while(angle<i+360)
			{
				let max=1;
				if(GetEnemyNum<=3){max=2;}
				ascent(a in 0..max)
				{
					CreateShot01(GetX,GetY,speed[a],angle,gra,delay);
				}
				angle+=360/way;
			}
			i+=4.7*r;
			wait(10);
		}
		wait(30);
		
		vanishflg=true;
		
		local
		{
			let p=GetAngleToPlayer;
			let way=60;
			
			let speed=[2,1];
			let angle=p;
			let gra=29;
			let delay=20;
			while(angle<p+360)
			{
				ascent(a in 0..length(speed))
				{
					CreateShot02(GetX,GetY,0,angle,speed[a]/100,speed[a],gra,delay);
				}
				angle+=360/way;
			}
		}
		
		task State
		{
			while(!vanishflg)
			{
				let gra=5;
				let delay=10;
				CreateShotA(1,GetX,GetY,delay);
				SetShotDataA(1,0,0,0,0,0,0,gra);
				SetShotKillTime(1,0);
				FireShot(1);
				yield;
			}
		}
	}
	
	
	task MoveThread
	{
		while(!vanishflg){yield;}
		if(GetLife<lifelimit){AddLife(-lifelimit);}
		else{VanishEnemy;}
	}
}