
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Murasa_AnimeLib.txt";
	
	tex_enemy=filedir~"Murasa_Main.png";
	
	@Initialize
	{
		SetLife(3000);
		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;}
		let lp=0;
		loop
		{
			SetAction(ACT_SHOT_A,100);
			let sp=0;
			let max=400;
			let leng=-max/2;
			let ag=90+(90*r+rand(10,20)*r);
			let i=rand(0,360);
			let L=50;
			loop(L)
			{
				let sx=GetGapX(GetX,leng,ag);
				let sy=GetGapY(GetY+10,leng,ag);
				
				if(lp%2==1)
				{
					let speed=4;
					let angle=90+(leng/2)*r;
					let gra=69;
					let delay=10;
					while(speed>=1)
					{
						CreateShot01(sx,sy,speed,angle,gra,delay);
						speed/=1.2;
					}
				}
				else
				{
					let way=9;
					let speed=2.5+sp;
					let angle=i;
					let gra=22;
					let delay=5;
					while(angle<i+360)
					{
						CreateShot01(sx,sy,speed,angle,gra,delay);
						angle+=360/way;
					}
					i-=10.3*r;
					sp-=0.03;
				}
				leng+=max/L;
				wait(1);
			}
			
			let wt=140;
			SetMove(cenX+rand(-60,60),minY+rand(100,140),wt);
			wait(wt);
			
			lp++;
		}
		
	}
	
}