#TouhouDanmakufu[Plural]
#ScriptVersion[3]
#Title["Where the Firefly Flies"]
#Text["RaNGE 16 Contest entry         by DryTheMeowstic"]
#System["./default_system/Default_System.txt"]
#Background["./bakaground.txt"]

#include"./Functions/Resources.txt"
#include"./Functions/Basic.txt"

let bossBGM = GetCurrentScriptDirectory ~ "./Functions/se/BGM.ogg";
LoadSound(bossBGM);

@Initialize
{
	SetPlayerLife(5);
	TPlural();
	wait(60);
	PlayBGM(bossBGM,0,60*1+54.4); 
}

@MainLoop
{
	yield;
}

@Finalize
{
}

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

task TPlural
{
	let dir = GetCurrentScriptDirectory();

	PlaytestInvincibility;
	
	let obj = ObjEnemyBossScene_Create();
	ObjEnemyBossScene_Add(obj, 0, dir ~ "NS1.txt");
	ObjEnemyBossScene_Add(obj, 0, dir ~ "SP1.txt");
	ObjEnemyBossScene_Add(obj, 1, dir ~ "NS2.txt");
	ObjEnemyBossScene_Add(obj, 1, dir ~ "SP2.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "NS3.txt");
	ObjEnemyBossScene_Add(obj, 2, dir ~ "SP3.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "NS4.txt");
	ObjEnemyBossScene_Add(obj, 3, dir ~ "SP4.txt");
	ObjEnemyBossScene_Add(obj, 4, dir ~ "SP5.txt");
	
	ObjEnemyBossScene_LoadInThread(obj);
	ObjEnemyBossScene_Regist(obj);

	while(!Obj_IsDeleted(obj))
	{
		if(Obj_IsDeleted(obj)){PlaySound(GetCurrentScriptDirectory ~ "Functions/sfx/death.wav");}
		yield;
	}
	
	CloseScript(GetOwnScriptID());
}

