
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=360;
		SetLife(800);
		SetTimer(55);
		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+80,0,0,0,0,100);
		SetAction(ACT_MOVE,100);
		SetSpellCard("血雨「真っ赤なシャワー」",38);
		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=30;
			loop(L)
			{
				let sx=GetGapX(GetX,leng,ag);
				let sy=GetGapY(GetY+10,leng,ag);
				let speed=7;
				let angle=90+(leng/2)*r;
				let gra=81;
				let delay=10;
				while(speed>=0.8)
				{
					CreateShot01(sx,sy,speed,angle,gra,delay);
					speed/=1.2;
				}
				local
				{
					let way=40;
					let speed=3+sp;
					let angle=i;
					let gra=17;
					let delay=5;
					while(angle<i+360)
					{
						CreateShot01(sx,sy,speed,angle,gra,delay);
						angle+=360/way;
					}
					i-=19.7*r;
					sp-=0.07;
				}
				leng+=max/L;
				wait(1);
			}
			wait(100);
			let wt=200;
			SetMove(cenX+rand(-100,100),minY+rand(70,100),wt);
			wait(wt);
			r=-r;
		}
	}
}