
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Eiki_AnimeLib.txt";
	
	tex_enemy=filedir~"Eiki_Main.png";
	
	@Initialize
	{
		SetLife(3500);
		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+120,0,0,0,0,100);
		SetAction(ACT_MOVE,100);
		wait(180);
		Sub;
		let r=1;
		if(rand_int(0,1)){r=-r;}
		let lp=0;
		loop
		{
			let way=12+lp%2;
			let wide=170+(30*(lp%2));
			let p=GetAngleToPlayer;
			loop(7)
			{
				let speed=[4.5,6.4];
				let angle=p-wide/2;
				let gra=251;
				let delay=10;
				while(angle<=p+wide/2+1)
				{
					ascent(a in 0..length(speed))
					{
						CreateShot02(GetX,GetY,0,angle,speed[a]/100,speed[a],gra,delay);
					}
					angle+=wide/(way-1);
				}
				wait(6);
			}
			wait(20);
			lp++;
		}
		task Sub
		{
			wait(90);
			loop
			{
				loop(6)
				{
					let sx=[minX,maxX];
					let angle=[rand(-90,90),rand(90,270)];
					let fam=GetCurrentScriptDirectory~"Eiki_Familier02.txt";
					ascent(a in 0..2)
					{
						let sy=rand(minY,maxY);
						CreateEnemyFromFile(fam,sx[a],sy,0,angle[a],0);
					}
					wait(8);
				}
				let wt=100;
				SetMovePositionHermite(cenX+rand(-60,60),minY+rand(110,140),0,0,0,0,wt);
				SetAction(ACT_MOVE,wt);
				wait(200);
			}
		}
	}
	
}