Isle
Loading...
Searching...
No Matches
act3.h
Go to the documentation of this file.
1#ifndef ACT3_H
2#define ACT3_H
3
4#include "act3ammo.h"
5#include "legogamestate.h"
6#include "legostate.h"
7#include "legoworld.h"
8
18class Act3Brickster;
19class Act3Cop;
20class Act3Shark;
21class Helicopter;
23
25#define MAX_PIZZAS 20
27#define MAX_DONUTS 20
28
42
47
54 Act3ListElement(MxU32 p_objectId, undefined4 p_unk0x04, undefined p_unk0x08)
55 : m_objectId(p_objectId), m_unk0x04(p_unk0x04), m_unk0x08(p_unk0x08)
56 {
57 }
58
64 int operator==(Act3ListElement) const { return 0; }
65
71 int operator<(Act3ListElement) const { return 0; }
72};
73
81class Act3List : private list<Act3ListElement> {
82public:
86 Act3List() { m_unk0x0c = 0; }
87
94 void Insert(MxS32 p_objectId, MxS32 p_option);
95
100 void FUN_10071fa0();
101
106 void Clear();
107
113 void FUN_100720d0(MxU32 p_objectId);
114
115private:
116 undefined4 m_unk0x0c;
117};
118
126class Act3State : public LegoState {
127public:
132
137 MxBool IsSerializable() override { return FALSE; }
138
143 const char* ClassName() const override // vtable+0x0c
144 {
145 return "Act3State";
146 }
147
153 MxBool IsA(const char* p_name) const override // vtable+0x10
154 {
155 return !strcmp(p_name, Act3State::ClassName()) || LegoState::IsA(p_name);
156 }
157
158 // SYNTHETIC: LEGO1 0x1000e3c0
159 // Act3State::`scalar deleting destructor'
160
166
171};
172
182class Act3 : public LegoWorld {
183public:
187 Act3();
188
192 ~Act3() override;
193
200 MxLong Notify(MxParam& p_param) override; // vtable+0x04
201
206 MxResult Tickle() override; // vtable+0x08
207
212 MxBool VTable0x5c() override { return TRUE; } // vtable+0x5c
213
218 const char* ClassName() const override // vtable+0x0c
219 {
220 return "Act3";
221 }
222
228 MxBool IsA(const char* p_name) const override // vtable+0x10
229 {
230 return !strcmp(p_name, Act3::ClassName()) || LegoWorld::IsA(p_name);
231 }
232
238 MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
239
244 void Destroy(MxBool p_fromDestructor) override; // vtable+0x1c
245
249 void ReadyWorld() override; // vtable+0x50
250
254 void VTable0x60() override; // vtable+0x60
255
260 MxBool Escape() override; // vtable+0x64
261
267 void Enable(MxBool p_enable) override; // vtable+0x68
268
273 void SetHelicopter(Helicopter* p_copter) { m_copter = p_copter; }
274
279 void SetShark(Act3Shark* p_shark) { m_shark = p_shark; }
280
285 void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; }
286
287 // SYNTHETIC: LEGO1 0x10072630
288 // Act3::`scalar deleting destructor'
289
294 void EatPizza(MxS32 p_index);
295
300 void EatDonut(MxS32 p_index);
301
306 void RemovePizza(Act3Ammo& p_p);
307
312 void RemoveDonut(Act3Ammo& p_p);
313
322 MxResult ShootPizza(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up);
323
332 MxResult ShootDonut(LegoPathController* p_controller, Vector3& p_location, Vector3& p_direction, Vector3& p_up);
333
338 void FUN_10072ad0(undefined4 p_param1);
339
346 MxResult FUN_10073360(Act3Ammo& p_ammo, const Vector3& p_param2);
347
354 MxResult FUN_10073390(Act3Ammo& p_ammo, const Vector3& p_param2);
355
360 void SetBrickster(Act3Brickster* p_brickster);
361
366 void AddCop(Act3Cop* p_cop);
367
371 void FUN_10073400();
372
376 void FUN_10073430();
377
382 void GoodEnding(const Matrix4& p_destination);
383
388 void BadEnding(const Matrix4& p_destination);
389
393 void FUN_10073a60();
394
395 // BETA indicates that the following classes access certain members directly.
396 friend class Act3Ammo;
397 friend class Act3Brickster;
398 friend class Act3Cop;
399 friend class Act3Shark;
400
401protected:
407
413 static void DebugPrintf(const char* p_format, ...);
414
423 static void DebugCopter(
424 const Matrix4& p_copter,
425 const Matrix4& p_destination,
426 const Matrix4& p_startPosition,
427 const Matrix4& p_endPosition,
428 const MxQuaternionTransformer& p_quatTransform
429 );
430
452};
453
454#endif // ACT3_H
#define MAX_DONUTS
[AI] Maximum number of donuts that can be handled in Act 3 logic.
Definition: act3.h:27
#define MAX_PIZZAS
[AI] Maximum number of pizzas that can be handled in Act 3 logic.
Definition: act3.h:25
Represents an ammo object (pizza or donut) used in Act 3 gameplay sequence.
Definition: act3ammo.h:15
[AI] Represents the Brickster actor in Act 3, with AI and scene logic for stealing pizzas and causing...
Definition: act3actors.h:245
[AI] Represents a police officer actor in Act 3, supporting specific cop AI actions,...
Definition: act3actors.h:158
[AI] A custom intrusive list for handling state machine or scheduled actions/events during Act 3 sequ...
Definition: act3.h:81
Act3List()
[AI] Constructor, initializes the guarded flag to zero.
Definition: act3.h:86
void FUN_10071fa0()
[AI] Internal removal method for the first element, wraps a deletion and triggers any necessary clean...
Definition: act3.cpp:148
void Insert(MxS32 p_objectId, MxS32 p_option)
[AI] Inserts a new element, and conditionally triggers associated script actions or events depending ...
Definition: act3.cpp:112
void FUN_100720d0(MxU32 p_objectId)
[AI] Removes an element either by objectId or from the front of the list, and updates queue state boo...
Definition: act3.cpp:176
void Clear()
[AI] Removes all elements, triggers associated clean-up actions, and stops background audio.
Definition: act3.cpp:154
[AI] Represents the shark actor for Act 3 of the LEGO Island game.
Definition: act3actors.h:21
[AI] Holds persistent state and status variables for Act 3 mission, saved between world reloads and p...
Definition: act3.h:126
undefined4 GetUnknown0x08()
[AI] Getter for the (unknown) main status variable.
Definition: act3.h:165
undefined4 m_unk0x08
[AI] Unknown persistent field holding an instruction/state flag.
Definition: act3.h:170
const char * ClassName() const override
[AI] Returns class name for RTTI string matching.
Definition: act3.h:143
Act3State()
[AI] Initializes additional persistent status fields.
Definition: act3.h:131
MxBool IsSerializable() override
[AI] Indicates whether this state is serializable to disk or not.
Definition: act3.h:137
MxBool IsA(const char *p_name) const override
[AI] Checks if the class name matches a given string or any parent class.
Definition: act3.h:153
[AI] Controls all main logic and progression of Act 3 in LEGO Island, including objects,...
Definition: act3.h:182
Act3Cop * m_cop2
[AI] Second cop, instantiated when both are present.
Definition: act3.h:436
MxBool IsA(const char *p_name) const override
[AI] Checks if the class name matches this class or any parent class.
Definition: act3.h:228
void EatPizza(MxS32 p_index)
[AI] Simulates eating (removing) a pizza from the world at the given index.
Definition: act3.cpp:255
void Enable(MxBool p_enable) override
[AI] Enables/Disables the world, handling time shifting/resume logic for all major actors in Act3.
Definition: act3.cpp:871
MxResult ShootDonut(LegoPathController *p_controller, Vector3 &p_location, Vector3 &p_direction, Vector3 &p_up)
[AI] Attempts to launch a donut as a projectile using the given controller and initial transform.
Definition: act3.cpp:365
MxU8 m_unk0x421d
[AI] Index/counter for sixth event-queue or script sequence. [AI_SUGGESTED_NAME: m_scriptIndex6]
Definition: act3.h:446
const char * ClassName() const override
[AI] Returns the class name string.
Definition: act3.h:218
Act3Script::Script m_unk0x426c
[AI] Current animation or script in progress (for intro/finale). [AI_SUGGESTED_NAME: m_currentScript]
Definition: act3.h:450
MxLong HandleTransitionEnd()
[AI] Handles logic when a world/area transition is completed.
Definition: act3.cpp:654
~Act3() override
[AI] Cleans up world and unregisters from notifications, frees all owned data.
Definition: act3.cpp:246
MxResult Tickle() override
[AI] Main tick/update—called on each game loop iteration to update state, advance animations,...
Definition: act3.cpp:680
void VTable0x60() override
[AI] Empty implementation for Act3-specific state logic; present for interface fulfillment.
Definition: act3.cpp:952
MxU8 m_unk0x421a
[AI] Index/counter for third event-queue or script sequence. [AI_SUGGESTED_NAME: m_scriptIndex3]
Definition: act3.h:443
MxResult ShootPizza(LegoPathController *p_controller, Vector3 &p_location, Vector3 &p_direction, Vector3 &p_up)
[AI] Attempts to launch a pizza as a projectile using the given controller and initial transform.
Definition: act3.cpp:309
MxU8 m_unk0x421c
[AI] Index/counter for fifth event-queue or script sequence. [AI_SUGGESTED_NAME: m_scriptIndex5]
Definition: act3.h:445
void FUN_10073430()
[AI] Moves Act3 and its state to a different step/action in custom sequence (used for in-game cutscen...
Definition: act3.cpp:754
static void DebugPrintf(const char *p_format,...)
[AI] Debug utility, outputs formatted diagnostic messages for Act3 copter and world state.
Definition: act3.cpp:785
MxU8 m_unk0x421b
[AI] Index/counter for fourth event-queue or script sequence. [AI_SUGGESTED_NAME: m_scriptIndex4]
Definition: act3.h:444
Act3State * m_state
[AI] Current persistent Act3 state (progress flags, etc.).
Definition: act3.h:431
void Destroy(MxBool p_fromDestructor) override
[AI] Teardown logic for Act 3, unregisters from world and resets navigation/input.
Definition: act3.cpp:516
Act3Ammo m_pizzas[MAX_PIZZAS]
[AI] All possible pizza projectiles/instances in flight for this sequence.
Definition: act3.h:432
void SetHelicopter(Helicopter *p_copter)
[AI] Sets helicopter reference for main mission.
Definition: act3.h:273
MxResult FUN_10073390(Act3Ammo &p_ammo, const Vector3 &p_param2)
[AI] Triggers script/animation effects on cops for donuts that impact them.
Definition: act3.cpp:710
void SetShark(Act3Shark *p_shark)
[AI] Sets Act3Shark reference for the current encounter.
Definition: act3.h:279
MxBool Escape() override
[AI] Handles "escape" action (user attempts to leave/quit Act 3); cleans up state and halts audio/ani...
Definition: act3.cpp:958
Act3Shark * m_shark
[AI] Shark entity in the world, for special chase/attack scenes.
Definition: act3.h:439
void GoodEnding(const Matrix4 &p_destination)
[AI] Handles victory logic for Act3 (good ending); disables enemy actors, clears lists,...
Definition: act3.cpp:763
void AddCop(Act3Cop *p_cop)
[AI] Registers a new cop, assigning to cop1 or cop2 as appropriate.
Definition: act3.cpp:728
MxLong Notify(MxParam &p_param) override
[AI] Handles notifications from other systems (animation, transition, audio, etc.).
Definition: act3.cpp:542
Act3Brickster * m_brickster
[AI] Main antagonist.
Definition: act3.h:437
void SetBrickster(Act3Brickster *p_brickster)
[AI] Sets the reference to the Brickster actor in this Act3 instance.
Definition: act3.cpp:740
void SetDestLocation(LegoGameState::Area p_destLocation)
[AI] Sets the destination area/location for the next world switch.
Definition: act3.h:285
MxFloat m_time
[AI] Used to track the time when Act3 was paused, and for actor resynchronization.
Definition: act3.h:440
undefined m_unk0x421e
[AI] Stores number of helicopter "dot" items to show on the HUD, decremented for bad/good ending....
Definition: act3.h:447
Act3Ammo m_donuts[MAX_DONUTS]
[AI] All possible donuts in flight/active for Act3's special logic.
Definition: act3.h:433
LegoGameState::Area m_destLocation
[AI] Target world/area to switch to upon transition. Used for story progression.
Definition: act3.h:451
MxBool VTable0x5c() override
[AI] Always returns TRUE, notifies higher-level logic that Act 3 is always enabled for handing VTable...
Definition: act3.h:212
static void DebugCopter(const Matrix4 &p_copter, const Matrix4 &p_destination, const Matrix4 &p_startPosition, const Matrix4 &p_endPosition, const MxQuaternionTransformer &p_quatTransform)
[AI] Debugs world matrices and quaternion transforms for helicopter camera/final animation.
Definition: act3.cpp:791
void FUN_10073400()
[AI] Moves Act3 and its state to next step/action in custom sequence (used for in-game cutscene trans...
Definition: act3.cpp:746
MxResult Create(MxDSAction &p_dsAction) override
[AI] World instancing method; sets up actors and notifies managers of state change.
Definition: act3.cpp:469
Act3Cop * m_cop1
[AI] First cop involved in sequence (player/AI).
Definition: act3.h:435
MxPresenter * m_helicopterDots[15]
[AI] Visual indicators for helicopter progress/UI.
Definition: act3.h:449
void BadEnding(const Matrix4 &p_destination)
[AI] Handles loss logic for Act3 (bad ending); disables enemy actors, clears lists,...
Definition: act3.cpp:842
void FUN_10072ad0(undefined4 p_param1)
[AI] Triggers special sequence actions or sounds depending on the provided param; cycles through queu...
Definition: act3.cpp:406
void ReadyWorld() override
[AI] Called when transitioning into Act 3; triggers state setup and intro animation/missions.
Definition: act3.cpp:665
undefined m_unk0x41fc
[AI] General flag, possibly "started" or "initialized". [AI_SUGGESTED_NAME: m_started]
Definition: act3.h:434
void FUN_10073a60()
[AI] Removes one helicopter dot from the HUD, used when the copter progresses or an event is triggere...
Definition: act3.cpp:864
Helicopter * m_copter
[AI] Player's helicopter, main vehicle.
Definition: act3.h:438
MxU8 m_unk0x4219
[AI] Index/counter for the second event-queue or script sequence. [AI_SUGGESTED_NAME: m_scriptIndex2]
Definition: act3.h:442
Act3List m_unk0x4220
[AI] Main queue/list for triggering and removing queued scripted actions. [AI_SUGGESTED_NAME: m_actio...
Definition: act3.h:448
Act3()
[AI] Initializes all mission-critical actors, resets world state, and sets up notification and naviga...
Definition: act3.cpp:225
MxResult FUN_10073360(Act3Ammo &p_ammo, const Vector3 &p_param2)
[AI] Triggers script/animation effects on the brickster for pizzas that impact him.
Definition: act3.cpp:700
void EatDonut(MxS32 p_index)
[AI] Simulates eating (removing) a donut from the world at the given index.
Definition: act3.cpp:263
void RemoveDonut(Act3Ammo &p_p)
[AI] Removes given donut actor and performs associated logic.
Definition: act3.cpp:290
MxU8 m_unk0x4218
[AI] Index/counter for the first event-queue or script sequence. [AI_SUGGESTED_NAME: m_scriptIndex1]
Definition: act3.h:441
void RemovePizza(Act3Ammo &p_p)
[AI] Removes given pizza actor and performs associated logic.
Definition: act3.cpp:271
[AI] Represents the flyable helicopter vehicle/path actor in the game, handling all in-game behaviors...
Definition: helicopter.h:57
Area
Enumeration of all major in-game locations ("areas") for area/scene management and serialization.
Definition: legogamestate.h:92
[AI] Manager for controlling actors' movement along predefined geometric paths.
[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
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
Definition: legoworld.h:49
MxBool IsA(const char *p_name) const override
Runtime type checking; checks class hierarchy.
Definition: legoworld.h:153
4x4 Matrix class with virtual interface for manipulation and transformation.
Definition: matrix.h:24
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
Definition: mxparam.h:7
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
Definition: mxpresenter.h:20
Quaternion interpolation utility for 4D transformations, supporting quaternion start/end points and s...
Definition: mxquaternion.h:14
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
#define override
Definition: compat.h:21
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
unsigned int undefined4
Definition: decomp.h:28
unsigned char undefined
Definition: decomp.h:26
#define list
[AI] Macro alias for List<T>, replacing std::list<T>.
Definition: mxstl.h:410
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
float MxFloat
[AI]
Definition: mxtypes.h:68
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
Script
[AI] Same as above; compatibility for pre-C++11 code.
Definition: act3_actions.h:27
[AI] Represents an element in a custom list for activity scripting and audio/animation event queueing...
Definition: act3.h:38
int operator<(Act3ListElement) const
[AI] Comparison operator for sorting, seems to be a placeholder (always returns 0).
Definition: act3.h:71
int operator==(Act3ListElement) const
[AI] Comparison operator, seems to be a placeholder (always returns 0).
Definition: act3.h:64
Act3ListElement()
[AI] Default constructor.
Definition: act3.h:46
Act3ListElement(MxU32 p_objectId, undefined4 p_unk0x04, undefined p_unk0x08)
[AI] Initializes all fields in Act3ListElement.
Definition: act3.h:54
MxU32 m_objectId
[AI] Refers to an in-game object or script action; exact semantics are context-dependent.
Definition: act3.h:39
undefined4 m_unk0x04
[AI] Option/type/priority for this action. [AI_SUGGESTED_NAME: m_option]
Definition: act3.h:40
undefined m_unk0x08
[AI] Boolean/flag; indicates if the corresponding object/action is active, completed,...
Definition: act3.h:41