script_enemy_main
{
	#include_script".\..\..\EnemySystem.txt";
	
	@Initialize
	{
		point=150;
		
		EnemyInitialize(20);
		MoveThread;
		EnemyDrawSystem(0);
	}
	@MainLoop{EnemyMainLoopSystem(30);yield;}
	@DrawLoop{}
	@Finalize{EnemyFinalize;}
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Standard
	{
		wait(30);
		loop(3)
		{
			let p=GetAngleToPlayer;
			let sp=0;
			loop(6)
			{
				let wide=240;
				let way=3;
				let speed=2+sp;
				let angle=p-wide/2;
				let gra=81;
				let delay=0;
				while(angle<=p+wide/2+1)
				{
					SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
					angle+=wide/(way-1);
				}
				sp+=0.075;
				wait(2);
			}
			wait(50);
		}
	}
	
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Advanced
	{
		wait(30);
		let sp=0;
		loop(4)
		{
			let p=GetAngleToPlayer;
			
			local
			{
				let wide=12;
				let way=4;
				let speed=2+sp;
				let angle=p-wide/2;
				let gra=145;
				let delay=0;
				while(angle<=p+wide/2+1)
				{
					SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
					angle+=wide/(way-1);
				}
			}
			sp+=0.4;
			wait(80);
		}
	}
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Unlimited
	{
		wait(30);
		loop(50)
		{
			let p=GetAngleToPlayer;
			let speed=4;
			let angle=p;
			let gra=71;
			let delay=5;
			
			SetEnemyShot02(GetX,GetY,0,angle,speed/50,speed,gra,delay);
			wait(5);
		}
	}
	
	
	task MoveThread
	{
		loop
		{
			SetY(GetY+1);
			SetSpeed(enemyspeed);
			if(enemyspeed>0){enemyspeed-=0.02;}
			else{enemyspeed=0;}
			yield;
		}
	}
}