#TouhouDanmakufu[Plural]
#ScriptVersion[3]
#System["./../../system/Default_System.txt"]

#include "./../../system/functions/functions_world.txt"

let BossScene;
let MBossScene;

task TMain
{
	//let Back = LoadScript(GetCurrentScriptDirectory ~ "boss/Background.txt");
	//StartScript(Back);

	loop(0)
		{
		PlayMusic("bgm_Stage");
		let Enemy = LoadScript(GetCurrentScriptDirectory ~ "Enemy.txt");
		StartScript(Enemy);
		while(!IsCloseScript(Enemy)){yield;}
		Obj_Delete(Enemy);
		}

	LoadBoss;
	PlayMusic("bgm_Boss");
	ObjEnemyBossScene_Regist(BossScene);
	while(!Obj_IsDeleted(BossScene)){yield;}

	SetCommonData("BACKGROUND_END",2);
	SetForbidPlayerShot(true);
	SetForbidPlayerSpell(true);
	loop(150){yield;}
	EndCurrentMusic;
	//CloseScript(Back);
	CloseStgScene;
}

task LoadBoss
{
	BossScene = ObjEnemyBossScene_Create();
	let path = GetCurrentScriptDirectory ~ "boss/";
	ObjEnemyBossScene_Add(BossScene, 0, path ~ "Init.txt");
	ObjEnemyBossScene_Add(BossScene, 0, path ~ "Base1.txt");
	ObjEnemyBossScene_Add(BossScene, 0, path ~ "Spell1.txt");
	ObjEnemyBossScene_Add(BossScene, 1, path ~ "Base2.txt");
	ObjEnemyBossScene_Add(BossScene, 1, path ~ "Spell2.txt");
	ObjEnemyBossScene_Add(BossScene, 1, path ~ "End.txt");
	ObjEnemyBossScene_LoadInThread(BossScene);
}