
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)
				{
					local
					{
						let way=4;
						let spd=[3.2,2.1];
						let p=[i,-i];
						let gra=[22,23];
						ascent(a in 0..2)
						{
							let speed=spd[a]+sp;
							let angle=p[a];
							let delay=10;
							let lp=0;
							while(angle<p[a]+360)
							{
								CreateShot01(sx,sy,speed,angle,gra[a],delay);
								angle+=360/way;
							}
						}
					}
					i-=6.2*r;
					sp-=0.02;
				}
				else
				{
					local
					{
						let way=5;
						let spd=[2.6,2.1];
						let p=[i,-i];
						let gra=[69,70];
						ascent(a in 0..2)
						{
							let speed=spd[a]+sp;
							let angle=p[a];
							let delay=10;
							let lp=0;
							while(angle<p[a]+360)
							{
								CreateShot01(sx,sy,speed,angle,gra[a],delay);
								angle+=360/way;
							}
						}
					}
					i-=8.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++;
		}
		
	}
	
}