
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Eiki_AnimeLib.txt";
	
	tex_enemy=filedir~"Eiki_Main.png";
	
	@Initialize
	{
		SetLife(4444);
		SetTimer(60);
		EnemyBossInitialize;
		SetAnimetion(tex_enemy);
	}
	@MainLoop{EnemyBossMainLoopSystem(50,invincible);yield;}
	@DrawLoop{EnemyBossDrawLoop;}
	@Finalize{EnemyBossFinalize;}
	
	
	

	
	
	
	
	task MainThread_Standard{}
	task MainThread_Advanced{}
	
	
	task MainThread_Unlimited
	{
		yield;
		SetMovePositionHermite(cenX,minY+140,0,0,0,0,100);
		SetAction(ACT_MOVE,100);
		wait(180);
		let r=1;
		if(rand_int(0,1)){r=-r;}
		loop
		{
			let lp=0;
			loop(4)
			{
				let p=GetAngleToPlayer+180*(lp%2);
				let wide=5;
				let sp=0;
				loop(10)
				{
					let roundway=5;
					let way=5;
					let speed=1.2+sp;
					let ag=p;
					let gra=251;
					let delay=10;
					while(ag<p+360)
					{
						let angle=ag-wide/2;
						while(angle<=ag+wide/2+1)
						{
							CreateShot01(GetX,GetY,speed,angle,gra,delay);
							angle+=wide/(way-1);
						}
						ag+=360/roundway;
					}
					
					wide+=9;
					sp+=0.5;
					wait(6);
				}
				lp++;
				wait(20);
			}
			let wide=350;
			loop(6)
			{
				let sx=[cenX-wide/2,cenX+wide/2];
				let sy=maxY;
				let angle=rand(-180,0);
				let fam=GetCurrentScriptDirectory~"Eiki_Familier02.txt";
				ascent(a in 0..2)
				{
					CreateEnemyFromFile(fam,sx[a],sy,0,angle,0);
				}
				wide-=40;
				wait(7);
			}
			wait(100);
			let wt=160;
			SetMovePositionHermite(cenX+rand(-50,50),minY+rand(130,150),0,0,0,0,wt);
			SetAction(ACT_MOVE,wt);
		}
	}
	
}