#TouhouDanmakufu
#Title[spoell fiev]
#Text[SPELCASRD FIVEE]
#Player[FREE]
#BGM[.\micro.mp3]
#BackGround[User(.\backReg.png, 9, 15)]
#ScriptVersion[2]

script_enemy_main {
	let bossImage = GetCurrentScriptDirectory~"sprite.png";
	let bossBack = GetCurrentScriptDirectory~"back.png";
	#include_function ".\shot_replace.dnh";
	@Initialize {
		SetLife(1);
		SetTimer(120);
		ShotInit;
		LoadGraphic(bossImage);
		LoadGraphic(bossBack);
		CutIn(KOUMA, ""\""Solitude"\", GetCurrentScriptDirectory~"cutin.png", 0, 0, 384, 384);
		SetScore(10000000);
		SetEffectForZeroLife(600, 3, 255);
	}
	let frame = -120;
	let angle = 0;
	@MainLoop {
		if(frame == -120) {
			SetMovePosition02(GetCenterX, GetCenterY-50, 15);
			Concentration01(120);
		}
		frame++;
		if(frame == 2) {
			CreateShot01(GetX, GetY, rand(1, 3), rand(0,360), Petal03, 10);
			if(GetTimer < 100) {
				CreateShot01(GetX, GetY, rand(1, 2), rand(0,360), Amulet02, 10);
			}
			if(GetTimer < 90) {
				CreateShot01(GetX, GetY, rand(1, 2), rand(0,360), Snow06, 10);
			}
			if(GetTimer < 70) {
				CreateShot01(GetX, GetY, rand(4, 5), rand(0,360), Drop05, 10);
			}
			if(GetTimer < 60) {
				loop(2) {
					CreateShot01(GetX, GetY, rand(1, 3), GetAngleToPlayer+rand(-35,35), Kunai02, 10);
				}
			}
			if(GetTimer < 30) {
				loop(35) {
					CreateShot01(GetX, GetY, rand(4, 11), -90+25*sin(angle)+rand(-170, 170), GArrow04, 10);
				}
			}
			angle+=3; angle%=360;
			frame = 0;
		}
		if(GetTimer <= 0 || GetLife <= 0) { MotionBlurEx(ALL, 600, 255, ADD); }
	}
	@DrawLoop {
		SetTexture(bossImage);
		SetGraphicRect(0, 0, 128, 128);
		DrawGraphic(GetX, GetY);
		DrawText("Kana Anaberal", 40, 30, 12, 255);
	}
	@BackGround {
		SetTexture(bossBack);
		SetGraphicRect(0, 0, 384, 448);
		DrawGraphic(GetCenterX, GetCenterY);
	}
	@Finalize {
		DeleteGraphic(bossImage);
		DeleteGraphic(bossBack);
	}
}