script_enemy_main
{
	#include_script".\..\..\EnemySystem.txt";
	
	@Initialize
	{
		point=400;
		
		EnemyInitialize(90);
		MoveThread;
		EnemyDrawSystem(1);
	}
	@MainLoop{EnemyMainLoopSystem(30);yield;}
	@DrawLoop{}
	@Finalize{EnemyFinalize;}
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Standard
	{
		wait(10);
		while(GetY<350)
		{
			let way=2;
			let p=GetAngleToPlayer+rand_int(-2,2);
			let speed=1.8;
			let angle=p;
			let gra=15;
			let delay=0;
			while(angle<p+360)
			{
				SetEnemyShot02(GetX,GetY,0,angle,speed/10,speed,gra,delay);
				angle+=360/way;
			}
			wait(5);
		}
	}
	
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Advanced
	{
		wait(20);
		let r=1;
		loop(4)
		{
			let p=GetAngleToPlayer;
			let sp=0;
			let i=-5*r;
			loop(10)
			{
				let speed=2.5+sp;
				let angle=p+i;
				let gra=87;
				let delay=0;
				SetEnemyShot02(GetX,GetY,0,angle,speed/20,speed,gra,delay);
				wait(2);
				i+=1*r;
				sp+=0.1;
			}
			wait(60);
			r=-r;
		}
	}
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Unlimited
	{
		wait(60);
		loop(3)
		{
			let p=GetAngleToPlayer;
			let sp=0;
			loop(12)
			{
				let wide=35;
				let roundway=3;
				let way=3;
				
				let speed=3-sp;
				let ag=p;
				let gra=63;
				let delay=10;
				while(ag<p+360)
				{
					let angle=ag-wide/2;
					while(angle<=ag+wide/2+1)
					{
						SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
						angle+=wide/(way-1);
					}
					ag+=360/roundway;
				}
				sp+=0.04;
				wait(4);
			}
			wait(70);
		}
	}
	
	
	task MoveThread
	{
		loop
		{
			SetY(GetY+1);
			yield;
		}
	}
}