Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement/match Pizza::Tickle #1127

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion LEGO1/lego/legoomni/include/pizza.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class PizzaMissionState : public LegoState {
}
}

// FUNCTION: BETA10 0x100ef7b0
IsleScript::Script GetUnknownFinishAction() { return m_actions[m_numActions + 2]; }

// FUNCTION: BETA10 0x100ef7e0
MxLong GetTimeoutTime() { return m_finishTimes[3]; }

MxResult WriteToFile(LegoFile* p_file)
{
Write(p_file, m_unk0x06);
Expand Down Expand Up @@ -205,7 +211,7 @@ class Pizza : public IsleActor {
Act1State* m_act1state; // 0x88
IsleScript::Script m_unk0x8c; // 0x8c
MxLong m_unk0x90; // 0x90
undefined4 m_unk0x94; // 0x94
MxLong m_unk0x94; // 0x94
MxBool m_unk0x98; // 0x98
};

Expand Down
61 changes: 59 additions & 2 deletions LEGO1/lego/legoomni/src/actors/pizza.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,67 @@ MxLong Pizza::HandlePathStruct(LegoPathStructNotificationParam& p_param)
return 0;
}

// STUB: LEGO1 0x100388a0
// FUNCTION: LEGO1 0x100388a0
// FUNCTION: BETA10 0x100ee2d9
MxResult Pizza::Tickle()
{
// TODO
MxLong time = Timer()->GetTime();

if (m_unk0x90 != INT_MIN && m_unk0x94 + m_unk0x90 <= time) {
m_unk0x90 = INT_MIN;
m_skateBoard->EnableScenePresentation(FALSE);
m_skateBoard->SetUnknown0x160(FALSE);
TickleManager()->UnregisterClient(this);
}

if (m_mission != NULL && m_mission->m_startTime != INT_MIN) {
if (m_state->m_unk0x0c == 4) {
if (time > m_mission->m_startTime + m_mission->GetTimeoutTime()) {
StopActions();
m_mission->UpdateScore(LegoState::e_grey);
FUN_100382b0();
BackgroundAudioManager()->LowerVolume();
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Avo917In_PlayWav, NULL);
}
else if (time >= m_mission->m_startTime + 35000 && m_unk0x8c == IsleScript::c_noneIsle) {
switch (GameState()->GetActorId()) {
case LegoActor::c_pepper:
m_unk0x8c = IsleScript::c_Avo914In_PlayWav;
break;
case LegoActor::c_mama:
m_unk0x8c = IsleScript::c_Avo910In_PlayWav;
break;
case LegoActor::c_papa:
m_unk0x8c = IsleScript::c_Avo912In_PlayWav;
break;
case LegoActor::c_nick:
m_unk0x8c = IsleScript::c_Avo911In_PlayWav;
break;
case LegoActor::c_laura:
m_unk0x8c = IsleScript::c_Avo913In_PlayWav;
break;
}

BackgroundAudioManager()->LowerVolume();

if (m_unk0x8c != IsleScript::c_noneIsle) {
InvokeAction(Extra::e_start, *g_isleScript, m_unk0x8c, NULL);
}
}
}
else if (m_state->m_unk0x0c == 2) {
if (Timer()->GetTime() > m_mission->m_startTime + 5000) {
m_skateBoard->SetUnknown0x160(FALSE);
m_skateBoard->EnableScenePresentation(FALSE);
TickleManager()->UnregisterClient(this);
m_mission->UpdateScore(LegoState::e_grey);
m_state->m_unk0x0c = 9;
AnimationManager()->FUN_1005f6d0(TRUE);
PlayAction(m_mission->GetUnknownFinishAction(), TRUE);
}
}
}

return SUCCESS;
}

Expand Down
Loading