
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(120);
		let r=-1;
//		if(rand_int(0,1)){r=-r;}
		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);
				let speed=3;
				let angle=90+(leng/2)*r;
				let gra=70;
				let delay=10;
				while(speed>=2)
				{
					CreateShot01(sx,sy,speed,angle,gra,delay);
					speed/=1.2;
				}
				local
				{
					let way=6;
					let speed=3+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-=14.7*r;
					sp-=0.03;
				}
				leng+=max/L;
				wait(1);
			}
			wait(60);
			SetAction(ACT_SHOT_B,100);
			let lp=0;
			let p=GetAngleToPlayer;
			loop(5)
			{
				let way=11+lp%2;
				let wide=[240+30*(lp%2),10];
				
				let speed=1.5;
				let angleA=p-wide[0]/2;
				let gra=62;
				let delay=10;
				while(angleA<=p+wide[0]/2+1)
				{
					let angleB=angleA-wide[1]/2;
					while(angleB<=angleA+wide[1]/2+1)
					{
						CreateShot01(GetX,GetY,speed,angleB,gra,delay);
						angleB+=1;
					}
					angleA+=wide[0]/(way-1);
				}
				wait(18);
				lp++;
			}
			let wt=200;
			SetMove(cenX+rand(-60,60),minY+rand(100,140),wt);
			wait(wt);
		}
		
	}
	
}