36 m_maxLinearVel = 40.0;
94 sprintf(buf,
"%g", speed / maxLinearVel);
97 m_fuel += (p_time - m_time) * -3.333333333e-06f;
104 sprintf(buf,
"%g", m_fuel);
161 if (m_lastAnimation == objectId) {
165 if (m_lastAction == objectId) {
180 if (m_unk0x170 == 3) {
189 if (m_unk0x170 == 3) {
204 if (m_unk0x16c != 0) {
213 if (m_unk0x170 == 3) {
228 if (m_unk0x16e != 0) {
244 if (m_unk0x170 == 1) {
247 if (roi !=
NULL && !strcmpi(roi->
GetName(),
"ps-gate")) {
254 if (roi !=
NULL && !strcmpi(roi->
GetName(),
"gd")) {
268 if (p_param.
GetData() == 0x168) {
273 if (m_unk0x16e != 0) {
274 if (m_unk0x16c != 0) {
288 else if (time < 400000) {
300 if (m_unk0x16e != 0) {
310 if (m_unk0x16c != 0) {
419void Ambulance::Leave()
474 else if (m_unk0x16c != 0 && m_unk0x16e != 0) {
477 switch (rand() % 2) {
490 PlayAction(objectId);
495 switch (rand() % 2) {
508 PlayAction(objectId);
516 if (m_unk0x172 == 0) {
522 switch ((rand() % 12) + 1) {
561 PlayAction(objectId);
576 StopAction(m_lastAction);
595 m_lastAnimation = p_objectId;
604 m_lastAnimation = p_objectId;
610 if (p_objectId != -1) {
618 if (p_objectId != -1) {
622 m_lastAction = p_objectId;
[AI] Holds state and transient gameplay data for the first act on Lego Island.
Holds state and scoring information for the Ambulance mission.
void UpdateScore(ScoreColor p_score, MxS16 p_actorId)
[AI] Updates the current and high score for a specific actor, if the new score is higher.
MxS16 m_peScore
[AI] Last achieved mission score for Pepper. [AI]
MxLong m_startTime
[AI] Mission timer: records when the mission started (in milliseconds?). [AI]
MxS16 m_laScore
[AI] Last achieved mission score for Laura. [AI]
MxS16 m_niHighScore
[AI] Highest ever mission score for Nick. [AI]
MxS16 m_paHighScore
[AI] Highest ever mission score for Papa. [AI]
MxS16 m_laHighScore
[AI] Highest ever mission score for Laura. [AI]
MxS16 m_maScore
[AI] Last achieved mission score for Mama. [AI]
MxS16 m_paScore
[AI] Last achieved mission score for Papa. [AI]
MxS16 m_maHighScore
[AI] Highest ever mission score for Mama. [AI]
AmbulanceMissionState()
[AI] Default constructor; initializes all scores, high scores, time and internal state to zero....
MxS16 m_niScore
[AI] Last achieved mission score for Nick. [AI]
undefined4 m_unk0x08
[AI] Flag/state variable—purpose unclear, likely denotes mission sub-state or phase....
MxS16 m_peHighScore
[AI] Highest ever mission score for Pepper. [AI]
Main game logic and control entity for the Ambulance gameplay activity.
virtual MxLong HandleButtonDown(LegoControlManagerNotificationParam &p_param)
[AI] Handles button down events in the mission interface (e.g., gate click).
virtual MxLong HandleEndAction(MxEndActionNotificationParam &p_param)
[AI] Handles end action notifications (e.g., animation completion), progresses mission or triggers fe...
MxLong Notify(MxParam &p_param) override
[AI] Handles notifications from the system (events, actions, button presses, etc.).
void CreateState()
[AI] Ensures AmbulanceMissionState is present in the game state manager; creates if missing....
void FUN_10037250()
[AI] Resets game- and mission-related state after the mission; restores music, resets state objects,...
MxLong HandleClick() override
[AI] Handles a "click" on this Ambulance actor (starts mission, triggers transitions,...
void ActivateSceneActions()
[AI] Handles the enabling of in-game ambient/scene actions when player enters the hospital scene....
void FUN_10036e60()
[AI] Marks mission as failed/successful, triggers cutscene/animation for mission outcome....
~Ambulance() override
[AI] Destructor—unregisters the Ambulance from control and tickle managers and performs cleanup....
void Animate(float p_time) override
[AI] Per-frame update for position, fuel, and any animation logic.
MxResult Create(MxDSAction &p_dsAction) override
[AI] Creates this Ambulance object based on the provided DS action (from scripts/etc).
void Exit() override
[AI] Exits the mission; triggers cleanup, world removal, and area/state updates. [AI]
MxResult Tickle() override
[AI] Called on each game "tick" to update state, handle random sounds, etc.
MxLong HandleControl(LegoControlManagerNotificationParam &p_param) override
[AI] Responds to control (UI/keyboard/joystick) input events.
MxLong HandlePathStruct(LegoPathStructNotificationParam &p_param) override
[AI] Handles notifications related to path structure triggers such as mission segments or locations.
void StopActions()
[AI] Stops currently running scripted actions/animations associated with the Ambulance mission....
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.
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]
MxS32 GetY() const
Returns Y (vertical) coordinate for the event, usually screen-relative in pixels.
MxS32 GetX() const
Returns X (horizontal) coordinate for the event, usually screen-relative in pixels.
Comprehensive persistent game state manager: handles save/load, player selection, area switching,...
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_hospitalExterior
Hospital, seen from outside. [AI].
@ e_pizzeriaExterior
Pizzeria, seen from outside. [AI].
@ e_unk33
Used for certain player spawns. [AI].
@ e_ambulance
Ambulance (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_s
[AI] State change trigger.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
const LegoChar * GetName() const
[AI] Gets this ROI's name.
@ 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.
virtual void UnregisterClient(MxCore *p_client)
[AI] Unregisters (marks for destruction) a previously registered client.
virtual void RegisterClient(MxCore *p_client, MxTime p_interval)
[AI] Registers an MxCore object to receive periodic tickles.
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.
#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...
LegoROI * PickROI(MxLong p_x, MxLong p_y)
[AI] Picks the ROI (Renderable Object Instance) at screen coordinates.
LegoROI * PickRootROI(MxLong p_x, MxLong p_y)
[AI] Picks the root ROI at the given screen coordinates by traversing up the ROI parent tree.
MxAtomId * g_isleScript
[AI] Node used in hierarchical scene graphs and animation trees. [AI]
const char * g_varAMBULSPEED
[AI] Global variable key for ambulance speed.
const char * g_varAMBULFUEL
[AI] Global variable key for ambulance fuel.
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]
MxTimer * Timer()
[AI] Returns the global simulation timer.
MxVariableTable * VariableTable()
[AI] Returns the variable table used for script variables and global key/value state.
MxTickleManager * TickleManager()
[AI] Provides access to the global tickle manager.
@ c_notificationControl
[AI] UI control event [AI]
@ c_notificationButtonDown
[AI] Mouse/gamepad button press [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_AmbulanceDashboard_Bitmap
@ c_Hospital_Music
[AI] Background music for the hospital.
[AI] Contains global script AtomId pointers and utility functions for managing script AtomIds in LEGO...