
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Murasa_AnimeLib.txt";
	
	tex_enemy=filedir~"Murasa_Main.png";
	tex_spellbg=filedir~"Murasa_SpellBG.png";
	
	bg_rect=[0,0,640,480];
	
	@Initialize
	{
		point=300;
		SetLife(700);
		SetTimer(50);
		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);
		SetSpellCard("쀓뚹걏둇뾡뻊쀬됌걐",29);
		wait(120);
		let r=1;
		if(rand_int(0,1)){r=-r;}
		loop
		{
			SetAction(ACT_SHOT_B,200);
			let sp=0;
			let arg=4;
			loop(4)
			{
				let p=90;
				let way=8;
				let wide=240;
				
				let speed=1.5+sp;
				let angle=p-wide/2;
				while(angle<=p+wide/2+1)
				{
					CreateEnemyFromFile(GetCurrentScriptDirectory~"\Murasa_Familier01.txt",GetX,GetY,speed,angle,arg);
					angle+=wide/(way-1);
				}
				
				local
				{
					let way=20;
					let p=GetAngleToPlayer+((360/way)/2)*arg;
					let angleA=p;
					let gra=86;
					let delay=10;
					while(angleA<p+360)
					{
						loop(15)
						{
							let v=(360/way)/4;
							let speed=rand(3,4);
							let angleB=angleA+rand(-v,v);
							CreateShot01(GetX,GetY,speed,angleB,gra,delay);
						}
						angleA+=360/way;
					}
				}
				sp+=0.8;
				arg--;
				wait(20);
			}
			
			while(GetEnemyNum>8){yield;}
			let wt=200;
			SetMove(cenX+rand(-100,100),minY+rand(100,140),wt);
			wait(wt);
		}
		
	}
	
}