
script_enemy_main
{
	#include_script".\..\..\EnemyBossSystem.txt";
	#include_script".\Yuka_AnimeLib.txt";
	
	tex_enemy=filedir~"Yuka_Main.png";
	
	@Initialize
	{
		SetLife(4500);
		SetTimer(55);
		EnemyBossInitialize;
		SetAnimetion(tex_enemy);
	}
	@MainLoop{EnemyBossMainLoopSystem(50,invincible);yield;}
	@DrawLoop{EnemyBossDrawLoop;}
	@Finalize{EnemyBossFinalize;}
	
	
	
	task MainThread_Standard
	{
		yield;
		SetMovePositionHermite(cenX,minY+100,0,0,0,0,200);
		wait(200);
		
		let r=1;
		if(rand_int(0,1)){r=-r;}
		let lp=0;
		loop
		{
			
			SetAction(ACT_SHOT_B,300);
			loop(4)
			{
				let i=rand(0,360);
				let delay=0;
				let sp=0;
				loop(9)
				{
					let way=30;
					let speed=3-sp;
					let angle=i;
					let gra=84;
					while(angle<i+360)
					{
						CreateShot01(GetX,GetY+20,speed,angle,gra,delay);
						angle+=360/way;
					}
					i+=2*r;
					sp+=0.1;
					delay+=4;
				}
				wait(20);
				Sub;
				wait(70);
				r=-r;
			}
			
			task Sub
			{
				let wide=0;
				let delay=0;
				let p=GetAngleToPlayer;
				loop(9)
				{
					let way=9;
					let ag=p;
					while(ag<p+360)
					{
						let speed=[3.5,5];
						let wt=20;
						ascent(a in 0..length(speed))
						{
							if(wide==0)
							{
								let angle=ag;
								let gra=65;
								CreateShot02(GetX,GetY+20,0,angle,speed[a]/wt,speed[a],gra,delay);
							}
							else
							{
								let angle=ag-wide/2;
								let gra=65;
								while(angle<=ag+wide/2+1)
								{
									CreateShot02(GetX,GetY+20,0,angle,speed[a]/wt,speed[a],gra,delay);
									angle+=wide;
								}
							}
						}
						ag+=360/way;
					}
					wide+=3;
					delay+=3;
				}
			}
			wait(100);
			//*/
			SetAction(ACT_SHOT_A,300);
			let i=rand(0,360);
			let lp=0;
			loop(150)
			{
				let wide=40;
				let way=3;
				let leng=25+25*cos(lp);
				let speed=[3,2];
				let angleA=i;
				let gra=29;
				let delay=10;
				while(angleA<i+360)
				{
					let sx=GetX+leng*cos(angleA);
					let sy=GetY+leng*sin(angleA);
					let angleB=angleA-wide/2;
					while(angleB<=angleA+wide/2+0.1)
					{
						ascent(a in 0..length(speed))
						{
							CreateShot01(sx,sy,speed[a],angleB,gra,delay);
						}
						angleB+=wide/(way-1);
					}
					angleA+=180;
				}
				wait(2);
				i+=9*cos(lp/2)*r;
				lp++;
			}
			
			wait(100);
			r=-r;
		}
	}
	
	
	
	
	task MainThread_Advanced{}
	
	
	
	
	task MainThread_Unlimited{}
	
}
