Implement/match Ambulance::ActivateSceneActions (#1023)

This commit is contained in:
Christian Semmler 2024-06-12 10:08:55 -04:00 committed by GitHub
parent 2a88d06ff9
commit 475d21f8c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 5 deletions

View file

@ -97,7 +97,7 @@ class Ambulance : public IslePathActor {
void CreateState(); void CreateState();
void FUN_10036e60(); void FUN_10036e60();
void FUN_10037060(); void ActivateSceneActions();
void StopActions(); void StopActions();
void FUN_10037250(); void FUN_10037250();

View file

@ -3,6 +3,7 @@
#include "decomp.h" #include "decomp.h"
#include "isle.h" #include "isle.h"
#include "isle_actions.h" #include "isle_actions.h"
#include "jukebox_actions.h"
#include "legoanimationmanager.h" #include "legoanimationmanager.h"
#include "legocontrolmanager.h" #include "legocontrolmanager.h"
#include "legogamestate.h" #include "legogamestate.h"
@ -289,10 +290,51 @@ MxLong Ambulance::HandleControl(LegoControlManagerEvent& p_param)
return 0; return 0;
} }
// STUB: LEGO1 0x10037060 // FUNCTION: LEGO1 0x10037060
void Ambulance::FUN_10037060() void Ambulance::ActivateSceneActions()
{ {
// TODO PlayMusic(JukeboxScript::c_Hospital_Music);
if (m_state->m_unk0x08 == 1) {
m_state->m_unk0x08 = 0;
PlayAction(IsleScript::c_ham033cl_PlayWav);
}
else if (m_unk0x16c != 0 && m_unk0x16e != 0) {
IsleScript::Script objectId;
switch (rand() % 2) {
case 0:
objectId = IsleScript::c_ham076cl_PlayWav;
break;
case 1:
objectId = IsleScript::c_ham088cl_PlayWav;
break;
}
if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
}
PlayAction(objectId);
}
else {
IsleScript::Script objectId;
switch (rand() % 2) {
case 0:
objectId = IsleScript::c_ham075cl_PlayWav;
break;
case 1:
objectId = IsleScript::c_ham113cl_PlayWav;
break;
}
if (m_lastAction != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_stop, *g_isleScript, m_lastAction, NULL);
}
PlayAction(objectId);
}
} }
// FUNCTION: LEGO1 0x10037160 // FUNCTION: LEGO1 0x10037160

View file

@ -1026,7 +1026,7 @@ MxLong Isle::HandleTransitionEnd()
FUN_10032d30(IsleScript::c_AmbulanceFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE); FUN_10032d30(IsleScript::c_AmbulanceFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) { if (!m_act1state->m_unk0x01f) {
m_ambulance->FUN_10037060(); m_ambulance->ActivateSceneActions();
} }
break; break;
case LegoGameState::e_towtrack: case LegoGameState::e_towtrack: