Isle
Loading...
Searching...
No Matches
pizzeria.cpp
Go to the documentation of this file.
1#include "pizzeria.h"
2
3#include "isle_actions.h"
4#include "islepathactor.h"
6#include "legogamestate.h"
7#include "legopathactor.h"
8#include "legoutils.h"
9#include "legoworld.h"
10#include "misc.h"
11#include "pizza.h"
12#include "scripts.h"
13
16
17// GLOBAL: LEGO1 0x100f0ce8
18IsleScript::Script PizzeriaState::g_pepperActions[] =
20
21// GLOBAL: LEGO1 0x100f0cf8
24
25// GLOBAL: LEGO1 0x100f0d08
28
29// GLOBAL: LEGO1 0x100f0d18
32
33// GLOBAL: LEGO1 0x100f0d28
36
37// FUNCTION: LEGO1 0x100179c0
39{
40 MxResult result = IsleActor::Create(p_dsAction);
41
42 if (result == SUCCESS) {
44 }
45
46 return result;
47}
48
49// FUNCTION: LEGO1 0x100179f0
50// FUNCTION: BETA10 0x100efbfc
52{
53 LegoGameState* gameState = GameState();
54 PizzeriaState* pizzeriaState = (PizzeriaState*) gameState->GetState("PizzeriaState");
55 if (pizzeriaState == NULL) {
56 pizzeriaState = (PizzeriaState*) gameState->CreateState("PizzeriaState");
57 }
58 m_pizzeriaState = pizzeriaState;
59
60 gameState = GameState();
61 PizzaMissionState* pizzaMissionState = (PizzaMissionState*) gameState->GetState("PizzaMissionState");
62 if (pizzaMissionState == NULL) {
63 pizzaMissionState = (PizzaMissionState*) gameState->CreateState("PizzaMissionState");
64 }
65 m_pizzaMissionState = pizzaMissionState;
66}
67
68// FUNCTION: LEGO1 0x10017a50
69// FUNCTION: BETA10 0x100efc91
71{
72 if (FUN_1003ef60() && m_pizzaMissionState->m_unk0x0c == 0) {
73 if (UserActor()->GetActorId() != GameState()->GetActorId()) {
74 if (!UserActor()->IsA("SkateBoard")) {
75 ((IslePathActor*) UserActor())->Exit();
76 }
77 }
78
80
82 pizza->FUN_10038220((IsleScript::Script) m_pizzeriaState->NextAction());
83 }
84
85 return 1;
86}
87
88// FUNCTION: LEGO1 0x10017af0
89// FUNCTION: BETA10 0x100efd14
91{
97 memset(m_unk0x44, -1, sizeof(m_unk0x44));
98}
99
100// FUNCTION: LEGO1 0x10017d50
102{
103 return m_unk0x44[GameState()->GetActorId() - 1];
104}
105
106// FUNCTION: LEGO1 0x10017d70
107// FUNCTION: BETA10 0x100effc0
109{
110 MxU8 actorId = GameState()->GetActorId();
111
112 if (m_unk0x44[actorId - 1] < 2) {
113 m_unk0x44[actorId - 1]++;
114 }
115
116 return m_unk0x08[actorId - 1].Next();
117}
118
119// FUNCTION: LEGO1 0x10017da0
120// FUNCTION: BETA10 0x100efe33
122{
123 MxResult res = LegoState::Serialize(p_storage);
124
125 if (p_storage->IsReadMode()) {
126 for (MxS16 i = 0; i < 5; i++) {
127 p_storage->ReadS16(m_unk0x08[i].m_nextIndex);
128 }
129 }
130 else {
131 for (MxS16 i = 0; i < 5; i++) {
132 p_storage->WriteS16(m_unk0x08[i].m_nextIndex);
133 }
134 }
135
136 return res;
137}
MxResult Create(MxDSAction &p_dsAction) override
[AI] Initializes this IsleActor with a given action.
Definition: isleactor.cpp:12
Derived path actor type for handling player transitions and activities on LEGO Island.
Definition: islepathactor.h:23
virtual MxU8 GetActorId()
[AI] Gets this actor's numeric ID, corresponding to a known enumeration/actor.
Definition: legoactor.h:77
void FUN_10061010(MxBool p_und)
[AI] Cancels all camera/transition animations and resets camera after completion.
Comprehensive persistent game state manager: handles save/load, player selection, area switching,...
Definition: legogamestate.h:78
LegoState * CreateState(const char *p_stateName)
Creates an instance of given state, registers it, and returns pointer.
MxU8 GetActorId()
Returns the current selected actor ID. [AI].
LegoState * GetState(const char *p_stateName)
Find an existing state (LegoState-derived) object by its registered script/class name.
virtual MxResult Serialize(LegoStorage *p_storage)
[AI] Serialize state to a storage (for save/load).
Definition: legostate.h:141
Abstract base class providing an interface for file-like storage with binary and text read/write oper...
Definition: legostorage.h:16
LegoStorage * WriteS16(LegoS16 p_data)
Writes a 16-bit signed value to storage.
Definition: legostorage.h:110
LegoStorage * ReadS16(LegoS16 &p_data)
Reads a 16-bit signed value from storage.
Definition: legostorage.h:217
virtual LegoBool IsReadMode()
Returns TRUE if object was opened in read mode.
Definition: legostorage.h:78
MxCore * Find(const char *p_class, const char *p_name)
Finds an object of a given class and name in the world.
Definition: legoworld.cpp:573
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
Pizza mission state for the pizza delivery minigame and related characters.
Definition: pizza.h:21
undefined4 m_unk0x0c
Used for internal state machine; controls mission flow/progress (e.g., 0=idle, 1=proposed,...
Definition: pizza.h:236
Interactive pizza entity actor; manages the in-game pizza delivery sequence and reacts to mission tri...
Definition: pizza.h:263
void FUN_10038220(IsleScript::Script p_objectId)
Starts mission flow for Pizza with the given action script object.
Definition: pizza.cpp:180
[AI] Stores all state information for the pizzeria (Pizza Shop) minigame.
Definition: pizzeria.h:21
static IsleScript::Script g_mamaActions[]
[AI] Static list of script IDs for Mama's actions/animations in the pizzeria minigame.
Definition: pizzeria.h:93
MxS32 m_unk0x44[5]
[AI] Per-actor state counters.
Definition: pizzeria.h:84
static IsleScript::Script g_lauraActions[]
[AI] Static list of script IDs for Laura's actions/animations in the pizzeria minigame.
Definition: pizzeria.h:105
MxU32 NextAction()
[AI] Advance and fetch the next action (animation script) for the player's actor in the pizzeria.
Definition: pizzeria.cpp:108
static IsleScript::Script g_papaActions[]
[AI] Static list of script IDs for Papa's actions/animations in the pizzeria minigame.
Definition: pizzeria.h:97
Playlist m_unk0x08[5]
[AI] Playlists (one for each actor in the pizzeria: Pepper, Mama, Papa, Nick, Laura) holding the list...
Definition: pizzeria.h:78
PizzeriaState()
[AI] Constructor that initializes the playlists for each pizzeria actor and resets progress state.
Definition: pizzeria.cpp:90
MxResult Serialize(LegoStorage *p_storage) override
[AI] Serializes Playlist progress/state for all actors to/from the provided storage.
Definition: pizzeria.cpp:121
static IsleScript::Script g_nickActions[]
[AI] Static list of script IDs for Nick's actions/animations in the pizzeria minigame.
Definition: pizzeria.h:101
static IsleScript::Script g_pepperActions[]
[AI] Static list of script IDs for Pepper's actions/animations in the pizzeria minigame.
Definition: pizzeria.h:89
MxS16 FUN_10017d50()
[AI] Returns the per-actor progress state index for the actor corresponding to the current player's a...
Definition: pizzeria.cpp:101
[AI] Actor representing the pizzeria (Pizza Shop) as an interactive entity in the LEGO Island world.
Definition: pizzeria.h:116
MxLong HandleClick() override
[AI] Handles click/interact actions on the Pizzeria actor, triggering minigame logic.
Definition: pizzeria.cpp:70
MxBool IsA(const char *p_name) const override
[AI] Checks if this object is a Pizzeria or a base type.
Definition: pizzeria.h:138
void CreateState()
[AI] Searches the game state for existing state objects for "PizzeriaState" and "PizzaMissionState",...
Definition: pizzeria.cpp:51
MxResult Create(MxDSAction &p_dsAction) override
[AI] Handles the initialization of the Pizzeria actor in response to a data source action (SI script ...
Definition: pizzeria.cpp:38
#define FALSE
Definition: d3drmdef.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define sizeOfArray(arr)
Definition: decomp.h:23
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
MxBool FUN_1003ef60()
[AI] Determines if the current actor can exit their area, based on state/zone/vehicle.
Definition: legoutils.cpp:572
MxAtomId * g_isleScript
[AI] Node used in hierarchical scene graphs and animation trees. [AI]
Definition: scripts.cpp:32
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
Definition: misc.cpp:61
LegoAnimationManager * AnimationManager()
[AI] Accessor for the animation manager, which controls Lego character/world animation state....
Definition: misc.cpp:69
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
Definition: misc.cpp:93
LegoPathActor * UserActor()
[AI] Accessor for the user (player-controllable) LegoPathActor. [AI]
Definition: misc.cpp:85
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
signed short MxS16
[AI]
Definition: mxtypes.h:26
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
@ c_ppz055ma_RunAnim
Definition: isle_actions.h:752
@ c_ppz114pa_RunAnim
Definition: isle_actions.h:781
@ c_ppz035pa_RunAnim
Definition: isle_actions.h:747
@ c_ppz084pa_RunAnim
Definition: isle_actions.h:766
@ c_ppz001pe_RunAnim
Definition: isle_actions.h:734
@ c_ppz107ma_RunAnim
Definition: isle_actions.h:780
@ c_ppz082pa_RunAnim
Definition: isle_actions.h:765
@ c_ppz031ma_RunAnim
Definition: isle_actions.h:746
@ c_ppz054ma_RunAnim
Definition: isle_actions.h:751
@ c_ppz006pa_RunAnim
Definition: isle_actions.h:735
@ c_ppz007pa_RunAnim
Definition: isle_actions.h:736
@ c_ppz036pa_RunAnim
Definition: isle_actions.h:748
@ c_ppz075pa_RunAnim
Definition: isle_actions.h:764
@ c_ppz056ma_RunAnim
Definition: isle_actions.h:753
[AI] Contains global script AtomId pointers and utility functions for managing script AtomIds in LEGO...
[AI] Playlist structure representing an indexed list of object IDs with next-item selection strategie...
Definition: legostate.h:36
MxU32 Next()
[AI] Retrieves the object ID at the current position, advances next index according to playlist mode.
Definition: legostate.cpp:10