script_enemy_main
{
	#include_script".\..\..\EnemySystem.txt";
	
	@Initialize
	{
		point=80;
		
		EnemyInitialize(6);
		MoveThread;
		EnemyDrawSystem(0);
	}
	@MainLoop{EnemyMainLoopSystem(30);yield;}
	@DrawLoop{}
	@Finalize{EnemyFinalize;}
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Standard
	{
		wait(12);
		loop(15)
		{
			let p=GetAngleToPlayer;
			let speed=[3.5,3.55,2];
			let angle=p;
			let gra=66;
			let delay=5;
			ascent(a in 0..length(speed))
			{
				SetEnemyShot01(GetX,GetY,speed[a],angle,gra,delay);
			}
			wait(9);
		}
		enemyargument=1;
	}
	
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Advanced
	{
		wait(10);
		let lp=0;
		loop(15)
		{
			let p=GetAngleToPlayer;
			let wide=4;
			let speed=3.5;
			let gra=81;
			let delay=10;
			if(lp%2)
			{
				let angle=p-wide/2;
				while(angle<=p+wide/2+1)
				{
					SetEnemyShot02(GetX,GetY,0,angle,speed/120,speed,gra,delay);
					angle+=wide;
				}
			}
			else
			{
				let angle=p;
				SetEnemyShot02(GetX,GetY,0,angle,speed/120,speed,gra,delay);
			}
			lp++;
			wait(8);
		}
		enemyargument=1;
	}
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Unlimited
	{
		wait(12);
		let wide=60;
		loop(15)
		{
			let p=GetAngleToPlayer;
			let delay=5;
			local
			{
				let speed=4;
				let angle=p;
				let gra=87;
				SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
			}
			local
			{
				let speed=2.5;
				let gra=63;
				let angle=p-wide/2;
				while(angle<=p+wide/2+1)
				{
					SetEnemyShot01(GetX,GetY,speed,angle,gra,delay);
					angle+=wide;
				}
			}
			wide-=2.5;
			wait(9);
		}
		enemyargument=1;
	}
	
	
	task MoveThread
	{
		wait(15);
		while(enemyargument==0)
		{
			SetSpeed(enemyspeed);
			if(enemyspeed>0){enemyspeed-=0.07;}
			yield;
		}
		let count=0;
		loop
		{
			schMove(GetX,minY-120,1.1);
			SetSpeed(enemyspeed);
			if(enemyspeed<5.5){enemyspeed+=0.025;}
			count++;
			yield;
		}
	}
}