39 m_maxLinearVel = 40.0;
86 sprintf(buf,
"%g", speed / maxLinearVel);
89 m_fuel += (p_time - m_time) * -3.333333333e-06f;
96 sprintf(buf,
"%g", m_fuel);
110 if (m_state ==
NULL) {
159 if (m_lastAnimation == objectId) {
163 if (m_lastAction == objectId) {
175 switch ((rand() % ((m_actorId != 4 ? 4 : 3))) + 1) {
292 if (p_param.
GetData() == 0x168) {
311 else if (time < 300000) {
330 if (p_param.
GetData() == 0x15f) {
331 if (m_unk0x16c == 0) {
336 else if (p_param.
GetData() == 0x160) {
337 if (m_unk0x16e == 0) {
354 switch ((rand() % 2) + 1) {
364 switch ((rand() % 2) + 1) {
374 switch ((rand() % 2) + 1) {
384 switch ((rand() % 2) + 1) {
395 PlayAction(objectId);
465void TowTrack::Leave()
548 if (m_lastAction != -1) {
570 m_lastAnimation = p_objectId;
579 m_lastAnimation = p_objectId;
589 m_lastAction = p_objectId;
[AI] Holds state and transient gameplay data for the first act on Lego Island.
Derived path actor type for handling player transitions and activities on LEGO Island.
MxResult Create(MxDSAction &p_dsAction) override
[AI] Initialize this actor from a DSAction.
virtual void SpawnPlayer(LegoGameState::Area p_area, MxBool p_enter, MxU8 p_flags)
[AI] Spawns the player in a specific area/location, potentially triggering music and animation.
virtual MxLong HandleNotification0()
[AI] Handles custom notification type 0 for this actor.
virtual void Exit()
[AI] Called when the actor is deactivated or moved out of player control, restoring previous actor if...
LegoWorld * m_world
[AI] Pointer to the current world instance actor is existing in. [AI]
virtual void Enter()
[AI] Called when the actor is made active in a new area or context, setting navigation and visibility...
[AI] Represents the main overworld (LEGO Island) in the game, acting as the central hub and state mac...
@ c_playMusic
[AI] If set, background music plays.
@ c_pepper
Pepper Roni ([AI])
virtual MxU8 GetActorId()
[AI] Gets this actor's numeric ID, corresponding to a known enumeration/actor.
MxResult FUN_10060dc0(MxU32 p_objectId, MxMatrix *p_matrix, MxBool p_param3, MxU8 p_param4, LegoROI *p_roi, MxBool p_param6, MxBool p_param7, MxBool p_param8, MxBool p_param9)
[AI] Helper for starting a specific animation, including world matrix and camera settings.
@ e_unk1
[AI] Unknown/unspecified play mode
@ e_unk0
[AI] Unknown/unspecified play mode
void EnableCamAnims(MxBool p_enableCamAnims)
[AI] Sets whether camera-based queued animations are enabled for the world.
void FUN_1005f6d0(MxBool p_unk0x400)
[AI] Enables or disables extras (extra actors).
[AI] Notification parameter for the LegoControlManager, used to propagate information about control e...
MxS32 m_clickedObjectId
[AI] Object ID of the clicked control/presenter (or -1 if not set). [AI]
MxS16 m_unk0x28
[AI] Undetermined; settable via SetUnknown0x28. [AI]
void Register(MxCore *p_listener)
[AI] Adds a listener to be notified of control events.
void Unregister(MxCore *p_listener)
[AI] Removes a listener so it no longer receives control events.
Notification parameter for signaling the end of an animation in the LEGO Island engine.
MxFloat m_worldSpeed
[AI] World-relative speed (can affect animation/movement logic). [AI]
LegoROI * m_roi
[AI] Pointer to this entity's currently assigned ROI (3D instance in the world). [AI]
Area m_currentArea
Area/world the player is presently in. [AI].
LegoState * CreateState(const char *p_stateName)
Creates an instance of given state, registers it, and returns pointer.
void RegisterState(LegoState *p_state)
Registers a state object, replacing by class if already present.
LegoState * GetState(const char *p_stateName)
Find an existing state (LegoState-derived) object by its registered script/class name.
@ e_infomain
Information Center, main screen. [AI].
@ e_unk66
Used for some spawn locations. [AI].
@ e_garageExterior
Garage (vehicle construction) exterior. [AI].
@ e_unk28
Used for certain spawn locations. [AI].
@ e_towtrack
Towtruck (vehicle, spawn). [AI].
MxFloat GetMaxLinearVel()
[AI] Returns the current maximum linear velocity (units per sec).
virtual void Animate(float p_time)
[AI] Per-frame animation update.
[AI] Specialized notification parameter used for path structure related events in LEGO Island.
MxS16 GetData()
[AI] Retrieves the supplemental data associated with the notification.
MxU8 GetTrigger()
[AI] Returns the trigger type associated with this notification.
@ c_camAnim
[AI] Camera animation trigger.
@ c_w
[AI] World notification trigger.
@ e_red
[AI] Warning/critical color (3) [AI]
@ e_yellow
[AI] First colored highlight (1) [AI]
@ e_blue
[AI] Second color, e.g. better score (2) [AI]
MxResult PlaceActor(LegoPathActor *p_actor, const char *p_name, MxS32 p_src, float p_srcScale, MxS32 p_dest, float p_destScale)
Places an actor along a path, from source to destination, using named references and scaling.
virtual void Add(MxCore *p_object)
Adds an object (entity, presenter, ROI, etc.) to the appropriate world-managed list or set.
MxCore * Find(const char *p_class, const char *p_name)
Finds an object of a given class and name in the world.
void RemoveActor(LegoPathActor *p_actor)
Removes an actor from all known path controllers.
MxDSAction * GetAction()
[AI] Direct access to the underlying action.
void RaiseVolume()
[AI] Requests that the background music volume is raised (decrements suppression counter); triggers f...
void LowerVolume()
[AI] Requests a reduction in current background music volume, queuing for fade out (increments suppre...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
[AI] Notification parameter marking the end of an action, specialization of MxActionNotificationParam...
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
NotificationId GetNotification() const
[AI] Retrieves the current notification type of this parameter.
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
[AI] Concrete presenter for sound playback and control within the LEGO Island engine.
MxLong GetTime()
Returns the current timer value in ms, depending on running state.
MxResult StartTransition(TransitionType p_animationType, MxS32 p_speed, MxBool p_doCopy, MxBool p_playMusicInAnim)
[AI] Begins a new transition animation of type p_animationType at the specified speed,...
@ e_mosaic
[AI] Complex mosaic block-out effect.
void SetVariable(const char *p_key, const char *p_value)
Sets a variable by key and value, replacing or updating if it exists.
void SetVisibility(unsigned char p_visible)
[AI] Sets the visibility flag to the provided value.
[AI] State class for the TowTrack mini-game, storing scores by character and handling their serializa...
void UpdateScore(ScoreColor p_score, MxS16 p_actorId)
[AI] Updates the score for an actor and also updates the highscore if the new score exceeds the previ...
MxS16 m_peScore
[AI] Current Pepper score in the mission.
MxLong m_startTime
[AI] Start time of the mission attempt, used to track performance.
MxS16 m_paScore
[AI] Current Papa score in the mission.
MxS16 m_maHighScore
[AI] Highscore for Mama achieved so far in the mission.
MxBool m_unk0x10
[AI] Flag for one-time event in end-sequence (prevents repeated trigger).
MxS16 m_niHighScore
[AI] Highscore for Nick achieved so far in the mission.
MxS16 m_laScore
[AI] Current Laura score in the mission.
MxS16 m_laHighScore
[AI] Highscore for Laura achieved so far in the mission.
MxS16 m_niScore
[AI] Current Nick score in the mission.
MxS16 m_paHighScore
[AI] Highscore for Papa achieved so far in the mission.
MxS16 m_maScore
[AI] Current Mama score in the mission.
TowTrackMissionState()
[AI] Constructs and initializes all score and state values for the Tow Track mini-game.
undefined4 m_unk0x08
[AI] Mission substage/step flag for Tow Track, typically takes 0,1,2,3 (purpose per stage flow).
MxS16 m_peHighScore
[AI] Highscore for Pepper achieved so far in the mission.
[AI] 3D world actor for the Tow Track mini-game; manages Tow Track mission logic, scene activation an...
void Animate(float p_time) override
[AI] Main per-frame update.
~TowTrack() override
[AI] Destructor unregisters this TowTrack from control handlers and performs cleanup.
MxLong HandlePathStruct(LegoPathStructNotificationParam &p_param) override
[AI] Handles path-structure trigger events (e.g., player crossing locations on path networks).
void StopActions()
[AI] Halts all ongoing Tow Track mini-game actions.
MxLong HandleControl(LegoControlManagerNotificationParam &p_param) override
[AI] Handles user input or control notifications (such as UI widget actions) directed at TowTrack.
void FUN_1004dbe0()
[AI] Handles cleanup tasks upon mini-game exit, including resetting state variables and unregistering...
virtual MxLong HandleEndAction(MxEndActionNotificationParam &p_param)
[AI] Handles end of scripted in-game action (or cutscene) for the TowTrack.
void Exit() override
[AI] Called when the TowTrack mini-game is exited (by player or action/trigger).
void ActivateSceneActions()
[AI] Triggers scene-based scripted actions according to mission state.
MxLong HandleEndAnim(LegoEndAnimNotificationParam &p_param) override
[AI] Called when an animation finishes; used for state progression in the mini-game.
MxLong Notify(MxParam &p_param) override
[AI] Notifies the TowTrack actor of an event.
void CreateState()
[AI] Ensures the TowTrackMissionState exists and is registered in the global state manager.
MxLong HandleClick() override
[AI] Handles user (mouse) click event on the TowTrack, including state setup and spawning side-effect...
MxResult Create(MxDSAction &p_dsAction) override
[AI] Instantiates or restores this actor in the current world according to DSAction.
void FUN_1004dab0()
[AI] Begins the Tow Track mission, sets state variable, and triggers click-handling sequence.
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
void InvokeAction(Extra::ActionType p_actionId, const MxAtomId &p_pAtom, MxS32 p_streamId, LegoEntity *p_sender)
[AI] Dispatches and triggers a game action on the given script or object.
MxBool RemoveFromCurrentWorld(const MxAtomId &p_atomId, MxS32 p_id)
[AI] Removes an entity or presenter with specified AtomId and ID from the current world; triggers End...
MxAtomId * g_isleScript
[AI] Node used in hierarchical scene graphs and animation trees. [AI]
const char * g_varTOWFUEL
[AI] Global variable key for tow truck fuel.
const char * g_varTOWSPEED
[AI] Global variable key for tow truck speed.
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
LegoAnimationManager * AnimationManager()
[AI] Accessor for the animation manager, which controls Lego character/world animation state....
MxTransitionManager * TransitionManager()
[AI] Accessor for the MxTransitionManager, handling level transitions, fades, and world changes....
MxBackgroundAudioManager * BackgroundAudioManager()
[AI] Accessor for the background audio manager. Used for background music and ambient sounds....
LegoControlManager * ControlManager()
[AI] Accessor for the control manager through the input manager; manages higher-level user/game contr...
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
void FUN_10015820(MxBool p_disable, MxU16 p_flags)
[AI] Utility for enabling or disabling functionality in LegoOmni based on certain flags.
LegoNavController * NavController()
[AI] Accessor for the navigation controller, managing player/camera navigation. [AI]
void PlayMusic(JukeboxScript::Script p_objectId)
[AI] Starts music playback by scripting the background audio manager to play the music piece referenc...
LegoPathActor * UserActor()
[AI] Accessor for the user (player-controllable) LegoPathActor. [AI]
LegoROI * FindROI(const char *p_name)
[AI] Looks up a LegoROI (Real-time Object Instance) by name in the current world or global registry.
MxTimer * Timer()
[AI] Returns the global simulation timer.
MxVariableTable * VariableTable()
[AI] Returns the variable table used for script variables and global key/value state.
@ c_notificationControl
[AI] UI control event [AI]
@ c_notificationEndAnim
[AI] End of an animation [AI]
@ c_notificationType0
[AI] Undefined/Generic notification type [AI]
@ c_notificationEndAction
[AI] Indicates the end of an action [AI]
@ c_notificationClick
[AI] Mouse click event [AI]
@ c_notificationPathStruct
[AI] Data related to a path structure [AI]
@ c_TowTrackDashboard_Bitmap
@ c_JBMusic2
[AI] Jukebox miscellaneous music 2.