2023-06-29 04:10:08 -04:00
|
|
|
#include "isle.h"
|
|
|
|
|
2024-05-03 12:19:12 -04:00
|
|
|
#include "3dmanager/lego3dmanager.h"
|
2023-12-15 18:11:34 -05:00
|
|
|
#include "act1state.h"
|
2023-12-16 11:01:22 -05:00
|
|
|
#include "ambulance.h"
|
2024-03-16 14:20:44 -04:00
|
|
|
#include "bike.h"
|
|
|
|
#include "carracestate.h"
|
|
|
|
#include "dunebuggy.h"
|
|
|
|
#include "helicopter.h"
|
2024-03-17 13:01:47 -04:00
|
|
|
#include "isle_actions.h"
|
2023-12-15 17:29:32 -05:00
|
|
|
#include "islepathactor.h"
|
2024-03-16 14:20:44 -04:00
|
|
|
#include "jetski.h"
|
|
|
|
#include "jetskiracestate.h"
|
2024-03-17 13:01:47 -04:00
|
|
|
#include "jukebox_actions.h"
|
2024-03-16 14:20:44 -04:00
|
|
|
#include "jukeboxentity.h"
|
|
|
|
#include "legoanimationmanager.h"
|
2024-05-03 12:19:12 -04:00
|
|
|
#include "legobackgroundcolor.h"
|
2023-12-15 18:11:34 -05:00
|
|
|
#include "legocontrolmanager.h"
|
|
|
|
#include "legoinputmanager.h"
|
2024-05-04 08:06:32 -04:00
|
|
|
#include "legomain.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "legoutils.h"
|
2024-03-17 13:26:41 -04:00
|
|
|
#include "legovariables.h"
|
2024-03-16 14:20:44 -04:00
|
|
|
#include "legovideomanager.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "misc.h"
|
2024-03-16 14:20:44 -04:00
|
|
|
#include "motocycle.h"
|
2024-05-03 12:19:12 -04:00
|
|
|
#include "mxactionnotificationparam.h"
|
2024-03-18 15:00:58 -04:00
|
|
|
#include "mxbackgroundaudiomanager.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "mxmisc.h"
|
2023-12-14 18:24:21 -05:00
|
|
|
#include "mxnotificationmanager.h"
|
2024-03-17 13:01:47 -04:00
|
|
|
#include "mxstillpresenter.h"
|
2023-12-15 18:11:34 -05:00
|
|
|
#include "mxtransitionmanager.h"
|
2024-05-03 12:19:12 -04:00
|
|
|
#include "mxvariabletable.h"
|
2023-12-16 11:01:22 -05:00
|
|
|
#include "pizza.h"
|
2024-05-04 08:06:32 -04:00
|
|
|
#include "scripts.h"
|
2024-03-16 14:20:44 -04:00
|
|
|
#include "skateboard.h"
|
2023-12-16 11:01:22 -05:00
|
|
|
#include "towtrack.h"
|
2023-12-14 18:24:21 -05:00
|
|
|
|
2024-03-22 21:30:58 -04:00
|
|
|
DECOMP_SIZE_ASSERT(Isle, 0x140)
|
2023-12-14 18:24:21 -05:00
|
|
|
|
2024-03-16 14:20:44 -04:00
|
|
|
// GLOBAL: LEGO1 0x100f1198
|
|
|
|
undefined4 g_unk0x100f1198 = 0x7f;
|
|
|
|
|
2023-12-14 18:24:21 -05:00
|
|
|
// FUNCTION: LEGO1 0x10030820
|
2023-06-29 04:10:08 -04:00
|
|
|
Isle::Isle()
|
|
|
|
{
|
2023-12-15 18:11:34 -05:00
|
|
|
m_pizza = NULL;
|
|
|
|
m_pizzeria = NULL;
|
|
|
|
m_towtrack = NULL;
|
|
|
|
m_ambulance = NULL;
|
|
|
|
m_jukebox = NULL;
|
|
|
|
m_helicopter = NULL;
|
|
|
|
m_bike = NULL;
|
|
|
|
m_dunebuggy = NULL;
|
2024-01-14 17:00:03 -05:00
|
|
|
m_motocycle = NULL;
|
2023-12-15 18:11:34 -05:00
|
|
|
m_skateboard = NULL;
|
|
|
|
m_racecar = NULL;
|
|
|
|
m_jetski = NULL;
|
2024-03-18 10:38:02 -04:00
|
|
|
m_act1state = NULL;
|
2024-03-17 13:01:47 -04:00
|
|
|
m_destLocation = LegoGameState::e_undefined;
|
2023-12-14 18:24:21 -05:00
|
|
|
|
|
|
|
NotificationManager()->Register(this);
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2023-12-15 18:11:34 -05:00
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10030a50
|
|
|
|
Isle::~Isle()
|
|
|
|
{
|
|
|
|
TransitionManager()->SetWaitIndicator(NULL);
|
|
|
|
ControlManager()->Unregister(this);
|
|
|
|
|
|
|
|
if (InputManager()->GetWorld() == this) {
|
|
|
|
InputManager()->ClearWorld();
|
|
|
|
}
|
|
|
|
|
2024-02-26 11:19:16 -05:00
|
|
|
if (CurrentActor() != NULL) {
|
|
|
|
VTable0x6c(CurrentActor());
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
NotificationManager()->Unregister(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10030b20
|
2024-01-13 15:00:11 -05:00
|
|
|
MxResult Isle::Create(MxDSAction& p_dsAction)
|
2023-12-15 18:11:34 -05:00
|
|
|
{
|
2024-02-10 11:37:22 -05:00
|
|
|
GameState()->FindLoadedAct();
|
2024-01-13 15:00:11 -05:00
|
|
|
MxResult result = LegoWorld::Create(p_dsAction);
|
2024-03-19 07:45:29 -04:00
|
|
|
|
2023-12-15 18:11:34 -05:00
|
|
|
if (result == SUCCESS) {
|
|
|
|
ControlManager()->Register(this);
|
|
|
|
InputManager()->SetWorld(this);
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->StopArea(LegoGameState::e_previousArea);
|
2023-12-15 18:11:34 -05:00
|
|
|
|
2024-02-10 11:37:22 -05:00
|
|
|
switch (GameState()->GetLoadedAct()) {
|
|
|
|
case LegoGameState::e_act2:
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->StopArea(LegoGameState::e_act2main);
|
2023-12-15 18:11:34 -05:00
|
|
|
break;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_act3:
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->StopArea(LegoGameState::e_act2main); // Looks like a bug
|
2023-12-15 18:11:34 -05:00
|
|
|
break;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_actNotFound:
|
2024-03-17 13:01:47 -04:00
|
|
|
m_destLocation = LegoGameState::e_infomain;
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
|
2024-02-10 13:17:07 -05:00
|
|
|
if (GameState()->GetCurrentArea() == LegoGameState::e_isle) {
|
2024-03-13 13:17:20 -04:00
|
|
|
GameState()->SetCurrentArea(LegoGameState::e_undefined);
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
LegoGameState* gameState = GameState();
|
2024-03-19 07:45:29 -04:00
|
|
|
Act1State* act1state = (Act1State*) gameState->GetState("Act1State");
|
|
|
|
if (act1state == NULL) {
|
|
|
|
act1state = (Act1State*) gameState->CreateState("Act1State");
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
2024-03-19 07:45:29 -04:00
|
|
|
m_act1state = act1state;
|
2023-12-15 18:11:34 -05:00
|
|
|
|
|
|
|
FUN_1003ef00(TRUE);
|
|
|
|
GameState()->SetDirty(TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2023-12-16 11:01:22 -05:00
|
|
|
// FUNCTION: LEGO1 0x10030c10
|
2023-12-15 18:11:34 -05:00
|
|
|
MxLong Isle::Notify(MxParam& p_param)
|
|
|
|
{
|
2023-12-16 11:01:22 -05:00
|
|
|
MxLong result = 0;
|
|
|
|
LegoWorld::Notify(p_param);
|
|
|
|
|
2024-01-12 17:27:07 -05:00
|
|
|
if (m_worldStarted) {
|
2023-12-16 11:01:22 -05:00
|
|
|
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
|
|
|
case c_notificationEndAction:
|
2024-03-18 15:00:58 -04:00
|
|
|
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
|
2023-12-16 11:01:22 -05:00
|
|
|
break;
|
|
|
|
case c_notificationButtonUp:
|
|
|
|
case c_notificationButtonDown:
|
2024-03-19 07:45:29 -04:00
|
|
|
switch (m_act1state->m_unk0x018) {
|
2023-12-16 11:01:22 -05:00
|
|
|
case 3:
|
|
|
|
result = m_pizza->Notify(p_param);
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
result = m_ambulance->Notify(p_param);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2024-01-31 09:47:15 -05:00
|
|
|
case c_notificationClick:
|
2024-03-18 12:31:22 -04:00
|
|
|
result = HandleClick((LegoControlManagerEvent&) p_param);
|
2023-12-16 11:01:22 -05:00
|
|
|
break;
|
2024-05-01 09:00:42 -04:00
|
|
|
case c_notificationEndAnim:
|
2024-03-19 07:45:29 -04:00
|
|
|
switch (m_act1state->m_unk0x018) {
|
2023-12-16 11:01:22 -05:00
|
|
|
case 4:
|
2024-02-26 11:19:16 -05:00
|
|
|
result = CurrentActor()->Notify(p_param);
|
2023-12-16 11:01:22 -05:00
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
result = m_towtrack->Notify(p_param);
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
result = m_ambulance->Notify(p_param);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2024-01-17 11:53:53 -05:00
|
|
|
case c_notificationType19:
|
2023-12-16 11:01:22 -05:00
|
|
|
result = HandleType19Notification(p_param);
|
|
|
|
break;
|
2024-01-17 11:53:53 -05:00
|
|
|
case c_notificationType20:
|
2024-02-02 12:18:46 -05:00
|
|
|
Enable(TRUE);
|
2023-12-16 11:01:22 -05:00
|
|
|
break;
|
2024-01-17 11:53:53 -05:00
|
|
|
case c_notificationTransitioned:
|
2023-12-16 11:01:22 -05:00
|
|
|
result = HandleTransitionEnd();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2024-03-18 15:00:58 -04:00
|
|
|
// FUNCTION: LEGO1 0x10030d90
|
|
|
|
MxLong Isle::HandleEndAction(MxEndActionNotificationParam& p_param)
|
2023-12-16 11:01:22 -05:00
|
|
|
{
|
2024-03-18 15:00:58 -04:00
|
|
|
MxLong result;
|
|
|
|
|
|
|
|
switch (m_act1state->m_unk0x018) {
|
|
|
|
case 2:
|
|
|
|
HandleElevatorEndAction();
|
|
|
|
result = 1;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
result = m_pizza->Notify(p_param);
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
result = m_towtrack->Notify(p_param);
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
result = m_ambulance->Notify(p_param);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
result = m_radio.Notify(p_param);
|
|
|
|
|
|
|
|
if (result == 0) {
|
|
|
|
MxDSAction* action = p_param.GetAction();
|
|
|
|
|
|
|
|
// TODO: Should be signed, but worsens match
|
|
|
|
MxU32 script;
|
|
|
|
|
|
|
|
if (action->GetAtomId() == *g_jukeboxScript) {
|
|
|
|
script = action->GetObjectId();
|
|
|
|
|
|
|
|
if (script >= JukeboxScript::c_JBMusic1 && script <= JukeboxScript::c_JBMusic6) {
|
|
|
|
m_jukebox->StopAction((JukeboxScript::Script) script);
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (m_act1state->m_planeActive) {
|
|
|
|
script = action->GetObjectId();
|
|
|
|
|
|
|
|
if (script >= IsleScript::c_nic002pr_RunAnim && script <= IsleScript::c_nic004pr_RunAnim) {
|
|
|
|
m_act1state->m_planeActive = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
script = action->GetObjectId();
|
|
|
|
|
|
|
|
if (script == IsleScript::c_Avo917In_PlayWav ||
|
|
|
|
(script >= IsleScript::c_Avo900Ps_PlayWav && script <= IsleScript::c_Avo907Ps_PlayWav)) {
|
|
|
|
BackgroundAudioManager()->RaiseVolume();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10030ef0
|
|
|
|
void Isle::HandleElevatorEndAction()
|
|
|
|
{
|
|
|
|
switch (m_act1state->m_elevFloor) {
|
|
|
|
case Act1State::c_floor1:
|
|
|
|
m_destLocation = LegoGameState::e_infomain;
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
|
|
|
break;
|
|
|
|
case Act1State::c_floor2:
|
|
|
|
if (m_act1state->m_unk0x01e) {
|
|
|
|
m_act1state->m_unk0x01e = FALSE;
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
|
|
|
InputManager()->EnableInputProcessing();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Floor2, NULL);
|
|
|
|
InputManager()->EnableInputProcessing();
|
|
|
|
m_act1state->m_unk0x01e = TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case Act1State::c_floor3:
|
|
|
|
m_destLocation = LegoGameState::e_elevopen;
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
|
|
|
break;
|
|
|
|
}
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
|
2024-01-13 15:42:09 -05:00
|
|
|
// FUNCTION: LEGO1 0x10030fc0
|
2024-01-27 15:18:35 -05:00
|
|
|
void Isle::ReadyWorld()
|
2023-12-15 18:11:34 -05:00
|
|
|
{
|
2024-01-27 15:18:35 -05:00
|
|
|
LegoWorld::ReadyWorld();
|
2024-01-13 15:42:09 -05:00
|
|
|
|
|
|
|
if (m_act1state->GetUnknown21()) {
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->SwitchArea(LegoGameState::e_infomain);
|
2024-01-13 15:42:09 -05:00
|
|
|
m_act1state->SetUnknown18(0);
|
|
|
|
m_act1state->SetUnknown21(0);
|
|
|
|
}
|
2024-03-18 10:38:02 -04:00
|
|
|
else if (GameState()->GetLoadedAct() != LegoGameState::e_act1) {
|
2024-01-13 15:42:09 -05:00
|
|
|
FUN_1003ef00(TRUE);
|
|
|
|
FUN_10032620();
|
|
|
|
m_act1state->FUN_10034d00();
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-01-13 15:42:09 -05:00
|
|
|
}
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
|
2024-03-18 12:31:22 -04:00
|
|
|
// FUNCTION: LEGO1 0x10031030
|
|
|
|
MxLong Isle::HandleClick(LegoControlManagerEvent& p_param)
|
2023-12-16 11:01:22 -05:00
|
|
|
{
|
2024-03-18 12:31:22 -04:00
|
|
|
if (p_param.GetUnknown0x28() == 1) {
|
|
|
|
MxDSAction action;
|
|
|
|
|
|
|
|
switch (p_param.GetClickedObjectId()) {
|
|
|
|
case IsleScript::c_ElevRide_Info_Ctl:
|
|
|
|
m_act1state->m_unk0x018 = 2;
|
|
|
|
|
|
|
|
switch (m_act1state->m_elevFloor) {
|
|
|
|
case Act1State::c_floor1:
|
|
|
|
m_destLocation = LegoGameState::e_infomain;
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
break;
|
|
|
|
case Act1State::c_floor2:
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Elev2_1_Ride, NULL);
|
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
break;
|
|
|
|
case Act1State::c_floor3:
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Elev3_1_Ride, NULL);
|
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_act1state->m_elevFloor = Act1State::c_floor1;
|
|
|
|
break;
|
|
|
|
case IsleScript::c_ElevRide_Two_Ctl:
|
|
|
|
m_act1state->m_unk0x018 = 2;
|
|
|
|
|
|
|
|
switch (m_act1state->m_elevFloor) {
|
|
|
|
case Act1State::c_floor1:
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Elev1_2_Ride, NULL);
|
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
break;
|
|
|
|
case Act1State::c_floor2:
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Floor2, NULL);
|
2024-03-18 15:00:58 -04:00
|
|
|
m_act1state->m_unk0x01e = TRUE;
|
2024-03-18 12:31:22 -04:00
|
|
|
break;
|
|
|
|
case Act1State::c_floor3:
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Elev3_2_Ride, NULL);
|
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_act1state->m_elevFloor = Act1State::c_floor2;
|
|
|
|
break;
|
|
|
|
case IsleScript::c_ElevRide_Three_Ctl:
|
|
|
|
m_act1state->m_unk0x018 = 2;
|
|
|
|
|
|
|
|
switch (m_act1state->m_elevFloor) {
|
|
|
|
case Act1State::c_floor1:
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Elev1_3_Ride, NULL);
|
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
break;
|
|
|
|
case Act1State::c_floor2:
|
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Elev2_3_Ride, NULL);
|
|
|
|
break;
|
|
|
|
case Act1State::c_floor3:
|
|
|
|
m_destLocation = LegoGameState::e_elevopen;
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_act1state->m_elevFloor = Act1State::c_floor3;
|
|
|
|
break;
|
|
|
|
case IsleScript::c_ElevOpen_LeftArrow_Ctl:
|
|
|
|
case IsleScript::c_ElevDown_RightArrow_Ctl:
|
|
|
|
m_destLocation = LegoGameState::e_seaview;
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
break;
|
|
|
|
case IsleScript::c_ElevOpen_RightArrow_Ctl:
|
|
|
|
case IsleScript::c_ElevDown_LeftArrow_Ctl:
|
|
|
|
m_destLocation = LegoGameState::e_observe;
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
break;
|
|
|
|
case IsleScript::c_Observe_LeftArrow_Ctl:
|
|
|
|
m_act1state->FUN_100346a0();
|
|
|
|
m_radio.Stop();
|
|
|
|
case IsleScript::c_SeaView_RightArrow_Ctl:
|
|
|
|
m_destLocation = LegoGameState::e_elevopen;
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
break;
|
|
|
|
case IsleScript::c_Observe_RightArrow_Ctl:
|
|
|
|
m_act1state->FUN_100346a0();
|
|
|
|
m_radio.Stop();
|
|
|
|
case IsleScript::c_SeaView_LeftArrow_Ctl:
|
|
|
|
m_destLocation = LegoGameState::e_elevdown;
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
break;
|
|
|
|
case IsleScript::c_Observe_Plane_Ctl:
|
|
|
|
if (!m_act1state->m_planeActive) {
|
|
|
|
switch (rand() % 3) {
|
|
|
|
case 0:
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_nic002pr_RunAnim, NULL);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_nic003pr_RunAnim, NULL);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_nic004pr_RunAnim, NULL);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_act1state->m_planeActive = TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case IsleScript::c_Observe_Sun_Ctl:
|
|
|
|
GameState()->GetBackgroundColor()->ToggleDayNight(TRUE);
|
|
|
|
break;
|
|
|
|
case IsleScript::c_Observe_Moon_Ctl:
|
|
|
|
GameState()->GetBackgroundColor()->ToggleDayNight(FALSE);
|
|
|
|
break;
|
|
|
|
case IsleScript::c_Observe_SkyColor_Ctl:
|
|
|
|
GameState()->GetBackgroundColor()->ToggleSkyColor();
|
|
|
|
break;
|
|
|
|
case IsleScript::c_Observe_LCab_Ctl:
|
|
|
|
action.SetAtomId(*g_isleScript);
|
|
|
|
action.SetObjectId(IsleScript::c_Observe_Monkey_Flc);
|
|
|
|
action.SetUnknown24(0);
|
|
|
|
Start(&action);
|
|
|
|
break;
|
|
|
|
case IsleScript::c_Observe_RCab_Ctl:
|
|
|
|
FUN_10031590();
|
|
|
|
break;
|
|
|
|
case IsleScript::c_Observe_GlobeLArrow_Ctl:
|
2024-03-28 10:27:44 -04:00
|
|
|
UpdateLightPosition(-1);
|
2024-03-18 12:31:22 -04:00
|
|
|
FUN_10031590();
|
|
|
|
break;
|
|
|
|
case IsleScript::c_Observe_GlobeRArrow_Ctl:
|
2024-03-28 10:27:44 -04:00
|
|
|
UpdateLightPosition(1);
|
2024-03-18 12:31:22 -04:00
|
|
|
FUN_10031590();
|
|
|
|
break;
|
|
|
|
case IsleScript::c_Observe_Draw1_Ctl:
|
|
|
|
case IsleScript::c_Observe_Draw2_Ctl:
|
|
|
|
m_act1state->FUN_10034660();
|
|
|
|
break;
|
|
|
|
case IsleScript::c_ElevDown_Elevator_Ctl:
|
|
|
|
m_destLocation = LegoGameState::e_elevride2;
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
break;
|
|
|
|
case IsleScript::c_PoliDoor_LeftArrow_Ctl:
|
|
|
|
case IsleScript::c_PoliDoor_RightArrow_Ctl:
|
|
|
|
m_destLocation = LegoGameState::e_police;
|
|
|
|
VariableTable()->SetVariable("VISIBILITY", "Show Policsta");
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
break;
|
|
|
|
case IsleScript::c_PoliDoor_Door_Ctl:
|
|
|
|
m_destLocation = LegoGameState::e_unk33;
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
break;
|
|
|
|
case IsleScript::c_GaraDoor_LeftArrow_Ctl:
|
|
|
|
case IsleScript::c_GaraDoor_RightArrow_Ctl:
|
|
|
|
m_destLocation = LegoGameState::e_garage;
|
|
|
|
VariableTable()->SetVariable("VISIBILITY", "Show Gas");
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
break;
|
|
|
|
case IsleScript::c_GaraDoor_Door_Ctl:
|
|
|
|
m_destLocation = LegoGameState::e_unk28;
|
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-16 11:01:22 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2024-03-18 12:31:22 -04:00
|
|
|
// STUB: LEGO1 0x10031590
|
|
|
|
void Isle::FUN_10031590()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2023-12-16 11:01:22 -05:00
|
|
|
// STUB: LEGO1 0x100315f0
|
|
|
|
MxLong Isle::HandleType19Notification(MxParam& p_param)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2024-03-16 14:20:44 -04:00
|
|
|
// FUNCTION: LEGO1 0x10031820
|
2024-02-02 12:18:46 -05:00
|
|
|
void Isle::Enable(MxBool p_enable)
|
2023-12-15 18:11:34 -05:00
|
|
|
{
|
2024-02-02 12:18:46 -05:00
|
|
|
if (m_set0xd0.empty() == p_enable) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
LegoWorld::Enable(p_enable);
|
|
|
|
m_radio.Initialize(p_enable);
|
|
|
|
|
|
|
|
if (p_enable) {
|
2024-03-16 14:20:44 -04:00
|
|
|
FUN_100330e0();
|
|
|
|
|
|
|
|
VideoManager()->ResetPalette(FALSE);
|
|
|
|
m_act1state->FUN_10034d00();
|
|
|
|
|
|
|
|
if (CurrentActor() != NULL && CurrentActor()->GetActorId() != 0) {
|
|
|
|
// TODO: Match, most likely an inline function
|
|
|
|
MxS32 targetEntityId = (CurrentActor()->GetActorId() == 1) + 250;
|
|
|
|
|
|
|
|
if (targetEntityId != -1) {
|
|
|
|
InvokeAction(Extra::e_start, *g_isleScript, targetEntityId, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
InputManager()->SetWorld(this);
|
|
|
|
GameState()->StopArea(LegoGameState::e_previousArea);
|
|
|
|
GameState()->m_previousArea = GameState()->m_currentArea;
|
|
|
|
|
|
|
|
FUN_1003ef00(TRUE);
|
|
|
|
|
|
|
|
if (m_act1state->m_unk0x018 == 0) {
|
2024-05-10 14:07:38 -04:00
|
|
|
MxS32 locations[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
|
2024-03-16 14:20:44 -04:00
|
|
|
|
|
|
|
for (MxU32 i = 0; i < 5; i++) {
|
2024-05-10 10:23:47 -04:00
|
|
|
MxS32 r = rand() % 5;
|
2024-03-16 14:20:44 -04:00
|
|
|
|
2024-05-14 10:35:22 -04:00
|
|
|
for (MxU32 j = 0; j < sizeOfArray(locations); j++) {
|
2024-05-10 14:07:38 -04:00
|
|
|
if (locations[j] != 0 && r-- == 0) {
|
|
|
|
AnimationManager()->AddExtra(locations[j], TRUE);
|
|
|
|
locations[j] = 0;
|
2024-03-16 14:20:44 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (CurrentActor() != NULL && CurrentActor()->IsA("Jetski")) {
|
|
|
|
IslePathActor* actor = CurrentActor();
|
2024-05-04 10:13:05 -04:00
|
|
|
actor->SpawnPlayer(
|
|
|
|
LegoGameState::e_unk45,
|
|
|
|
FALSE,
|
|
|
|
IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3
|
|
|
|
);
|
2024-03-30 12:18:15 -04:00
|
|
|
actor->SetState(0);
|
2024-03-16 14:20:44 -04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_10032620();
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (GameState()->m_currentArea) {
|
|
|
|
case LegoGameState::e_elevride:
|
2024-03-17 13:01:47 -04:00
|
|
|
m_destLocation = LegoGameState::e_elevride;
|
2024-04-22 08:11:38 -04:00
|
|
|
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
|
2024-03-16 14:20:44 -04:00
|
|
|
SetIsWorldActive(FALSE);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_jetrace2:
|
|
|
|
if (((JetskiRaceState*) GameState()->GetState("JetskiRaceState"))->GetUnknown0x28() == 2) {
|
|
|
|
m_act1state->m_unk0x018 = 5;
|
|
|
|
}
|
|
|
|
|
2024-05-13 06:46:59 -04:00
|
|
|
AddPathActor(CurrentActor());
|
2024-03-16 14:20:44 -04:00
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_jetski->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_jetski->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_garadoor:
|
2024-03-17 13:01:47 -04:00
|
|
|
m_destLocation = LegoGameState::e_garadoor;
|
2024-04-22 08:11:38 -04:00
|
|
|
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
|
2024-03-16 14:20:44 -04:00
|
|
|
SetIsWorldActive(FALSE);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_polidoor:
|
2024-03-17 13:01:47 -04:00
|
|
|
m_destLocation = LegoGameState::e_polidoor;
|
2024-04-22 08:11:38 -04:00
|
|
|
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
|
2024-03-16 14:20:44 -04:00
|
|
|
SetIsWorldActive(FALSE);
|
|
|
|
break;
|
2024-03-17 13:01:47 -04:00
|
|
|
case LegoGameState::e_bike:
|
2024-05-13 06:46:59 -04:00
|
|
|
AddPathActor(CurrentActor());
|
2024-03-16 14:20:44 -04:00
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_bike->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_bike->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
2024-03-17 13:01:47 -04:00
|
|
|
case LegoGameState::e_dunecar:
|
2024-05-13 06:46:59 -04:00
|
|
|
AddPathActor(CurrentActor());
|
2024-03-16 14:20:44 -04:00
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_dunebuggy->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_dunebuggy->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
2024-03-17 13:01:47 -04:00
|
|
|
case LegoGameState::e_motocycle:
|
2024-05-13 06:46:59 -04:00
|
|
|
AddPathActor(CurrentActor());
|
2024-03-16 14:20:44 -04:00
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_motocycle->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_motocycle->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
2024-03-17 13:01:47 -04:00
|
|
|
case LegoGameState::e_copter:
|
2024-05-13 06:46:59 -04:00
|
|
|
AddPathActor(CurrentActor());
|
2024-03-16 14:20:44 -04:00
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_helicopter->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_helicopter->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
2024-03-17 13:01:47 -04:00
|
|
|
case LegoGameState::e_skateboard:
|
2024-05-13 06:46:59 -04:00
|
|
|
AddPathActor(CurrentActor());
|
2024-03-16 14:20:44 -04:00
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_skateboard->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_skateboard->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
2024-03-17 13:01:47 -04:00
|
|
|
case LegoGameState::e_jetski:
|
2024-05-13 06:46:59 -04:00
|
|
|
AddPathActor(CurrentActor());
|
2024-03-16 14:20:44 -04:00
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
LegoEventNotificationParam param(c_notificationType11, NULL, 0, 0, 0, 0);
|
|
|
|
m_jetski->Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
m_jetski->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0));
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
InputManager()->SetCamera(m_cameraController);
|
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (m_act1state->m_unk0x018) {
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
|
|
|
|
|
|
|
if (GameState()->m_currentArea == LegoGameState::e_pizzeriaExterior) {
|
2024-05-01 07:36:58 -04:00
|
|
|
AnimationManager()->FUN_10064740(NULL);
|
2024-03-16 14:20:44 -04:00
|
|
|
}
|
|
|
|
else if (GameState()->m_currentArea == LegoGameState::e_unk66) {
|
|
|
|
Mx3DPointFloat position(CurrentActor()->GetROI()->GetWorldPosition());
|
|
|
|
|
|
|
|
Mx3DPointFloat sub(-21.375f, 0.0f, -41.75f);
|
2024-04-07 08:03:21 -04:00
|
|
|
((Vector3&) sub).Sub(&position);
|
|
|
|
if (sub.LenSquared() < 1024.0f) {
|
2024-05-01 07:36:58 -04:00
|
|
|
AnimationManager()->FUN_10064740(NULL);
|
2024-03-16 14:20:44 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Mx3DPointFloat sub2(98.874992f, 0.0f, -46.156292f);
|
2024-04-07 08:03:21 -04:00
|
|
|
((Vector3&) sub2).Sub(&position);
|
|
|
|
if (sub2.LenSquared() < 1024.0f) {
|
2024-05-01 07:36:58 -04:00
|
|
|
AnimationManager()->FUN_10064670(NULL);
|
2024-03-16 14:20:44 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5: {
|
2024-05-04 10:13:05 -04:00
|
|
|
CurrentActor()->SpawnPlayer(
|
|
|
|
LegoGameState::e_jetrace2,
|
|
|
|
FALSE,
|
|
|
|
IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3
|
|
|
|
);
|
2024-03-16 14:20:44 -04:00
|
|
|
JetskiRaceState* raceState = (JetskiRaceState*) GameState()->GetState("JetskiRaceState");
|
|
|
|
|
|
|
|
if (raceState->GetUnknown0x28() == 2) {
|
2024-03-19 07:45:29 -04:00
|
|
|
IsleScript::Script script = IsleScript::c_noneIsle;
|
2024-03-16 14:20:44 -04:00
|
|
|
|
|
|
|
switch (raceState->GetState(GameState()->GetActorId())->GetUnknown0x02()) {
|
|
|
|
case 1:
|
2024-03-19 07:45:29 -04:00
|
|
|
script = IsleScript::c_sjs014in_RunAnim;
|
2024-03-16 14:20:44 -04:00
|
|
|
break;
|
|
|
|
case 2:
|
2024-03-19 07:45:29 -04:00
|
|
|
script = IsleScript::c_sjs013in_RunAnim;
|
2024-03-16 14:20:44 -04:00
|
|
|
break;
|
|
|
|
case 3:
|
2024-03-19 07:45:29 -04:00
|
|
|
script = IsleScript::c_sjs012in_RunAnim;
|
2024-03-16 14:20:44 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2024-05-01 07:36:58 -04:00
|
|
|
AnimationManager()->FUN_10060dc0(script, NULL, TRUE, TRUE, NULL, FALSE, FALSE, TRUE, FALSE);
|
2024-03-16 14:20:44 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
|
|
|
FUN_1003ef00(FALSE);
|
2024-05-01 07:36:58 -04:00
|
|
|
AnimationManager()->FUN_10064670(NULL);
|
2024-03-16 14:20:44 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 6: {
|
|
|
|
GameState()->m_currentArea = LegoGameState::e_carraceExterior;
|
2024-05-04 10:13:05 -04:00
|
|
|
CurrentActor()->SpawnPlayer(
|
|
|
|
LegoGameState::e_unk21,
|
|
|
|
FALSE,
|
|
|
|
IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3
|
|
|
|
);
|
2024-03-16 14:20:44 -04:00
|
|
|
CarRaceState* raceState = (CarRaceState*) GameState()->GetState("CarRaceState");
|
|
|
|
|
|
|
|
if (raceState->GetUnknown0x28() == 2) {
|
2024-03-19 07:45:29 -04:00
|
|
|
IsleScript::Script script = IsleScript::c_noneIsle;
|
2024-03-16 14:20:44 -04:00
|
|
|
|
|
|
|
switch (raceState->GetState(GameState()->GetActorId())->GetUnknown0x02()) {
|
|
|
|
case 1:
|
2024-03-19 07:45:29 -04:00
|
|
|
script = IsleScript::c_srt003in_RunAnim;
|
2024-03-16 14:20:44 -04:00
|
|
|
break;
|
|
|
|
case 2:
|
2024-03-19 07:45:29 -04:00
|
|
|
script = IsleScript::c_srt002in_RunAnim;
|
2024-03-16 14:20:44 -04:00
|
|
|
break;
|
|
|
|
case 3:
|
2024-03-19 07:45:29 -04:00
|
|
|
script = IsleScript::c_srt001in_RunAnim;
|
2024-03-16 14:20:44 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2024-05-01 07:36:58 -04:00
|
|
|
AnimationManager()->FUN_10060dc0(script, NULL, TRUE, TRUE, NULL, FALSE, FALSE, TRUE, FALSE);
|
2024-03-16 14:20:44 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
|
|
|
FUN_1003ef00(TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 7:
|
|
|
|
m_act1state->m_unk0x018 = 8;
|
|
|
|
|
|
|
|
AnimationManager()->FUN_1005f6d0(FALSE);
|
2024-05-18 14:43:19 -04:00
|
|
|
AnimationManager()->EnableCamAnims(FALSE);
|
2024-03-16 14:20:44 -04:00
|
|
|
|
|
|
|
g_unk0x100f1198 &= ~c_bit7;
|
|
|
|
m_towtrack->FUN_1004dab0();
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
m_act1state->m_unk0x018 = 10;
|
|
|
|
|
|
|
|
AnimationManager()->FUN_1005f6d0(FALSE);
|
2024-05-18 14:43:19 -04:00
|
|
|
AnimationManager()->EnableCamAnims(FALSE);
|
2024-03-16 14:20:44 -04:00
|
|
|
|
|
|
|
g_unk0x100f1198 &= ~c_bit7;
|
|
|
|
m_ambulance->FUN_10036e60();
|
|
|
|
break;
|
|
|
|
case 11:
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
2024-05-04 10:13:05 -04:00
|
|
|
CurrentActor()->SpawnPlayer(
|
|
|
|
LegoGameState::e_unk54,
|
|
|
|
TRUE,
|
|
|
|
IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3
|
|
|
|
);
|
2024-03-16 14:20:44 -04:00
|
|
|
GameState()->m_currentArea = LegoGameState::e_unk66;
|
|
|
|
FUN_1003ef00(TRUE);
|
|
|
|
m_jukebox->StartAction();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
SetAppCursor(0);
|
|
|
|
|
|
|
|
if (m_act1state->m_unk0x018 != 8 &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_elevride) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_polidoor) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_garadoor) &&
|
2024-03-17 13:01:47 -04:00
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_bike) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_dunecar) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_motocycle) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_copter) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_jetski) &&
|
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_skateboard) &&
|
2024-03-16 14:20:44 -04:00
|
|
|
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_jetrace2)) {
|
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
|
|
|
}
|
|
|
|
|
2024-03-19 14:44:42 -04:00
|
|
|
SetROIVisible("stretch", FALSE);
|
|
|
|
SetROIVisible("bird", FALSE);
|
|
|
|
SetROIVisible("rcred", FALSE);
|
|
|
|
SetROIVisible("towtk", FALSE);
|
|
|
|
SetROIVisible("pizpie", FALSE);
|
2024-02-02 12:18:46 -05:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (InputManager()->GetWorld() == this) {
|
|
|
|
InputManager()->ClearWorld();
|
|
|
|
}
|
2024-03-16 14:20:44 -04:00
|
|
|
|
|
|
|
m_act1state->FUN_10034b60();
|
2024-02-02 12:18:46 -05:00
|
|
|
}
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
|
2024-03-18 10:38:02 -04:00
|
|
|
// FUNCTION: LEGO1 0x10032620
|
2024-01-13 15:42:09 -05:00
|
|
|
void Isle::FUN_10032620()
|
|
|
|
{
|
2024-03-18 10:38:02 -04:00
|
|
|
VideoManager()->Get3DManager()->SetFrustrum(90.0, 0.1, 250.0);
|
|
|
|
|
|
|
|
switch (GameState()->m_currentArea) {
|
|
|
|
case LegoGameState::e_unk66: {
|
|
|
|
MxMatrix mat(CurrentActor()->GetROI()->GetLocal2World());
|
2024-03-26 13:51:52 -04:00
|
|
|
LegoPathBoundary* boundary = CurrentActor()->GetBoundary();
|
|
|
|
CurrentActor()->VTable0xec(mat, boundary, TRUE);
|
2024-03-18 10:38:02 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case LegoGameState::e_unk4:
|
|
|
|
case LegoGameState::e_jetraceExterior:
|
|
|
|
case LegoGameState::e_unk17:
|
|
|
|
case LegoGameState::e_carraceExterior:
|
|
|
|
case LegoGameState::e_unk20:
|
|
|
|
case LegoGameState::e_pizzeriaExterior:
|
|
|
|
case LegoGameState::e_garageExterior:
|
|
|
|
case LegoGameState::e_hospitalExterior:
|
|
|
|
case LegoGameState::e_unk31:
|
|
|
|
case LegoGameState::e_policeExterior:
|
2024-05-04 10:13:05 -04:00
|
|
|
CurrentActor()->SpawnPlayer(
|
|
|
|
GameState()->m_currentArea,
|
|
|
|
TRUE,
|
|
|
|
IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3
|
|
|
|
);
|
2024-03-18 10:38:02 -04:00
|
|
|
GameState()->m_currentArea = LegoGameState::e_unk66;
|
|
|
|
break;
|
|
|
|
}
|
2024-01-13 15:42:09 -05:00
|
|
|
}
|
|
|
|
|
2024-03-17 13:01:47 -04:00
|
|
|
// FUNCTION: LEGO1 0x100327a0
|
2023-12-16 11:01:22 -05:00
|
|
|
MxLong Isle::HandleTransitionEnd()
|
|
|
|
{
|
2024-03-17 13:01:47 -04:00
|
|
|
InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_Avo917In_PlayWav, NULL);
|
|
|
|
DeleteObjects(&m_atom, IsleScript::c_Avo900Ps_PlayWav, IsleScript::c_Avo907Ps_PlayWav);
|
|
|
|
|
|
|
|
if (m_destLocation != LegoGameState::e_skateboard) {
|
|
|
|
m_act1state->m_unk0x018 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (m_destLocation) {
|
|
|
|
case LegoGameState::e_infomain:
|
2024-03-19 14:44:42 -04:00
|
|
|
((LegoEntity*) Find(*g_isleScript, IsleScript::c_InfoCenter_Entity))->GetROI()->SetVisibility(TRUE);
|
2024-03-17 13:01:47 -04:00
|
|
|
GameState()->SwitchArea(m_destLocation);
|
|
|
|
m_destLocation = LegoGameState::e_undefined;
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_elevride:
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
2024-03-17 13:01:47 -04:00
|
|
|
VariableTable()->SetVariable("VISIBILITY", "Hide infocen");
|
|
|
|
FUN_10032d30(IsleScript::c_ElevRide_Background_Bitmap, JukeboxScript::c_Elevator_Music, "LCAMZI1,90", FALSE);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_elevride2:
|
|
|
|
FUN_10032d30(IsleScript::c_ElevRide_Background_Bitmap, JukeboxScript::c_Elevator_Music, "LCAMZI2,90", FALSE);
|
|
|
|
|
|
|
|
if (m_destLocation == LegoGameState::e_undefined) {
|
|
|
|
((MxStillPresenter*) Find(m_atom, IsleScript::c_Meter3_Bitmap))->Enable(TRUE);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_elevopen:
|
|
|
|
FUN_10032d30(
|
|
|
|
IsleScript::c_ElevOpen_Background_Bitmap,
|
|
|
|
JukeboxScript::c_InfoCenter_3rd_Floor_Music,
|
|
|
|
"LCAMZIS,90",
|
|
|
|
FALSE
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_seaview:
|
|
|
|
FUN_10032d30(
|
|
|
|
IsleScript::c_SeaView_Background_Bitmap,
|
|
|
|
JukeboxScript::c_InfoCenter_3rd_Floor_Music,
|
|
|
|
"LCAMZIE,90",
|
|
|
|
FALSE
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_observe:
|
|
|
|
FUN_10032d30(
|
|
|
|
IsleScript::c_Observe_Background_Bitmap,
|
|
|
|
JukeboxScript::c_InfoCenter_3rd_Floor_Music,
|
|
|
|
"LCAMZIW,90",
|
|
|
|
FALSE
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_elevdown:
|
|
|
|
FUN_10032d30(
|
|
|
|
IsleScript::c_ElevDown_Background_Bitmap,
|
|
|
|
JukeboxScript::c_InfoCenter_3rd_Floor_Music,
|
|
|
|
"LCAMZIN,90",
|
|
|
|
FALSE
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_garadoor:
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
2024-03-17 13:01:47 -04:00
|
|
|
VariableTable()->SetVariable("VISIBILITY", "Hide Gas");
|
|
|
|
FUN_10032d30(IsleScript::c_GaraDoor_Background_Bitmap, JukeboxScript::c_JBMusic2, "LCAMZG1,90", FALSE);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_unk28:
|
|
|
|
GameState()->SwitchArea(m_destLocation);
|
|
|
|
GameState()->StopArea(LegoGameState::e_previousArea);
|
|
|
|
m_destLocation = LegoGameState::e_undefined;
|
|
|
|
VariableTable()->SetVariable("VISIBILITY", "Show Gas");
|
2024-04-30 04:27:57 -04:00
|
|
|
AnimationManager()->Resume();
|
2024-03-17 13:01:47 -04:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
|
|
|
SetAppCursor(0);
|
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_unk33:
|
|
|
|
GameState()->SwitchArea(m_destLocation);
|
|
|
|
GameState()->StopArea(LegoGameState::e_previousArea);
|
|
|
|
m_destLocation = LegoGameState::e_undefined;
|
|
|
|
VariableTable()->SetVariable("VISIBILITY", "Show Policsta");
|
2024-04-30 04:27:57 -04:00
|
|
|
AnimationManager()->Resume();
|
2024-03-17 13:01:47 -04:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
|
|
|
SetAppCursor(0);
|
|
|
|
SetIsWorldActive(TRUE);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_polidoor:
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
2024-03-17 13:01:47 -04:00
|
|
|
VariableTable()->SetVariable("VISIBILITY", "Hide Policsta");
|
|
|
|
FUN_10032d30(
|
|
|
|
IsleScript::c_PoliDoor_Background_Bitmap,
|
|
|
|
JukeboxScript::c_PoliceStation_Music,
|
|
|
|
"LCAMZP1,90",
|
|
|
|
FALSE
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_bike:
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
2024-03-17 13:01:47 -04:00
|
|
|
FUN_10032d30(IsleScript::c_BikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
|
|
|
|
|
2024-03-17 13:26:41 -04:00
|
|
|
if (!m_act1state->m_unk0x01f) {
|
2024-03-17 13:01:47 -04:00
|
|
|
m_bike->FUN_10076b60();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_dunecar:
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
2024-03-17 13:01:47 -04:00
|
|
|
FUN_10032d30(IsleScript::c_DuneCarFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
|
|
|
|
|
2024-03-17 13:26:41 -04:00
|
|
|
if (!m_act1state->m_unk0x01f) {
|
2024-03-17 13:01:47 -04:00
|
|
|
m_dunebuggy->FUN_10068350();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_motocycle:
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
2024-03-17 13:01:47 -04:00
|
|
|
FUN_10032d30(IsleScript::c_MotoBikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
|
|
|
|
|
2024-03-17 13:26:41 -04:00
|
|
|
if (!m_act1state->m_unk0x01f) {
|
2024-03-17 13:01:47 -04:00
|
|
|
m_motocycle->FUN_10035e10();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_copter:
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
2024-03-17 13:01:47 -04:00
|
|
|
FUN_10032d30(IsleScript::c_HelicopterDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_skateboard:
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
2024-03-17 13:01:47 -04:00
|
|
|
FUN_10032d30(IsleScript::c_SkatePizza_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
|
|
|
|
|
2024-03-17 13:26:41 -04:00
|
|
|
if (!m_act1state->m_unk0x01f) {
|
2024-05-18 15:20:05 -04:00
|
|
|
m_skateboard->ActivateSceneActions();
|
2024-03-17 13:01:47 -04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_ambulance:
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
2024-03-17 13:01:47 -04:00
|
|
|
m_act1state->m_unk0x018 = 10;
|
|
|
|
FUN_10032d30(IsleScript::c_AmbulanceFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
|
|
|
|
|
2024-03-17 13:26:41 -04:00
|
|
|
if (!m_act1state->m_unk0x01f) {
|
2024-03-17 13:01:47 -04:00
|
|
|
m_ambulance->FUN_10037060();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_towtrack:
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
2024-03-17 13:01:47 -04:00
|
|
|
m_act1state->m_unk0x018 = 8;
|
|
|
|
FUN_10032d30(IsleScript::c_TowFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
|
|
|
|
|
2024-03-17 13:26:41 -04:00
|
|
|
if (!m_act1state->m_unk0x01f) {
|
2024-03-17 13:01:47 -04:00
|
|
|
m_towtrack->FUN_1004dad0();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_jetski:
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
2024-03-17 13:01:47 -04:00
|
|
|
FUN_10032d30((IsleScript::Script) m_jetski->GetUnknown0x160(), JukeboxScript::c_MusicTheme1, NULL, TRUE);
|
|
|
|
|
2024-03-17 13:26:41 -04:00
|
|
|
if (!m_act1state->m_unk0x01f) {
|
2024-03-17 13:01:47 -04:00
|
|
|
m_jetski->FUN_1007e990();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
GameState()->SwitchArea(m_destLocation);
|
|
|
|
m_destLocation = LegoGameState::e_undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2024-03-17 13:26:41 -04:00
|
|
|
// FUNCTION: LEGO1 0x10032d30
|
2024-03-17 13:01:47 -04:00
|
|
|
void Isle::FUN_10032d30(
|
|
|
|
IsleScript::Script p_script,
|
|
|
|
JukeboxScript::Script p_music,
|
|
|
|
const char* p_cameraLocation,
|
|
|
|
MxBool p_und
|
|
|
|
)
|
|
|
|
{
|
2024-03-17 13:26:41 -04:00
|
|
|
if (m_act1state->m_unk0x01f) {
|
|
|
|
MxPresenter* presenter = (MxPresenter*) Find(m_atom, p_script);
|
|
|
|
|
|
|
|
if (presenter != NULL && presenter->GetCurrentTickleState() == MxPresenter::e_repeating) {
|
|
|
|
if (p_music != JukeboxScript::c_MusicTheme1) {
|
|
|
|
PlayMusic(p_music);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p_und) {
|
|
|
|
InputManager()->SetCamera(m_cameraController);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
InputManager()->SetCamera(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p_cameraLocation != NULL) {
|
|
|
|
VariableTable()->SetVariable(g_varCAMERALOCATION, p_cameraLocation);
|
|
|
|
}
|
|
|
|
|
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
|
|
|
SetAppCursor(0);
|
|
|
|
m_destLocation = LegoGameState::e_undefined;
|
|
|
|
m_act1state->m_unk0x01f = FALSE;
|
|
|
|
}
|
|
|
|
else {
|
2024-04-22 08:11:38 -04:00
|
|
|
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
|
2024-03-17 13:26:41 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
GameState()->SwitchArea(m_destLocation);
|
|
|
|
GameState()->StopArea(LegoGameState::e_previousArea);
|
2024-04-22 08:11:38 -04:00
|
|
|
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
|
2024-03-17 13:26:41 -04:00
|
|
|
m_act1state->m_unk0x01f = TRUE;
|
|
|
|
}
|
2023-12-16 11:01:22 -05:00
|
|
|
}
|
|
|
|
|
2023-12-15 18:11:34 -05:00
|
|
|
// FUNCTION: LEGO1 0x10032f10
|
2024-01-26 16:00:02 -05:00
|
|
|
void Isle::Add(MxCore* p_object)
|
2023-12-15 18:11:34 -05:00
|
|
|
{
|
2024-01-26 16:00:02 -05:00
|
|
|
LegoWorld::Add(p_object);
|
2023-12-15 18:11:34 -05:00
|
|
|
|
|
|
|
if (p_object->IsA("Pizza")) {
|
|
|
|
m_pizza = (Pizza*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Pizzeria")) {
|
|
|
|
m_pizzeria = (Pizzeria*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("TowTrack")) {
|
|
|
|
m_towtrack = (TowTrack*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Ambulance")) {
|
|
|
|
m_ambulance = (Ambulance*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("JukeBoxEntity")) {
|
|
|
|
m_jukebox = (JukeBoxEntity*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Helicopter")) {
|
|
|
|
m_helicopter = (Helicopter*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Bike")) {
|
|
|
|
m_bike = (Bike*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("DuneBuggy")) {
|
|
|
|
m_dunebuggy = (DuneBuggy*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Motorcycle")) {
|
2024-01-14 17:00:03 -05:00
|
|
|
m_motocycle = (Motocycle*) p_object;
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
else if (p_object->IsA("SkateBoard")) {
|
|
|
|
m_skateboard = (SkateBoard*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("Jetski")) {
|
|
|
|
m_jetski = (Jetski*) p_object;
|
|
|
|
}
|
|
|
|
else if (p_object->IsA("RaceCar")) {
|
|
|
|
m_racecar = (RaceCar*) p_object;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10033050
|
2023-12-15 17:29:32 -05:00
|
|
|
void Isle::VTable0x6c(IslePathActor* p_actor)
|
2023-12-15 18:11:34 -05:00
|
|
|
{
|
2024-01-26 16:00:02 -05:00
|
|
|
LegoWorld::Remove(p_actor);
|
2023-12-15 18:11:34 -05:00
|
|
|
|
2023-12-15 17:29:32 -05:00
|
|
|
if (p_actor->IsA("Helicopter")) {
|
2023-12-15 18:11:34 -05:00
|
|
|
m_helicopter = NULL;
|
|
|
|
}
|
2023-12-15 17:29:32 -05:00
|
|
|
else if (p_actor->IsA("DuneBuggy")) {
|
2023-12-15 18:11:34 -05:00
|
|
|
m_dunebuggy = NULL;
|
|
|
|
}
|
2023-12-15 17:29:32 -05:00
|
|
|
else if (p_actor->IsA("Jetski")) {
|
|
|
|
m_jetski = NULL;
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
2023-12-15 17:29:32 -05:00
|
|
|
else if (p_actor->IsA("RaceCar")) {
|
|
|
|
m_racecar = NULL;
|
2023-12-15 18:11:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-16 14:20:44 -04:00
|
|
|
// STUB: LEGO1 0x100330e0
|
|
|
|
void Isle::FUN_100330e0()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2023-12-15 18:11:34 -05:00
|
|
|
// STUB: LEGO1 0x10033180
|
|
|
|
MxBool Isle::VTable0x64()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return FALSE;
|
|
|
|
}
|
2024-03-29 14:09:53 -04:00
|
|
|
|
|
|
|
// STUB: LEGO1 0x10033350
|
|
|
|
void Isle::FUN_10033350()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|