script_enemy_main {
	let bossImage = GetCurrentScriptDirectory~"yukari.png";
	let bossBack = GetCurrentScriptDirectory~"yukariback.png";
	@Initialize {
		if(GetPlayerType==USER_PLAYER) { RaiseError("Why are you using this player","Error"); }
		SetLife(1000);
		SetDamageRate(20, 50);
		SetTimer(95);
		LoadGraphic(bossImage);
		LoadGraphic(bossBack);
		SetText(""\""Godly Duels"\");
		SetScore(10000);
	}
	let frame = -120;
	let frame2 = -120;
	let angle = 0;
	@MainLoop {
		if(!OnBomb && GetTimeOfPlayerInvincibility == 0) { SetCollisionA(GetX, GetY, 50); } else { AddLife(5); }
		SetCollisionB(GetX, GetY, 50);
		if(frame == -120) {
			SetMovePosition02(GetCenterX, GetCenterY-50, 15);
			Concentration01(120);
		}
		frame++;
		frame2++;
		if(frame == 2) {
			ascent(i in 0..2) {
				CreateLaser01(GetX, GetY, 5, GetAngleToPlayer+angle+i*360/2, 120, 15, RED21+rand_int(0,7), 10);
				CreateLaser01(GetX, GetY, 5, GetAngleToPlayer-angle+i*360/2, 120, 15, RED21+rand_int(0,7), 10);
			}
			angle+=17; angle%=360;
			frame = 0;
		}
		if(frame2 > 120 && frame2 <= 240) {
			CreateShot01(GetPlayerX+rand(-15,15), 480, rand(6,10), -90+rand(-1,1), ORANGE12, 60);
		}
		if(frame2 == 240) {
			frame2 = -60;
		}
	}
	@DrawLoop {
		SetTexture(bossImage);
		SetGraphicRect(0, 0, 128, 128);
		SetGraphicScale(1, 1);
		SetGraphicAngle(0, 0, 0);
		SetAlpha(255);
		SetRenderState(ALPHA);
		DrawGraphic(GetX, GetY);
		DrawText("Past Yukari Yakumo", 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);
		SetRenderState(ADD);
		DrawGraphic(GetCenterX, GetCenterY);
		backspin+=1; backspin%=360;
	}
	@Finalize {
		DeleteGraphic(bossImage);
		DeleteGraphic(bossBack);
		if(IsTimeOut) { ExtendPlayer(-GetPlayerLife); ShootDownPlayer; }
	}
}