2024-01-20 18:04:46 -05:00
|
|
|
#include "legoact2.h"
|
|
|
|
|
2024-11-11 13:30:34 -05:00
|
|
|
#include "act2main_actions.h"
|
|
|
|
#include "islepathactor.h"
|
2024-06-08 19:17:33 -04:00
|
|
|
#include "legoanimationmanager.h"
|
2024-11-11 12:48:45 -05:00
|
|
|
#include "legogamestate.h"
|
2024-06-08 19:17:33 -04:00
|
|
|
#include "legoinputmanager.h"
|
|
|
|
#include "misc.h"
|
2024-11-11 13:30:34 -05:00
|
|
|
#include "mxbackgroundaudiomanager.h"
|
2024-06-08 19:17:33 -04:00
|
|
|
#include "mxmisc.h"
|
|
|
|
#include "mxnotificationmanager.h"
|
|
|
|
#include "mxticklemanager.h"
|
|
|
|
|
2024-03-22 21:30:58 -04:00
|
|
|
DECOMP_SIZE_ASSERT(LegoAct2, 0x1154)
|
2024-06-03 12:53:25 -04:00
|
|
|
DECOMP_SIZE_ASSERT(LegoAct2State, 0x10)
|
2024-03-22 21:30:58 -04:00
|
|
|
|
2024-06-12 20:02:47 -04:00
|
|
|
// STUB: LEGO1 0x1004fce0
|
2024-09-14 19:14:11 -04:00
|
|
|
// STUB: BETA10 0x1003a5a0
|
2024-06-12 20:02:47 -04:00
|
|
|
LegoAct2::LegoAct2()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2024-02-07 06:13:20 -05:00
|
|
|
// FUNCTION: LEGO1 0x1004fe10
|
2024-01-20 18:04:46 -05:00
|
|
|
MxBool LegoAct2::VTable0x5c()
|
|
|
|
{
|
2024-02-07 06:13:20 -05:00
|
|
|
return TRUE;
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|
|
|
|
|
2024-06-08 19:17:33 -04:00
|
|
|
// FUNCTION: LEGO1 0x1004fe40
|
|
|
|
// FUNCTION: BETA10 0x1003a6f0
|
|
|
|
LegoAct2::~LegoAct2()
|
|
|
|
{
|
|
|
|
if (m_unk0x10c2) {
|
|
|
|
TickleManager()->UnregisterClient(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
FUN_10051900();
|
|
|
|
InputManager()->UnRegister(this);
|
2024-06-12 09:13:52 -04:00
|
|
|
if (UserActor()) {
|
|
|
|
Remove(UserActor());
|
2024-06-08 19:17:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
NotificationManager()->Unregister(this);
|
|
|
|
}
|
|
|
|
|
2024-11-11 12:48:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x1004ff20
|
|
|
|
// FUNCTION: BETA10 0x1003a7ff
|
2024-01-20 18:04:46 -05:00
|
|
|
MxResult LegoAct2::Create(MxDSAction& p_dsAction)
|
|
|
|
{
|
2024-11-11 12:48:45 -05:00
|
|
|
GameState()->FindLoadedAct();
|
|
|
|
|
|
|
|
MxResult result = LegoWorld::Create(p_dsAction);
|
|
|
|
if (result == SUCCESS) {
|
|
|
|
AnimationManager()->EnableCamAnims(FALSE);
|
|
|
|
|
|
|
|
LegoGameState* gameState = GameState();
|
|
|
|
LegoAct2State* state = (LegoAct2State*) gameState->GetState("LegoAct2State");
|
|
|
|
|
|
|
|
if (state == NULL) {
|
|
|
|
state = (LegoAct2State*) gameState->CreateState("LegoAct2State");
|
|
|
|
}
|
|
|
|
|
|
|
|
m_gameState = state;
|
|
|
|
m_gameState->m_unk0x08 = 0;
|
|
|
|
|
|
|
|
switch (GameState()->GetLoadedAct()) {
|
|
|
|
case LegoGameState::e_act2:
|
|
|
|
GameState()->StopArea(LegoGameState::e_infomain);
|
|
|
|
GameState()->StopArea(LegoGameState::e_act2main);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_act3:
|
|
|
|
GameState()->StopArea(LegoGameState::e_infomain);
|
|
|
|
GameState()->StopArea(LegoGameState::e_act3script);
|
|
|
|
break;
|
|
|
|
case LegoGameState::e_act1:
|
|
|
|
case LegoGameState::e_actNotFound:
|
|
|
|
GameState()->StopArea(LegoGameState::e_undefined);
|
|
|
|
if (GameState()->GetPreviousArea() == LegoGameState::e_infomain) {
|
|
|
|
GameState()->StopArea(LegoGameState::e_isle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GameState()->m_currentArea = LegoGameState::e_act2main;
|
|
|
|
GameState()->SetCurrentAct(LegoGameState::e_act2);
|
|
|
|
InputManager()->Register(this);
|
|
|
|
GameState()->SetDirty(TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10050040
|
|
|
|
MxResult LegoAct2::Tickle()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10050380
|
|
|
|
MxLong LegoAct2::Notify(MxParam& p_param)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10050a80
|
2024-01-27 15:18:35 -05:00
|
|
|
void LegoAct2::ReadyWorld()
|
2024-01-20 18:04:46 -05:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10050cf0
|
2024-02-02 12:18:46 -05:00
|
|
|
void LegoAct2::Enable(MxBool p_enable)
|
2024-01-20 18:04:46 -05:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2024-06-08 19:17:33 -04:00
|
|
|
// FUNCTION: LEGO1 0x10051900
|
|
|
|
// FUNCTION: BETA10 0x1003bed1
|
|
|
|
void LegoAct2::FUN_10051900()
|
|
|
|
{
|
|
|
|
if (AnimationManager()) {
|
|
|
|
AnimationManager()->Suspend();
|
|
|
|
AnimationManager()->Resume();
|
|
|
|
AnimationManager()->FUN_10060540(FALSE);
|
|
|
|
AnimationManager()->FUN_100604d0(FALSE);
|
|
|
|
AnimationManager()->EnableCamAnims(FALSE);
|
|
|
|
AnimationManager()->FUN_1005f6d0(FALSE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-11-11 13:30:34 -05:00
|
|
|
// FUNCTION: LEGO1 0x100519c0
|
2024-01-20 18:04:46 -05:00
|
|
|
void LegoAct2::VTable0x60()
|
|
|
|
{
|
2024-11-11 13:30:34 -05:00
|
|
|
// empty
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|
|
|
|
|
2024-11-11 13:30:34 -05:00
|
|
|
// FUNCTION: LEGO1 0x100519d0
|
2024-05-24 20:41:57 -04:00
|
|
|
MxBool LegoAct2::Escape()
|
2024-01-20 18:04:46 -05:00
|
|
|
{
|
2024-11-11 13:30:34 -05:00
|
|
|
BackgroundAudioManager()->Stop();
|
|
|
|
AnimationManager()->FUN_10061010(FALSE);
|
|
|
|
DeleteObjects(&m_atomId, Act2mainScript::c_snsx50bu_RunAnim, 999);
|
|
|
|
|
|
|
|
if (UserActor() != NULL) {
|
|
|
|
if (UserActor()->GetActorId() != GameState()->GetActorId()) {
|
|
|
|
((IslePathActor*) UserActor())->Exit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_gameState != NULL) {
|
|
|
|
m_gameState->m_unk0x0c = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_unk0x1150 = 2;
|
|
|
|
return TRUE;
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|