#TouhouDanmakufu[Stage]
#ScriptVersion[3]
#Title["Easyish"]
#Text["For those kids who keep[r]vandalizing the shrine"]
#Image["./img/ExRumia.png"]
#Background["./Script/system/Background.txt"]
#include "./Script/functions.txt"

@Initialize
{
	SetPlayerLife(1000);
	PlayMusic(bgm_Stage);
	TStage();
}

@MainLoop
{
	yield;
}
@Event
{
	alternative(GetEventType())

	case(EV_PAUSE_ENTER)
		{
		ObjSound_Stop(musicObj);
		}
	case(EV_PAUSE_LEAVE)
		{
		ObjSound_Play(musicObj);
		}
}

@Finalize
{
}


task TStage
{
	let dir = GetCurrentScriptDirectory();

	let idScriptM = LoadScriptInThread(dir ~ "Script/PluralMB.txt");
	let idScriptI = LoadScriptInThread(dir ~ "Script/BossInitP.txt");
	let idScript = LoadScriptInThread(dir ~ "Script/PluralB.txt");

	TSongName("Stars Brightening Under the Moonlight ~ Moonlight and Starshine");
	loop(60){yield;}
	StartScript(idScriptM);
	while(!IsCloseScript(idScriptM))
		{
		yield;
		}
	PlaySound(se_DieMid,100);
	loop(450){yield;}

	StartScript(idScriptI);
	while(!IsCloseScript(idScriptI))
		{
		yield;
		}

	TSongName("Armageddon ~ The Final Decisive Battle");
	Obj_Delete(musicObj);
	PlayMusic(bgm_Boss);

	StartScript(idScript);
	while(!IsCloseScript(idScript))
		{
		yield;
		}
	PlaySound(se_Die,100);
	loop(600){yield;}
	CloseStgScene();	
}