script_enemy_main
{
	#include_script".\..\..\EnemySystem.txt";
	
	@Initialize
	{
		point=100;
		
		EnemyInitialize(3);
		MoveThread;
		EnemyDrawSystem(0);
	}
	@MainLoop{EnemyMainLoopSystem(30);yield;}
	@DrawLoop{}
	@Finalize{EnemyFinalize;}
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Standard
	{
		wait(5);
		while(GetY<cenX+50)
		{
			let p=GetAngleToPlayer;
			
			let speed=3;
			let angle=p;
			let gra=65;
			let delay=0;
			if(GetGapLength(GetX,GetY,GetPlayerX,GetPlayerY)>70)
			{
				SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
			}
			wait(12);
		}
	}
	
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Advanced
	{
		wait(5);
		while(GetY<cenX+50)
		{
			let p=GetAngleToPlayer;
			let wide=330;
			let way=3;
			let speed=3.5;
			let angle=p-wide/2;
			let gra=81;
			let delay=0;
			while(angle<=p+wide/2+1)
			{
				if(GetGapLength(GetX,GetY,GetPlayerX,GetPlayerY)>70)
				{
					SetEnemyShot02(GetX,GetY,0,angle,speed/60,speed,gra,delay);
				}
				angle+=wide/(way-1);
			}
			wait(10);
		}
	}
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Unlimited
	{
		wait(5);
		while(GetY<cenX+50)
		{
			let p=GetAngleToPlayer;
			let wide=100;
			let way=3;
			let speed=5;
			let angle=p-wide/2;
			let gra=81;
			let delay=0;
			while(angle<=p+wide/2+1)
			{
				if(GetGapLength(GetX,GetY,GetPlayerX,GetPlayerY)>70)
				{
					SetEnemyShot02(GetX,GetY,0,angle,speed/60,speed,gra,delay);
				}
				angle+=wide/(way-1);
			}
			wait(12);
		}
	}
	
	
	task MoveThread
	{
		enemyangle=GetAngleToPlayer;
		loop
		{
			if(GetY<=300){schMove(GetPlayerX,GetPlayerY,1.2);}
			SetSpeed(enemyspeed);
			if(enemyspeed<4.5){enemyspeed+=0.05;}
			yield;
		}
	}
}