#TouhouDanmakufu[Stage]
#ScriptVersion[3]
#Title["The Forgot Warship - Normal"]
#Text["Normal"]
#System["script/LOCAA7 - The Forgot Warship/System/system/Default_system.txt"]
#include "script/LOCAA7 - The Forgot Warship/System/Index_Stage.txt"

let GCSD = GetCurrentScriptDirectory;


let bossbgm = GCSD ~ "BGM.mp3";
let bg = LoadScript("script/LOCAA7 - The Forgot Warship/script/StageBG.txt");
let obj=ObjEnemyBossScene_Create();

@Initialize
{
	StartScript(bg);
	SetPlayerLife(7);
	TAutoDeath;
	TStage;
	}

@MainLoop
{

	yield;
}

@Finalize
{
}

function wait(n){loop(n){yield;}}

task BGM_boss
{
	LoadSound(bossbgm);
	PlayBGM(bossbgm,17.20209,60+53.36433);
}

task Music {
	let path = GCSD ~ "BGM.mp3";
	let sound = ObjSound_Create();
	ObjSound_Load(sound,path);
	ObjSound_SetVolumeRate(sound,90);
	ObjSound_SetLoopEnable(sound,true);
	ObjSound_SetLoopTime(sound,17.20209,60+53.36433);
	ObjSound_Play(sound);
}

task TStage
{
	StartScript(bg);
	Music;
	TScene01;
}

task TScene01
{
	
	let dir = GetCurrentScriptDirectory();
	let path = dir ~ "PluralN.h";
	let idScript = LoadScriptInThread(path);

	StartScript(idScript);

	
	while(!IsCloseScript(idScript))
	{
		yield;
	}
	wait(180);
	CloseScript(idScript);
	CloseStgScene;
}



task TAutoDeath
{
	while(GetPlayerState != STATE_END)
	{
		yield;
	}
	wait(180);
	CloseStgScene;
}