#TouhouDanmakufu[Plural]
#Title["Seija Boss Battle"]
#Player[FREE]
#System["./SystemData/PrivateScript/System_Main.dnh"]
#ScriptVersion[3]

let CSD = GetCurrentScriptDirectory;

let BGScript = CSD ~ "./SystemData/PrivateScript/System_BG.dnh";

let NORMAL_01 	= CSD ~ "./Seija_Normal01.dnh";
let SPELL_01	= CSD ~ "./Seija_Spell01.dnh";
let NORMAL_02 	= CSD ~ "./Seija_Normal02.dnh";
let SPELL_02 	= CSD ~ "./Seija_Spell02.dnh";
let NORMAL_03 	= CSD ~ "./Seija_Normal03.dnh";
let SPELL_03 	= CSD ~ "./Seija_Spell03.dnh";
let SPELL_04 	= CSD ~ "./Seija_Spell04.dnh";

@Initialize{
	SetPlayerLife(4);
	SetPlayerSpell(3);
	BossThread_Initialize;
	BGMThread_Initialize;
	//----------//
	let objBG = LoadScript(BGScript);
	StartScript(objBG);
}

@MainLoop{
	yield;
}

task BossThread_Initialize{
	let objPlural = ObjEnemyBossScene_Create;
	
	ObjEnemyBossScene_Add(objPlural,0,NORMAL_01);
	ObjEnemyBossScene_Add(objPlural,0,SPELL_01);
	
	ObjEnemyBossScene_Add(objPlural,1,NORMAL_02);
	ObjEnemyBossScene_Add(objPlural,1,SPELL_02);
	
	ObjEnemyBossScene_Add(objPlural,2,NORMAL_03);
	ObjEnemyBossScene_Add(objPlural,2,SPELL_03);
	
	ObjEnemyBossScene_Add(objPlural,3,SPELL_04);
	
	ObjEnemyBossScene_LoadInThread(objPlural);
	ObjEnemyBossScene_Regist(objPlural);
	
	while(!Obj_IsDeleted(objPlural)){ yield; }
	
	CloseScript(GetOwnScriptID);
}

task BGMThread_Initialize{
	loop(140){ yield; }
	let BGMPath = CSD ~ "./SystemData/SoundData/BGM/bgm.mp3";
	
	let objBGM = ObjSound_Create;
	ObjSound_Load(objBGM,BGMPath);
	ObjSound_SetSoundDivision(objBGM,SOUND_BGM);
	ObjSound_SetLoopEnable(objBGM,true);
	ObjSound_SetRestartEnable(objBGM,true);
	ObjSound_Play(objBGM);
}