script_enemy_main
{
	#include_script".\..\..\EnemySystem.txt";
	
	@Initialize
	{
		point=480;
		
		EnemyInitialize(130);
		MoveThread;
		EnemyDrawSystem(1);
	}
	@MainLoop{EnemyMainLoopSystem(30);yield;}
	@DrawLoop{}
	@Finalize{EnemyFinalize;}
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Standard
	{
		wait(50);
		loop(4)
		{
			let way=12;
			let p=GetAngleToPlayer;
			loop(2)
			{
				let speed=1.5;
				let angle=p;
				let gra=30;
				let delay=0;
				while(angle<p+360)
				{
					SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
					angle+=360/way;
				}
				p+=360/way/2;
				wait(30);
			}
			wait(30);
		}
	}
	
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Advanced
	{
		loop(3)
		{
			let wide=8;
			let way=10;
			let p=GetAngleToPlayer;
			local
			{
				let speed=1.5;
				let ag=p;
				let gra=29;
				let delay=0;
				while(ag<p+360)
				{
					let angle=ag-wide/2;
					while(angle<=ag+wide/2+1)
					{
						SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
						angle+=2;
					}
					ag+=360/way;
				}
			}
			wait(90);
		}
	}
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Unlimited
	{
		wait(50);
		let r=1;
		if(GetX<cenX){r=-r;}
		
		loop(2)
		{
			let i=0;
			let p=GetAngleToPlayer;
			loop(15)
			{
				let way=7;
				let speed=[2,1.2];
				let angle=p;
				let ag=[i,-i];
				let gra=[81,65];
				let delay=10;
				while(angle<p+360)
				{
					ascent(a in 0..2)
					{
						let sx=GetX+10*cos(angle+ag[a]);
						let sy=GetY+10*sin(angle+ag[a]);
						SetEnemyShot01(sx,sy,speed[a],angle+ag[a],gra[a],delay);
					}
					angle+=360/way;
				}
				i+=0.5*r;
				wait(4);
			}
			wait(60);
		}
	}
	
	
	task MoveThread
	{
		loop
		{
			SetY(GetY+1);
			yield;
		}
	}
}