
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Murasa_AnimeLib.txt";
	
	tex_enemy=filedir~"Murasa_Main.png";
	
	@Initialize
	{
		SetLife(4000);
		SetTimer(40);
		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(200);
		let r=1;
		if(rand_int(0,1)){r=-r;}
		loop
		{
			SetAction(ACT_SHOT_B,60);
			local
			{
				let sx=[-140,140,-90,90];
				let sy=[30,30,-20,-20];
				ascent(a in 0..4)
				{
					CreateEnemyFromFile(GetCurrentScriptDirectory~"Murasa_Familier03.txt",GetX+sx[a],GetY+sy[a],0,0,a);
					SetTargeting(GetX+sx[a],GetY+sy[a],0.5,90,1);
					wait(5);
				}
			}
			wait(30);
			let lp=0;
			let i=rand(0,360);
			while(GetEnemyNum>1)
			{
				let wide=45;
				let way=4;
				
				let speed=1;
				let angleA=i;
				let gra=30;
				let delay=10;
				while(angleA<i+360)
				{
					let angleB=angleA-wide/2;
					while(angleB<=angleA+wide/2+1)
					{
						let v=25;
						let sx=GetX+v*cos(angleB);
						let sy=GetY+v*sin(angleB);
						CreateShot01(sx,sy,speed,angleB,gra,delay);
						
						angleB+=2.5;
					}
					angleA+=360/way;
				}
				i+=20*r;
				wait(50);
			}
			
			let wt=140;
			SetMove(cenX+rand(-40,40),minY+rand(100,140),wt);
			wait(wt);
			
			r=-r;
		}
		
	}
	
}