script_enemy_main
{
	let sapz = GetCurrentScriptDirectory ~ "img\suiy.png";
	let sapzlol = GetCurrentScriptDirectory ~ "img\suiyz.png";
	
	let frame = 0;
	let move = 180;

	@Initialize
	{
		LoadUserShotData(GetCurrentScriptDirectory ~ "supershot\supershot.txt");
		
		LoadGraphic(sapz);
		LoadGraphic(sapzlol);
		
		SetLife(3000);
		SetScore(10000000);
		SetInvincibility(60);
		MagicCircle(false);
		SetRateScoreSystemEnable(false);
		SetEnemyMarker(true);
		PlayMusic(GetCurrentScriptDirectory ~ "bgm\bees.mp3");
		SetMovePosition02(GetCenterX, GetCenterY - 120, 15);
		PlaySE(GetCurrentScriptDirectory~"bgm\se_alert.wav");
	}

	@MainLoop
	{
		SetCollisionA(GetX, GetY, 32);
		SetCollisionB(GetX, GetY, 16);
		Bombimmunity;
		if(frame==60)
		{
			Concentration01(90);
			PlaySE(GetCurrentScriptDirectory~"bgm\se_ch00.wav");
		}
		SetMovePosition02(GetCenterX + (10*cos(move*move)), GetCenterY-120 + (5*sin(move)), 0);
		move+=5;
		if(frame==150){pew;}
		if(GetPlayerLife==1){VanishEnemy;}
		
		frame++;
		yield;
	}
	
	@DrawLoop
	{
		if(OnBomb)
		{
			SetTexture(sapzlol);
			SetGraphicRect(0, 0, 500, 500);
			SetGraphicAngle(0, 0, frame*10);
			SetGraphicScale(0.25, 0.25);
			DrawGraphic(GetX, GetY);
		}
		else
		{
			SetTexture(sapzlol);
			SetGraphicRect(0, 0, 500, 500);
			SetGraphicAngle(0, 0, 0);
			SetGraphicScale(0.25, 0.25);
			DrawGraphic(GetX, GetY);
		}
	}

	@Finalize
	{
	}

	function Wait(frames){loop(frames){yield;}}
	
	sub Bombimmunity
	{
		if(OnBomb)
		{
			SetDamageRate(0,0);
		}
		else
		{
			SetDamageRate(100, 0);
		}
	}
	
	sub pew
	{
		bluewave;
		purplewave;
		backwave;
	}
	
	task bluewave
	{
		ascent(j in 90..450)
			{
				ascent(i in 0..32)
				{
					CreateShot02(GetX+60*cos(i*360/32-j*5), GetY+60*sin(i*360/32-j*j), 5, i*360/32-j*5, -0.02, 1, 124, 10);
				}
				Wait(4);
			}
		bluewave;
	}
	
	task purplewave
	{
		ascent(j in 0..60)
			{
				ascent(i in 0..30)
				{
					CreateShot02(GetX+60*cos(i*360/30+j*4.5), GetY+60*sin(i*360/30+j*4.5), 4, i*360/30+j*4.5, -0.02, 2, PURPLE21, 15);
				}
				Wait(6);
			}
		purplewave;
	}
	
	task backwave
	{
		loop
		{
			ascent(i in 0..30)
			{
				CreateShot02(GetX+50*cos(GetAngleToPlayer+i*360/30+180), GetY+50*sin(GetAngleToPlayer+i*360/30+180), 10, GetAngleToPlayer+i*360/30+180+7, -0.1, 4, 234, 10);
			}
			Wait(10);
		}
		backwave;
	}
}