script_enemy_main {
	let bossImage = GetCurrentScriptDirectory~"marisa.png";
	let bossBack = GetCurrentScriptDirectory~"marisaback.png";
	@Initialize {
		if(GetPlayerType==USER_PLAYER) { RaiseError("Why are you using this player","Error"); }
		SetLife(1000);
		SetDamageRate(20, 50);
		SetTimer(65);
		LoadGraphic(bossImage);
		LoadGraphic(bossBack);
		SetText("Magical Research "\""Deep Ecological Bomb"\");
		SetScore(10000);
	}
	let frame = -120;
	let frameMove = -120;
	@MainLoop {
		SetCollisionB(GetX, GetY, 50);
		if(frame == -120) {
			SetMovePosition02(GetCenterX, GetCenterY/2, 15);
			Concentration01(120);
		}
		frame++;
		frameMove++;
		if(frame >= 300) {
			CreateShotA(0, GetX, GetY, 0);
			SetShotDataA(0, 0, 1, GetAngleToPlayer, 0, 0, 0, WHITE03);
			loop(25) {
				CreateShotA(1, 0, 0, 0);
				SetShotDataA(1, 0, rand(7,10), rand(0,360), 0, -1/2, 1, WHITE01);
				loop(25) {
					CreateShotA(2, 0, 0, 0);
					SetShotDataA(2, 0, rand(7,10), rand(0,360), 0, -1/2, rand(1,3), WHITE05);
					SetShotDataA(2, 30, rand(7,10), GetAngleToPlayer, 0, -1/2, rand(1,3), WHITE01);
					SetShotDataA(2, 60, rand(7,10), 180+GetAngleToPlayer+rand(-50,50), 0, -1/2, rand(1,3), WHITE01);
					SetShotDataA(2, 90, rand(7,10), rand(0,360), 0, -1/2, rand(1,3), RED02+rand(0,8));
					SetShotDataA(2, 150, rand(7,10), rand(0,360), 0, -1/2, rand(1,3), RED03+rand(0,7));
					AddShot(60, 1, 2, 0);
				}
				SetShotKillTime(1, 61);
				AddShot(60, 0, 1, 0);
			}
			SetShotKillTime(0, 61);
			FireShot(0);
			frame = 0;
		}
		if(GetEnemyShotCount == 0) { frame = 300; }
		if(frameMove >= 200) {
			SetMovePosition02(GetCenterX+rand(-150, 150), GetCenterY/2+rand(-100, 100), 60);
		frameMove = 0; }
	}
	@DrawLoop {
		SetTexture(bossImage);
		SetGraphicRect(0, 0, 128, 128);
		SetGraphicScale(1, 1);
		SetGraphicAngle(0, 0, 0);
		SetAlpha(255);
		DrawGraphic(GetX, GetY);
		DrawText("Marisa Kirisame", 40, 30, 12, 255);
	}
	let backspin = 0;
	@BackGround {
		SetTexture(bossBack);
		SetGraphicRect(0, 0, 512, 512);
		SetGraphicScale(3/2, 3/2);
		SetGraphicAngle(0, 0, backspin);
		SetAlpha(255);
		DrawGraphic(GetCenterX, GetCenterY);
		backspin-=1; backspin%=360;
	}
	@Finalize {
		DeleteGraphic(bossImage);
		DeleteGraphic(bossBack);
	}
}