
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Daiyousei_AnimeLib.txt";
	
	tex_enemy=filedir~"DaiyouseiAnother_Main.png";
	tex_spellbg=filedir~"DaiyouseiAnother_SpellBG.png";
	
	bg_rect=[0,0,386,512];
	
	@Initialize
	{
		point=450;
		SetLife(1100);
		SetTimer(52);
		EnemyBossInitialize;
		SetAnimetion(tex_enemy);
	}
	@MainLoop{EnemyBossMainLoopSystem(50,invincible);yield;}
	@DrawLoop{EnemyBossDrawLoop;}
	@Finalize{EnemyBossFinalize;}
	
	task MainThread_Standard{}

	
	task MainThread_Advanced
	{
		yield;
		SetMovePositionHermite(cenX,minY+150,0,0,0,0,100);
		SetAction(ACT_MOVE,100);
		SetSpellCard("雷霊「ミカヅチサンダー」",63);
		wait(120);
		SetAction(ACT_SHOT_A,60*60);
		local
		{
			let p=rand(0,360);
			let way=24;
			let speed=1;
			let gra=35;
			let delay=10;
			while(speed<=12)
			{
				let angle=p;
				while(angle<p+360)
				{
					CreateShot02(GetX,GetY,0,angle,speed/60,speed,gra,delay);
					angle+=360/way;
				}
				speed*=1.2;
				p+=360/way/2;
				wait(1);
			}
		}
		wait(80);
		let i=0;
		let sp=0;
		let way=15;
		let wt=2;
		loop(30)
		{
			SetShot;
			sp+=0.15;
			wait(wt);
		}
		let ip=2.71;
		loop
		{
			let L=40;
			while(L>10)
			{
				loop(ceil((180/way)/ip))
				{
					SetShot;
					i+=ip;
					wait(wt);
				}
				loop(L)
				{
					SetShot;
					wait(wt);
				}
				L-=4;
			}
		}
		
		task SetShot
		{
			let p=rand_int(-1,1)*2;
			let sx=GetX+7;
			let sy=GetY-28;
			let speed=[1+sp,0.5+sp/4];
			let ag=p;
			let gra=[83,88];
			let delay=10;
			let a=0;
			while(ag<p+360)
			{
				let angle=[ag+i,ag-i];
				let spd=speed[a%length(speed)]+rand(-0.2,0.2);
				CreateShot01(sx,sy,spd,angle[a%2],gra[a%length(gra)],delay);
				ag+=360/way;
				a++;
			}
		}
	}
	
	
	
	
	task MainThread_Unlimited{}
	
}