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

	
	task MainThread_Advanced
	{
		yield;
		SetMovePositionHermite(cenX,minY+160,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_B,100);
			local
			{
				let speed=7;
				let lp=0;
				let p=GetAngleToPlayer;
				loop(15)
				{
					let way=22;
					let angle=p;
					let gra=[81,86];
					let delay=10;
					while(angle<p+360)
					{
						CreateShotA(1,GetX,GetY,delay);
						SetShotDataA(1,0,speed,angle,0,0,0,gra[lp%length(gra)]);
						let limit=50;
						local
						{
							CreateShotA(2,0,0,delay);
							let angleB=angle+90*r;
							SetShotDataA(2,0,0,angleB,0,speed/200,speed,gra[lp%length(gra)]);
							AddShot(limit,1,2,0);
						}
						SetShotKillTime(1,limit+1);
						FireShot(1);
						angle+=360/way;
					}
					wait(1);
					speed/=1.15;
					r=-r;
					lp++;
				}
			}
			wait(100);
			SetAction(ACT_SHOT_A,100);
			local
			{
				let wt=5;
				let w=0;
				let wide=40;
				let sp=0;
				loop(8)
				{
					let p=90;
					let sx=GetX+7;
					let sy=GetY-30;
					
					let speed=2+sp;
					let angle=p-wide/2;
					let gra=[42,106,26];
					let delay=20;
					while(angle<=p+wide/2+1)
					{
						let limit=60;
						SetShotDirectionType(ABSOLUTE);
						CreateShotA(1,sx,sy,delay);
						SetShotDataA(1,0,speed,angle,0,-speed/limit,0,gra[0]);
						local
						{
							SetShotDirectionType(PLAYER);
							let wide=150;
							let way=7;
							let speedB=[2.8,3];
							let angleB=-wide/2;
							while(angleB<=wide/2+1)
							{
								ascent(a in 0..length(speedB))
								{
									CreateShotA(2,0,0,delay);
									SetShotDataA(2,0,0,angleB,0,speedB[a]/60,speedB[a],gra[1]);
									AddShot(limit+50-w,1,2,0);
								}
								angleB+=wide/(way-1);
							}
						}
						local
						{
							SetShotDirectionType(PLAYER);
							let way=18;
							let speedB=1.4;
							let angleB=0;
							while(angleB<360)
							{
								CreateShotA(3,0,0,delay);
								SetShotDataA(3,0,0,angleB,0,speedB/150,speedB,gra[2]);
								AddShot(limit+60-w,1,3,0);
								angleB+=360/way;
							}
						}
						SetShotKillTime(1,limit+61-w);
						FireShot(1);
						angle+=wide;
					}
					wait(wt);
					sp+=0.4;
					wide+=40;
					w+=wt;
				}
			}
			SetMovePositionHermite(cenX+rand(-80,80),minY+rand(170,190),0,0,0,0,160);
			SetAction(ACT_MOVE,160);
			wait(240);
		}
	}
	
	
	
	
	task MainThread_Unlimited{}
	
}