script_enemy_main
{
	#include_script".\..\..\EnemySystem.txt";
	
	tex_crest=GetCurrentScriptDirectory~"Image/Sakuya_Familier.png";
	
	@Initialize
	{
		point=0;
		EnemyInitialize(10000);
		EnemyCrestDrawSystem(64,64);
	}
	@MainLoop{EnemyMainLoopSystem(0);yield;}
	@DrawLoop{}
	@Finalize{EnemyFinalize;}
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Standard
	{
		yield;
		Move;
		
		wait(50);
		
		let wt=10;
		let i=GetAngleToPlayer;
		let r=1;
		if(GetEnemyX<GetX){r=-r;}
		if(!enemyargument)
		{
			let sp=0;
			loop(32)
			{
				let way=2;
				let wide=6;
				let speed=3-sp;
				let gra=110;
				let delay=10;
				let angleA=i;
				while(angleA<i+360)
				{
					let angleB=angleA-wide/2;
					while(angleB<=angleA+wide/2+1)
					{
						CreateShot01(GetX,GetY,speed,angleB,gra,delay);
						angleB+=2;
					}
					angleA+=360/way;
				}
				sp+=0.05;
				i+=19*r;
				wait(wt);
			}
		}
		else
		{
			loop(32)
			{
				let way=2;
				
				let gra=169;
				let delay=10;
				let angle=i;
				while(angle<i+360)
				{
					let speed=3.2;
					while(speed>=2.5)
					{
						CreateShot02(GetX,GetY,0,angle,speed/60,speed,gra,delay);
						speed/=1.1;
					}
					angle+=360/way;
				}
				i-=13*r;
				wait(wt);
			}
		}
		Concentration01(30);
		vanishflg=true;
		wait(40);
		VanishEnemy;
		
		
		task Move
		{
			while(enemyspeed>=0.5)
			{
				SetSpeed(enemyspeed);
				enemyspeed-=0.05;
				yield;
			}
			let flg=false;
			loop
			{
				if((GetX<minX||GetX>maxX)&&!flg)
				{
					enemyangle=180-enemyangle;
					flg=true;
				}
				SetAngle(enemyangle);
				yield;
			}
		}
	}
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Advanced{}
	
	
	//---------------------------------------------------------------
	//---------------------------------------------------------------
	task MainThread_Unlimited{}
	
}