script_enemy_main
{
	#include_script".\..\..\EnemySystem.txt";
	
	@Initialize
	{
		point=250;
		
		EnemyInitialize(60);
		MoveThread;
		EnemyDrawSystem(2);
	}
	@MainLoop{EnemyMainLoopSystem(30);yield;}
	@DrawLoop{}
	@Finalize{EnemyFinalize;}
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Standard
	{
		wait(30);
		loop(4)
		{
			loop(3)
			{
				let p=GetAngleToPlayer;
				let speed=3;
				let angle=p;
				let gra=67;
				let delay=0;
				while(speed>=2)
				{
					SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
					speed/=1.04;
				}
				wait(5);
			}
			wait(70);
		}
	}
	
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Advanced
	{
		wait(30);
		loop(8)
		{
			let p=GetAngleToPlayer;
			local
			{
				let wide=9;
				
				let speed=2.5;
				let angle=p;
				let gra=9;
				let delay=0;
				SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
				
				speed/=1.3;
				angle=p-wide/2;
				while(angle<=p+wide/2+1)
				{
					SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
					angle+=wide;
				}
			}
			wait(45);
		}
	}
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Unlimited
	{
		loop(4)
		{
			let p=GetAngleToPlayer;
			let wide=0;
			while(wide<18)
			{
				let speed=2.5;
				let gra=86;
				let delay=10;
				if(wide==0)
				{
					let angle=p;
					SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
				}
				else
				{
					let angle=p-wide/2;
					while(angle<=p+wide/2+1)
					{
						SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
						angle+=wide;
					}
				}
				wide+=2;
				wait(1);
			}
			local
			{
				let wide=180;
				let speed=3;
				let gra=30;
				let delay=0;
				let angle=p+180-wide/2;
				while(angle<=p+180+wide/2+1)
				{
					SetEnemyShot02(GetX,GetY,0,angle,speed/60,speed,gra,delay);
					angle+=3;
				}
			}
			wait(60);
		}
	}
	
	
	task MoveThread
	{
		loop
		{
			SetY(GetY+1);
			yield;
		}
	}
}