ScarletBlackMarket/script/game/Boss_Plural.dnh

107 lines
2.4 KiB
Plaintext
Raw Permalink Normal View History

2022-08-22 10:14:18 +00:00
#TouhouDanmakufu[Plural]
#ScriptVersion[3]
#Title["Boss Plural"]
#Text["..."]
#System["script/KevinSystem/Kevin_System.txt"]
//#Player["script/KevinPackage/KevinScript_Players/PankevKouda/KevKou_Main.dnh", "script/KevinPackage/KevinScript_Players/MariHousui/MariHousui_Main.dnh"]
let csd = GetCurrentScriptDirectory();
let obj = ObjEnemyBossScene_Create();
int objBGM = ObjSound_Create();
2022-08-22 10:14:18 +00:00
#include "script/KevinSystem/Universal_Lib.txt"
#include "script/game/Stage_Background.dnh"
bool bossTrueStart = false;
float BGMRate = GetAreaCommonData("Config", "BGMVol", 100) * 0.01;
2022-08-22 10:14:18 +00:00
@Event{
alternative (GetEventType())
case(EV_PAUSE_ENTER){
if (bossTrueStart) {ObjSound_Stop(objBGM);}
}
case(EV_PAUSE_LEAVE){
if (bossTrueStart) {ObjSound_Play(objBGM);}
}
2022-08-22 10:14:18 +00:00
}
@Initialize{
if(!IsCommonDataAreaExists("PIV")){
CreateCommonDataArea("PIV");
SetAreaCommonData("PIV", "currentvalue", 10000);
}
else{}
2022-08-23 09:48:09 +00:00
SetPlayerLife(GetAreaCommonData("Config", "StartingLife", 5));
2022-08-22 10:14:18 +00:00
SetAutoDeleteObject(true);
ObjSound_Load(objBGM, "script/game/resourceLib/bossTheme.ogg");
ObjSound_SetSoundDivision(objBGM, SOUND_BGM);
ObjSound_SetResumeEnable(objBGM, true);
ObjSound_SetLoopEnable(objBGM, true);
ObjSound_SetLoopTime(objBGM, 0.00, 89.618);
ObjSound_SetVolumeRate(objBGM, 99*BGMRate);
2022-08-22 10:14:18 +00:00
PluralTask();
}
@MainLoop{
yield;
}
@Finalize
{
}
/* TO DO:
+ Single *syncing* - ensure that the boss stays at the same position
*/
// Task to handle the plural's boss scene
task PluralTask(){
// Registering individual singles
ObjEnemyBossScene_Add(obj, 0, csd ~ "Non1.dnh");
ObjEnemyBossScene_Add(obj, 0, csd ~ "Spell1.dnh");
ObjEnemyBossScene_Add(obj, 0, csd ~ "Non2.dnh");
ObjEnemyBossScene_Add(obj, 0, csd ~ "Spell2.dnh");
ObjEnemyBossScene_Add(obj, 0, csd ~ "Non3.dnh");
ObjEnemyBossScene_Add(obj, 0, csd ~ "Spell3.dnh");
_ScrollBackground();
2022-08-22 10:14:18 +00:00
// Loading and registering the boss scene
ObjEnemyBossScene_LoadInThread(obj);
ObjEnemyBossScene_Regist(obj);
bossTrueStart = true;
ObjSound_Play(objBGM);
2022-08-23 09:48:09 +00:00
async{
while(GetPlayerState() != STATE_END){yield;}
ObjSound_Stop(objBGM);
}
2022-08-22 10:14:18 +00:00
while(!Obj_IsDeleted(obj)){
yield;
}
ObjSound_Stop(objBGM);
bossTrueStart = false;
2022-08-22 10:14:18 +00:00
_ExplosionEffect(GetCommonData("Boss Position X", STG_WIDTH/2), GetCommonData("Boss Position Y", STG_WIDTH/2), PetalEffect);
SetAutoDeleteObject(true);
wait(120);
CloseScript(GetOwnScriptID());
}