Isle
Loading...
Searching...
No Matches
pizza.h
Go to the documentation of this file.
1#ifndef PIZZA_H
2#define PIZZA_H
3
4#include "actionsfwd.h"
5#include "decomp.h"
6#include "isleactor.h"
7#include "legostate.h"
8
9class Act1State;
10class PizzeriaState;
11class SkateBoard;
12
13// VTABLE: LEGO1 0x100d7408
14// VTABLE: BETA10 0x101bf750
15// SIZE 0xb4
22public:
27 // SIZE 0x20
28 struct Mission {
32 // FUNCTION: LEGO1 0x10039220
33 // FUNCTION: BETA10 0x100ef880
35
44 // FUNCTION: BETA10 0x100ef8a0
46 MxU8 p_actorId,
47 undefined2 p_unk0x04,
48 MxLong* p_finishTimes,
49 IsleScript::Script* p_actions,
50 MxS16 p_numActions
51 )
52 {
53 m_numActions = p_numActions;
54 m_actorId = p_actorId;
55 m_unk0x04 = p_unk0x04;
56 m_unk0x06 = 1;
57 m_unk0x08 = 1;
58 m_finishTimes = p_finishTimes;
59 m_startTime = INT_MIN;
60 m_unk0x14 = 1;
63 m_actions = p_actions;
64 }
65
71 // FUNCTION: LEGO1 0x10039230
72 Mission& operator=(const Mission& p_mission)
73 {
74 m_actorId = p_mission.m_actorId;
75 m_unk0x04 = p_mission.m_unk0x04;
76 m_unk0x06 = p_mission.m_unk0x06;
77 m_unk0x08 = p_mission.m_unk0x08;
78 m_finishTimes = p_mission.m_finishTimes;
79 m_startTime = p_mission.m_startTime;
80 m_unk0x14 = p_mission.m_unk0x14;
81 m_score = p_mission.m_score;
82 m_hiScore = p_mission.m_hiScore;
83 m_actions = p_mission.m_actions;
84 m_numActions = p_mission.m_numActions;
85 return *this;
86 }
87
92 // FUNCTION: BETA10 0x100ef610
94
99 // FUNCTION: BETA10 0x100ef640
101
106 // FUNCTION: BETA10 0x100ef670
108
112 // FUNCTION: BETA10 0x100ef6a0
114
118 // FUNCTION: BETA10 0x100ef6d0
120
125 // FUNCTION: BETA10 0x100ef700
127 {
128 m_score = p_score;
129 if (m_hiScore < p_score) {
130 m_hiScore = p_score;
131 }
132 }
133
138 // FUNCTION: BETA10 0x100ef780
140
145 // FUNCTION: BETA10 0x100ef7b0
147
152 // FUNCTION: BETA10 0x100ef7e0
154
166 };
167
172
176 // FUNCTION: LEGO1 0x10039290
177 // FUNCTION: BETA10 0x100efa20
178 const char* ClassName() const override // vtable+0x0c
179 {
180 // STRING: LEGO1 0x100f00d4
181 return "PizzaMissionState";
182 }
183
189 // FUNCTION: LEGO1 0x100392a0
190 MxBool IsA(const char* p_name) const override // vtable+0x10
191 {
192 return !strcmp(p_name, PizzaMissionState::ClassName()) || LegoState::IsA(p_name);
193 }
194
199 MxResult Serialize(LegoStorage* p_storage) override; // vtable+0x1c
200
205 // FUNCTION: BETA10 0x100ef470
206 void SetUnknown0xb0(MxU32 p_unk0xb0) { m_unk0xb0 = p_unk0xb0; }
207
212 // FUNCTION: BETA10 0x100ef850
214
219 // FUNCTION: BETA10 0x10088850
220 MxS16 GetHighScore(MxU8 p_actorId) { return GetMission(p_actorId)->m_hiScore; }
221
227 Mission* GetMission(MxU8 p_actorId);
228
234
239
246
253};
254
255// VTABLE: LEGO1 0x100d7380
256// VTABLE: BETA10 0x101bf6b0
257// SIZE 0x9c
263class Pizza : public IsleActor {
264public:
268 Pizza();
269
273 ~Pizza() override;
274
278 MxResult Tickle() override; // vtable+0x08
279
283 // FUNCTION: LEGO1 0x10037f90
284 // FUNCTION: BETA10 0x100ef300
285 const char* ClassName() const override // vtable+0x0c
286 {
287 // STRING: LEGO1 0x100f038c
288 return "Pizza";
289 }
290
296 // FUNCTION: LEGO1 0x10037fa0
297 MxBool IsA(const char* p_name) const override // vtable+0x10
298 {
299 return !strcmp(p_name, Pizza::ClassName()) || IsleActor::IsA(p_name);
300 }
301
306 MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
307
312 MxLong HandleClick() override; // vtable+0x68
313
319 MxLong HandleEndAction(MxEndActionNotificationParam& p_param) override; // vtable+0x74
320
326 MxLong HandlePathStruct(LegoPathStructNotificationParam& p_param) override; // vtable+0x80
327
332 void CreateState();
333
338 void FUN_10038220(IsleScript::Script p_objectId);
339
344 void FUN_100382b0();
345
350 void StopActions();
351
357 void PlayAction(MxU32 p_objectId, MxBool p_param7);
358
363 void SetSkateboard(SkateBoard* p_skateBoard) { m_skateBoard = p_skateBoard; }
364
365private:
366 PizzaMissionState* m_state;
367 PizzaMissionState::Mission* m_mission;
368 SkateBoard* m_skateBoard;
369 Act1State* m_act1state;
370 IsleScript::Script m_unk0x8c;
371 MxLong m_unk0x90;
372 MxLong m_unk0x94;
373 MxBool m_unk0x98;
374};
375
376#endif // PIZZA_H
[AI] Holds state and transient gameplay data for the first act on Lego Island.
Definition: isle.h:29
[AI] Represents an actor instance specifically used within LEGO Island, extending LegoActor with noti...
Definition: isleactor.h:15
MxBool IsA(const char *p_name) const override
[AI] Checks if this instance is of the specified class, or inherits from it.
Definition: isleactor.h:68
[AI] Specialized notification parameter used for path structure related events in LEGO Island.
[AI] Base class for game state blocks which encapsulate serializable and/or resettable aspects of the...
Definition: legostate.h:17
MxBool IsA(const char *p_name) const override
[AI] Tests if this object is of a given class name, directly or through inheritance.
Definition: legostate.h:169
ScoreColor
[AI] Score coloring values for in-game display feedback or logic.
Definition: legostate.h:22
@ e_grey
[AI] Default/neutral color (0) [AI]
Definition: legostate.h:23
Abstract base class providing an interface for file-like storage with binary and text read/write oper...
Definition: legostorage.h:16
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
[AI] Notification parameter marking the end of an action, specialization of MxActionNotificationParam...
Pizza mission state for the pizza delivery minigame and related characters.
Definition: pizza.h:21
static MxLong g_nickFinishTimes[]
Definition: pizza.h:251
PizzeriaState * m_pizzeriaState
Pointer to current pizzeria state for delegating cross-mission logic. [AI].
Definition: pizza.h:235
static MxLong g_mamaFinishTimes[]
Definition: pizza.h:249
MxS16 FUN_10039540()
Invokes logic in the PizzeriaState required for mission state transitions.
Definition: pizza.cpp:648
MxU32 m_unk0xb0
Holds currently "pending" action/object for mission transitions. [AI].
Definition: pizza.h:238
MxU32 GetUnknown0xb0()
Gets the m_unk0xb0 member, which holds the object ID associated with current/next mission flow.
Definition: pizza.h:213
MxS16 GetHighScore(MxU8 p_actorId)
Retrieves the historical best (high) score for a given actor's pizza mission.
Definition: pizza.h:220
static IsleScript::Script g_mamaActions[]
Definition: pizza.h:242
static MxLong g_pepperFinishTimes[]
Finish time thresholds (red/blue/yellow/timeout) for all pizza missions (per-actor) [AI].
Definition: pizza.h:248
static MxLong g_lauraFinishTimes[]
Definition: pizza.h:252
static IsleScript::Script g_lauraActions[]
Definition: pizza.h:245
PizzaMissionState()
Constructs a new PizzaMissionState and initializes missions for all possible actors.
Definition: pizza.cpp:595
MxBool IsA(const char *p_name) const override
Checks whether the given class name is PizzaMissionState or any base.
Definition: pizza.h:190
Mission * GetMission(MxU8 p_actorId)
Finds the Mission struct belonging to a given actor/character.
Definition: pizza.cpp:635
static MxLong g_papaFinishTimes[]
Definition: pizza.h:250
void SetUnknown0xb0(MxU32 p_unk0xb0)
Sets the m_unk0xb0 member, which holds the current object ID of the pending mission action.
Definition: pizza.h:206
undefined4 m_unk0x0c
Used for internal state machine; controls mission flow/progress (e.g., 0=idle, 1=proposed,...
Definition: pizza.h:236
Mission m_missions[5]
Array with per-actor mission progress. [AI].
Definition: pizza.h:237
static IsleScript::Script g_papaActions[]
Definition: pizza.h:243
static IsleScript::Script g_nickActions[]
Definition: pizza.h:244
MxResult Serialize(LegoStorage *p_storage) override
Serializes custom mission fields (score, progress) for saving/loading game state.
Definition: pizza.cpp:609
const char * ClassName() const override
Returns the name of this state class (PizzaMissionState).
Definition: pizza.h:178
static IsleScript::Script g_pepperActions[]
Action scripts for each actor's pizza mission (indexed in Mission::m_actions) [AI].
Definition: pizza.h:241
Interactive pizza entity actor; manages the in-game pizza delivery sequence and reacts to mission tri...
Definition: pizza.h:263
void SetSkateboard(SkateBoard *p_skateBoard)
Sets the SkateBoard actor pointer used for interaction and scene presentation.
Definition: pizza.h:363
Pizza()
Constructs a new Pizza actor, zeroing mission and UI/logic references.
Definition: pizza.cpp:133
MxBool IsA(const char *p_name) const override
Checks if the given class name is this or a base.
Definition: pizza.h:297
MxLong HandleEndAction(MxEndActionNotificationParam &p_param) override
Handles the end of an action/animation sequence, advancing mission state machine if action matches a ...
Definition: pizza.cpp:445
MxResult Create(MxDSAction &p_dsAction) override
Initializes Pizza and links in-game state and SkateBoard reference after DSAction evaluation.
Definition: pizza.cpp:151
const char * ClassName() const override
Returns the class name string "Pizza".
Definition: pizza.h:285
MxResult Tickle() override
Called every tick when Pizza is active; handles mission timers, timeouts, and auto-advances mission s...
Definition: pizza.cpp:375
void StopActions()
Stops all currently running pizza mission actions and resets to an idle state.
Definition: pizza.cpp:223
~Pizza() override
Destroys the Pizza actor and unregisters it as a tickle client.
Definition: pizza.cpp:145
void PlayAction(MxU32 p_objectId, MxBool p_param7)
Plays an animation action for the pizza mission, updating active object ID and handling script concur...
Definition: pizza.cpp:581
MxLong HandlePathStruct(LegoPathStructNotificationParam &p_param) override
Handles notification from a path struct event, e.g., actors walking, object triggers,...
Definition: pizza.cpp:279
void FUN_10038220(IsleScript::Script p_objectId)
Starts mission flow for Pizza with the given action script object.
Definition: pizza.cpp:180
MxLong HandleClick() override
Handles mouse or user interaction with Pizza: advances pizza mission state and starts corresponding a...
Definition: pizza.cpp:238
void FUN_100382b0()
Cancels or resets the Pizza mission, stopping music, resetting camera, and animation state.
Definition: pizza.cpp:196
void CreateState()
Initializes or restores references to PizzaMissionState and Act1State in GameState.
Definition: pizza.cpp:165
[AI] Stores all state information for the pizzeria (Pizza Shop) minigame.
Definition: pizzeria.h:21
[AI] Represents the skateboard vehicle actor used in the minigame and cutscenes.
Definition: skateboard.h:14
#define override
Definition: compat.h:21
unsigned short undefined2
Definition: decomp.h:27
unsigned int undefined4
Definition: decomp.h:28
unsigned char undefined
Definition: decomp.h:26
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
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
Holds all data for a single pizza mission for a specific actor.
Definition: pizza.h:28
MxS16 m_numActions
Number of standard actions in script (before special finish actions) [AI].
Definition: pizza.h:155
IsleScript::Script GetBlueFinishAction()
Gets the script for the "blue" (medium time) mission finish.
Definition: pizza.h:100
undefined m_unk0x08
Unknown, always set to 1 at construction. [AI].
Definition: pizza.h:159
Mission & operator=(const Mission &p_mission)
Assignment operator for copying all mission data.
Definition: pizza.h:72
IsleScript::Script GetUnknownFinishAction()
Gets the script corresponding to the "unknown finish", used as an alternative timeout/decline action.
Definition: pizza.h:146
IsleScript::Script * m_actions
Script array for actions and finish events for the mission [AI].
Definition: pizza.h:165
Mission(MxU8 p_actorId, undefined2 p_unk0x04, MxLong *p_finishTimes, IsleScript::Script *p_actions, MxS16 p_numActions)
Initializes the mission with actor, time thresholds, scripts array, and number of actions.
Definition: pizza.h:45
undefined2 m_unk0x04
Used by mission logic, typically 2. [AI].
Definition: pizza.h:157
MxLong * m_finishTimes
Pointer to array of finish time thresholds, 4 per mission [AI].
Definition: pizza.h:160
Mission()
Default mission constructor.
Definition: pizza.h:34
MxU8 m_actorId
Actor (character) ID for this mission [AI].
Definition: pizza.h:156
MxLong GetBlueFinishTime()
Gets the maximum allowed time for a "blue" finish.
Definition: pizza.h:119
MxS16 m_hiScore
Historical best (high score) for this mission/color [AI].
Definition: pizza.h:164
void UpdateScore(ScoreColor p_score)
Updates both current and high score with the supplied new score color, raising high score if necessar...
Definition: pizza.h:126
IsleScript::Script GetRedFinishAction()
Gets the script for the "red" (best time) mission finish.
Definition: pizza.h:93
MxLong m_startTime
Time when mission started (INT_MIN if not started) [AI].
Definition: pizza.h:161
MxS16 m_unk0x06
Used by serialization and progress tracking (mission attempt counter/state) [AI].
Definition: pizza.h:158
MxS16 m_unk0x14
Used by helicopter and special mission checks [AI].
Definition: pizza.h:162
MxS16 m_score
Current completion score (LegoState color encoding) [AI].
Definition: pizza.h:163
MxLong GetTimeoutTime()
Gets the threshold time used for mission timeout events.
Definition: pizza.h:153
IsleScript::Script GetYellowFinishAction()
Gets the script for the "yellow" (slowest success) finish.
Definition: pizza.h:107
IsleScript::Script * GetActions()
Returns pointer to array of all action scripts for this mission.
Definition: pizza.h:139
MxLong GetRedFinishTime()
Gets the maximum allowed time for a "red" (perfect) finish.
Definition: pizza.h:113