Implement/match Ambulance::HandleClick (#1019)

* Implement/match Ambulance::HandleClick

* Remove junk

* Add Ambulance::FUN_10036e60
This commit is contained in:
Christian Semmler 2024-06-11 14:19:41 -04:00 committed by GitHub
parent 5311951bc7
commit ebc200bea3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 41 additions and 6 deletions

View file

@ -49,7 +49,7 @@ class AmbulanceMissionState : public LegoState {
// AmbulanceMissionState::`scalar deleting destructor'
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
MxLong m_unk0x0c; // 0x0c
MxU16 m_unk0x10; // 0x10
MxU16 m_unk0x12; // 0x12
MxU16 m_unk0x14; // 0x14

View file

@ -1,6 +1,7 @@
#include "ambulance.h"
#include "decomp.h"
#include "isle.h"
#include "isle_actions.h"
#include "legoanimationmanager.h"
#include "legocontrolmanager.h"
@ -14,6 +15,7 @@
#include "mxmisc.h"
#include "mxticklemanager.h"
#include "mxtimer.h"
#include "mxtransitionmanager.h"
#include "mxvariabletable.h"
#include "scripts.h"
@ -227,17 +229,50 @@ MxLong Ambulance::HandleNotification19(MxType19NotificationParam& p_param)
return 0;
}
// STUB: LEGO1 0x10036ce0
// FUNCTION: LEGO1 0x10036ce0
// FUNCTION: BETA10 0x10023506
MxLong Ambulance::HandleClick()
{
// TODO
return 0;
if (((Act1State*) GameState()->GetState("Act1State"))->m_unk0x018 != 10) {
return 1;
}
if (m_state->m_unk0x08 == 2) {
return 1;
}
FUN_10015820(TRUE, 0);
((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_ambulance);
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
if (CurrentActor()->GetActorId() != GameState()->GetActorId()) {
((IslePathActor*) CurrentActor())->Exit();
}
m_time = Timer()->GetTime();
m_unk0x16a = CurrentActor()->GetActorId();
Enter();
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_AmbulanceDashboard, NULL);
ControlManager()->Register(this);
if (m_state->m_unk0x08 == 1) {
SpawnPlayer(LegoGameState::e_unk31, TRUE, 0);
m_state->m_unk0x0c = Timer()->GetTime();
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_pns018rd_RunAnim, NULL);
}
return 1;
}
// STUB: LEGO1 0x10036e60
// FUNCTION: LEGO1 0x10036e60
// FUNCTION: BETA10 0x100236bb
void Ambulance::FUN_10036e60()
{
// TODO
m_state->m_unk0x08 = 2;
PlayAnimation(IsleScript::c_hho027en_RunAnim);
m_lastAction = IsleScript::c_noneIsle;
m_lastAnimation = IsleScript::c_noneIsle;
}
// STUB: LEGO1 0x10036e90