
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Utsuho_AnimeLib.txt";
	
	tex_enemy=filedir~"Utsuho_Main.png";
	tex_spellbg=filedir~"Utsuho_SpellBG.png";
	
	bg_rect=[0,0,800,600];
	
		let f_caution=GetCurrentScriptDirectory~"Utsuho_Caution.txt";
	
	@Initialize
	{
		point=520;
		SetLife(2000);
		SetTimer(69);
		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,cenY,0,0,0,0,100);
		SetAction(ACT_MOVE,100);
		SetSpellCard("小宇宙「ビッグバン原子核合成」",59);
		CreateEnemyFromFile(f_caution,cenX,cenY,0,0,0);
		wait(120);
		local
		{
			let size=0.5;
			CreateShotFromScript("Sun",GetX,GetY,0,0,400,size);
			SetShot(size);
			Explosion01(GetX,GetY,2,0.4,120);
		}
		SetAction(ACT_SHOT_A,60*60);
		let r=1;
		if(rand_int(0,1)){r=-r;}
		loop
		{
			local
			{
				let p=rand(0,360);
				let way=6;
				let leng=400;
				let v=0.7*r;
				let angle=p;
				let size=0.5;
				while(angle<p+360)
				{
					CreateShotFromScript("Sun2",GetX,GetY,v,angle,leng,size);
					angle+=360/way;
				}
			}
			
			r=-r;
			wait(95);
			if(GetTimer>15)
			{
				if(GetEnemyLife>450){wait(40);}
				if(GetEnemyLife>900){wait(40);}
				if(GetEnemyLife>1500){wait(40);}
			}
		}
		task SetShot(let size)
		{
			wait(400);
			Explosion01(GetX,GetY,2,0.4,120);
			let v=175*size;
			
			let i=rand(0,360);
			loop
			{
				let way=2;
				let speed=1;
				let ag=i;
				let gra=6;
				let delay=0;
				while(ag<i+360)
				{
					let sx=GetX+v*cos(ag);
					let sy=GetY+v*sin(ag);
					let angle=ag+rand(-10,10);
					CreateShot02(sx,sy,0,angle,speed/100,speed,gra,delay);
					ag+=360/way;
				}
				i+=5;
				wait(3);
			}
		}
	}
}
#include_script".\Utsuho_SunShot.txt"
#include_script".\Utsuho_SunShot2.txt"