
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Daiyousei_AnimeLib.txt";
	
	tex_enemy=filedir~"DaiyouseiAnother_Main.png";
	
	@Initialize
	{
		SetLife(3300);
		SetTimer(53);
		EnemyBossInitialize;
		SetAnimetion(tex_enemy);
	}
	@MainLoop{EnemyBossMainLoopSystem(50,invincible);yield;}
	@DrawLoop{EnemyBossDrawLoop;}
	@Finalize{EnemyBossFinalize;}
	
	task MainThread_Standard{}

	
	task MainThread_Advanced
	{
		yield;
		SetMovePositionHermite(cenX,minY+100,0,0,0,0,100);
		SetAction(ACT_MOVE,100);
		wait(120);
		let r=1;
		if(rand_int(0,1)){r=-r;}
		loop
		{
			loop(2)
			{
				let mx=cenX+140*r;
				let my=minY+rand(120,150);
				let wt=ceil(GetGapLength(GetX,GetY,mx,my)/3);
				SetMovePositionHermite(cenX+140*r,minY+150,0,0,0,0,wt);
				SetAction(ACT_MOVE,wt);
				
				let w=4;
				let i=rand(0,360);
				let L=floor(wt/w);
				loop(L)
				{
					let gra=[19,83];
					let delay=0;
					
					CreateShotA(1,GetX,GetY,delay);
					SetShotDataA(1,0,0.4,90,0,0,0,gra[0]);
					let cnt=30;
					let limit=100;
					while(cnt<=limit)
					{
						let way=4;
						let speed=3.5;
						let angle=i;
						while(angle<i+360)
						{
							CreateShotA(2,0,0,delay);
							SetShotDataA(2,0,speed,angle,0,0,0,gra[1]);
							AddShot(cnt,1,2,0);
							angle+=360/way;
						}
						cnt+=4;
					}
					SetShotKillTime(1,limit+1);
					FireShot(1);
					i+=8.7*r;
					wait(w);
				}
				wait(40);
				r=-r;
			}
			SetMovePositionHermite(cenX,minY+100,0,0,0,0,100);
			SetAction(ACT_MOVE,100);
			wait(100);
			
			SetAction(ACT_SHOT_A,160);
			let i=rand(0,360);
			loop(8)
			{
				let way=9;
				let speed=6;
				let L=12;
				loop(L)
				{
					let sx=GetX+7;
					let sy=GetY-30;
					let angle=i;
					let gra=107;
					let delay=10;
					while(angle<i+360)
					{
						CreateShot01(sx,sy,speed,angle,gra,delay);
						angle+=360/way;
					}
					i+=((360/way)/L)/3*r;
					speed/=1.1;
				}
				i+=(360/way)/5;
				r=-r;
				wait(12);
			}
			wait(90);
			r=-r;
		}
	}
	
	
	
	
	task MainThread_Unlimited{}
	
}