#TouhouDanmakufu
#Title[spellll 1]
#Text[FFSIRT SPWELCRAD]
#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(4000);
		SetTimer(50);
		ShotInit;
		LoadGraphic(bossImage);
		LoadGraphic(bossBack);
		CutIn(KOUMA, "Parallel Shots "\""Vertical Pseudo-Symmetry"\", GetCurrentScriptDirectory~"cutin.png", 0, 0, 384, 384);
		SetScore(10000000);
	}
	let frame = -120;
	let frame2 = -120;
	@MainLoop {
		SetCollisionA(GetX, GetY, 50);
		SetCollisionB(GetX, GetY, 50);
		if(frame == -120) {
			SetMovePosition02(GetCenterX, GetCenterY/2, 15);
			Concentration01(120);
		}
		frame++;
		frame2++;
		if(frame >= 10) {
			let x = rand(0,50);
			let speed = 2+rand(-1,1)/3;
			loop(11) {
				CreateShot02(GetCenterX+x, GetClipMinY, 1, 90, 1/20, speed, Small01, 10);
				CreateShot02(GetCenterX-x, GetClipMinY, 1, 90, 1/20, speed, Small01, 10);
				x+=50;
			}
			frame = 0;
		}
		if(frame2 >= 150) {
			SetMovePosition02(GetPlayerX+rand(-50, 50), GetCenterY/2+rand(-100, 100), 60);
			ascent(i in -3..4) {
				let v = 2;
				loop(8) {
					CreateShot01(GetX, GetY, v, GetAngleToPlayer+i*11, GArrow06, 10);
					v+=1/2;
				}
			}
		frame2 = 0; }
	}
	@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);
	}
}