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(65);
		LoadGraphic(bossImage);
		LoadGraphic(bossBack);
		SetText("Boundary "\""Boundary between Day and Night"\");
		SetScore(10000);
	}
	let frame = -120;
	@MainLoop {
		if(!OnBomb && GetTimeOfPlayerInvincibility == 0) { SetCollisionA(GetX, GetY, 50); } else { AddLife(5); }
		SetCollisionB(GetX, GetY, 50);
		if(frame == -120) {
			SetMovePosition02(GetCenterX, GetCenterY/2, 15);
			Concentration01(120);
		}
		frame++;
		if(frame == 30) {
			let a = rand(0,360);
			loop(45) {
				CreateShotA(0, GetX, GetY, 10);
				SetShotDataA(0, 0, -2, a, 2, 1/10, 2, RED32);
				SetShotDataA(0, 60, 2, NULL, 0, 0, 0, NULL);
				FireShot(0);
				CreateShotA(0, GetX, GetY, 10);
				SetShotDataA(0, 0, -2, a, -2, 1/10, 2, RED32);
				SetShotDataA(0, 60, 2, NULL, 0, 0, 0, NULL);
				FireShot(0);
				a+=360/45;
			}
		}
		if(frame == 60) {
			let a = rand(0,360);
			loop(60) {
				CreateShotA(0, GetX, GetY, 10);
				SetShotDataA(0, 0, -4, a, 2, 1/7, 4, GREEN32);
				SetShotDataA(0, 60, 4, NULL, 0, 0, 0, NULL);
				FireShot(0);
				CreateShotA(0, GetX, GetY, 10);
				SetShotDataA(0, 0, -4, a, -2, 1/7, 4, GREEN32);
				SetShotDataA(0, 60, 4, NULL, 0, 0, 0, NULL);
				FireShot(0);
				a+=360/60;
			}
		}
		if(frame == 90) {
			let a = rand(0,360);
			loop(90) {
				CreateShotA(0, GetX, GetY, 10);
				SetShotDataA(0, 0, -6, a, 2, 1/5, 6, BLUE32);
				SetShotDataA(0, 60, 6, NULL, 0, 0, 0, NULL);
				FireShot(0);
				CreateShotA(0, GetX, GetY, 10);
				SetShotDataA(0, 0, -6, a, -2, 1/5, 6, BLUE32);
				SetShotDataA(0, 60, 6, NULL, 0, 0, 0, NULL);
				FireShot(0);
				a+=360/90;
			}
		}
		if(frame >= 120) {
			loop(100) { CreateShot01(GetX, GetY, rand(1,4), GetAngleToPlayer+rand(-85, 85), BLUE01, 10); }
			frame = 0;
		}
	}
	@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; }
	}
}