Isle
Loading...
Searching...
No Matches
ambulance.cpp
Go to the documentation of this file.
1#include "ambulance.h"
2
3#include "decomp.h"
4#include "isle.h"
5#include "isle_actions.h"
6#include "jukebox_actions.h"
9#include "legogamestate.h"
10#include "legonavcontroller.h"
11#include "legopathstruct.h"
12#include "legoutils.h"
13#include "legovariables.h"
14#include "legoworld.h"
15#include "misc.h"
18#include "mxmisc.h"
19#include "mxsoundpresenter.h"
20#include "mxticklemanager.h"
21#include "mxtimer.h"
22#include "mxtransitionmanager.h"
23#include "mxvariabletable.h"
24#include "scripts.h"
25
28
29// Flags used in isle.cpp
30extern MxU32 g_isleFlags;
31
32// FUNCTION: LEGO1 0x10035ee0
33// FUNCTION: BETA10 0x10022820
35{
36 m_maxLinearVel = 40.0;
37 m_state = NULL;
38 m_unk0x168 = 0;
39 m_actorId = -1;
40 m_unk0x16c = 0;
41 m_unk0x16e = 0;
42 m_unk0x170 = 0;
43 m_lastAction = IsleScript::c_noneIsle;
44 m_unk0x172 = 0;
45 m_lastAnimation = IsleScript::c_noneIsle;
46 m_fuel = 1.0;
47}
48
49// FUNCTION: LEGO1 0x10036150
50// FUNCTION: BETA10 0x100228fe
52{
55}
56
57// FUNCTION: LEGO1 0x100361d0
58// FUNCTION: BETA10 0x10022993
60{
61 MxResult result = IslePathActor::Create(p_dsAction);
62
63 if (result == SUCCESS) {
65
66 if (m_world) {
67 m_world->Add(this);
68 }
69
70 m_state = (AmbulanceMissionState*) GameState()->GetState("AmbulanceMissionState");
71 if (!m_state) {
72 m_state = new AmbulanceMissionState();
73 m_state->m_unk0x08 = 0;
74 GameState()->RegisterState(m_state);
75 }
76 }
77
79 m_fuel = 1.0;
80 m_time = Timer()->GetTime();
81 return result;
82}
83
84// FUNCTION: LEGO1 0x10036300
85void Ambulance::Animate(float p_time)
86{
88
89 if (UserActor() == this) {
90 char buf[200];
91 float speed = abs(m_worldSpeed);
92 float maxLinearVel = NavController()->GetMaxLinearVel();
93
94 sprintf(buf, "%g", speed / maxLinearVel);
96
97 m_fuel += (p_time - m_time) * -3.333333333e-06f;
98 if (m_fuel < 0) {
99 m_fuel = 0;
100 }
101
102 m_time = p_time;
103
104 sprintf(buf, "%g", m_fuel);
106 }
107}
108
109// FUNCTION: LEGO1 0x100363f0
110// FUNCTION: BETA10 0x10022b2a
112{
113 LegoGameState* gameState = GameState();
114 AmbulanceMissionState* state = (AmbulanceMissionState*) gameState->GetState("AmbulanceMissionState");
115
116 if (state == NULL) {
117 state = (AmbulanceMissionState*) gameState->CreateState("AmbulanceMissionState");
118 }
119
120 m_state = state;
121}
122
123// FUNCTION: LEGO1 0x10036420
124// FUNCTION: BETA10 0x10022b84
126{
127 MxLong result = 0;
128 MxNotificationParam& param = (MxNotificationParam&) p_param;
129
130 switch (param.GetNotification()) {
132 result = HandleNotification0();
133 break;
136 break;
139 break;
141 result = HandleClick();
142 break;
145 break;
148 break;
149 }
150
151 return result;
152}
153
154// FUNCTION: LEGO1 0x100364d0
155// FUNCTION: BETA10 0x10022cc2
157{
158 if (p_param.GetAction() != NULL) {
160
161 if (m_lastAnimation == objectId) {
162 m_lastAnimation = IsleScript::c_noneIsle;
163 }
164
165 if (m_lastAction == objectId) {
166 if (m_lastAnimation == IsleScript::c_noneIsle) {
168 }
169
170 m_lastAction = IsleScript::c_noneIsle;
171 }
172 else if (objectId == IsleScript::c_hho027en_RunAnim) {
173 m_state->m_unk0x08 = 1;
175 HandleClick();
176 m_unk0x172 = 0;
177 TickleManager()->RegisterClient(this, 40000);
178 }
180 if (m_unk0x170 == 3) {
181 PlayAnimation(IsleScript::c_hpz055pa_RunAnim);
182 m_unk0x170 = 0;
183 }
184 else {
185 PlayAnimation(IsleScript::c_hpz053pa_RunAnim);
186 }
187 }
188 else if (objectId == IsleScript::c_hpz050bd_RunAnim || objectId == IsleScript::c_hpz052ma_RunAnim) {
189 if (m_unk0x170 == 3) {
190 PlayAnimation(IsleScript::c_hpz057ma_RunAnim);
191 m_unk0x170 = 0;
192 }
193 else {
194 PlayAnimation(IsleScript::c_hpz052ma_RunAnim);
195 }
196 }
197 else if (objectId == IsleScript::c_hpz055pa_RunAnim || objectId == IsleScript::c_hpz057ma_RunAnim) {
199 HandleClick();
201 m_unk0x172 = 0;
202 TickleManager()->RegisterClient(this, 40000);
203
204 if (m_unk0x16c != 0) {
205 StopActions();
206 }
207 }
208 else if (objectId == IsleScript::c_hps116bd_RunAnim || objectId == IsleScript::c_hps118re_RunAnim) {
209 if (objectId == IsleScript::c_hps116bd_RunAnim && m_unk0x170 != 3) {
211 }
212
213 if (m_unk0x170 == 3) {
214 PlayAnimation(IsleScript::c_hps117bd_RunAnim);
215 m_unk0x170 = 0;
216 }
217 else {
218 PlayAnimation(IsleScript::c_hps118re_RunAnim);
219 }
220 }
221 else if (objectId == IsleScript::c_hps117bd_RunAnim) {
223 HandleClick();
225 m_unk0x172 = 0;
226 TickleManager()->RegisterClient(this, 40000);
227
228 if (m_unk0x16e != 0) {
229 StopActions();
230 }
231 }
232 else if (objectId == IsleScript::c_hho142cl_RunAnim || objectId == IsleScript::c_hho143cl_RunAnim || objectId == IsleScript::c_hho144cl_RunAnim) {
233 FUN_10037250();
234 }
235 }
236
237 return 1;
238}
239
240// FUNCTION: LEGO1 0x100367c0
241// FUNCTION: BETA10 0x100230bf
243{
244 if (m_unk0x170 == 1) {
245 LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
246
247 if (roi != NULL && !strcmpi(roi->GetName(), "ps-gate")) {
248 m_unk0x170 = 3;
249 return 1;
250 }
251
252 roi = PickRootROI(p_param.GetX(), p_param.GetY());
253
254 if (roi != NULL && !strcmpi(roi->GetName(), "gd")) {
255 m_unk0x170 = 3;
256 return 1;
257 }
258 }
259
260 return 0;
261}
262
263// FUNCTION: LEGO1 0x10036860
264// FUNCTION: BETA10 0x100231bf
266{
267 // 0x168 corresponds to the path at the gas station
268 if (p_param.GetData() == 0x168) {
269 m_fuel = 1.0f;
270 }
271
272 if (p_param.GetTrigger() == LegoPathStruct::c_camAnim && p_param.GetData() == 0x0b) {
273 if (m_unk0x16e != 0) {
274 if (m_unk0x16c != 0) {
275 m_state->m_unk0x08 = 2;
276
277 if (m_lastAction != IsleScript::c_noneIsle) {
279 }
280
281 Leave();
282 MxLong time = Timer()->GetTime() - m_state->m_startTime;
283
284 if (time < 300000) {
285 m_state->UpdateScore(LegoState::e_red, m_actorId);
286 PlayFinalAnimation(IsleScript::c_hho142cl_RunAnim);
287 }
288 else if (time < 400000) {
289 m_state->UpdateScore(LegoState::e_blue, m_actorId);
290 PlayFinalAnimation(IsleScript::c_hho143cl_RunAnim);
291 }
292 else {
293 m_state->UpdateScore(LegoState::e_yellow, m_actorId);
294 PlayFinalAnimation(IsleScript::c_hho144cl_RunAnim);
295 }
296
297 return 0;
298 }
299
300 if (m_unk0x16e != 0) {
301 if (m_lastAction != IsleScript::c_noneIsle) {
303 }
304
306 return 0;
307 }
308 }
309
310 if (m_unk0x16c != 0) {
311 if (m_lastAction != IsleScript::c_noneIsle) {
313 }
314
316 }
317 }
318 else if (p_param.GetTrigger() == LegoPathStruct::c_s && p_param.GetData() == 0x131 && m_unk0x16e == 0) {
319 m_unk0x16e = 1;
320 m_unk0x170 = 1;
321
322 if (m_lastAction != IsleScript::c_noneIsle) {
324 }
325
326 Leave();
327
328 if (m_actorId < LegoActor::c_pepper || m_actorId > LegoActor::c_laura) {
329 m_actorId = LegoActor::c_laura;
330 }
331
332 switch (m_actorId) {
333 case c_pepper:
334 PlayAnimation(IsleScript::c_hpz049bd_RunAnim);
335 break;
336 case c_mama:
337 PlayAnimation(IsleScript::c_hpz047pe_RunAnim);
338 break;
339 case c_papa:
340 PlayAnimation(IsleScript::c_hpz050bd_RunAnim);
341 break;
342 case c_nick:
343 case c_laura:
344 PlayAnimation(IsleScript::c_hpz048pe_RunAnim);
345 break;
346 }
347 }
348 else if (p_param.GetTrigger() == LegoPathStruct::c_camAnim && (p_param.GetData() == 0x22 || p_param.GetData() == 0x23 || p_param.GetData() == 0x24) && m_unk0x16c == 0) {
349 m_unk0x16c = 1;
350 m_unk0x170 = 1;
351
352 if (m_lastAction != IsleScript::c_noneIsle) {
354 }
355
356 Leave();
357 PlayAnimation(IsleScript::c_hps116bd_RunAnim);
358 }
359
360 return 0;
361}
362
363// FUNCTION: LEGO1 0x10036ce0
364// FUNCTION: BETA10 0x10023506
366{
367 if (((Act1State*) GameState()->GetState("Act1State"))->m_unk0x018 != 10) {
368 return 1;
369 }
370
371 if (m_state->m_unk0x08 == 2) {
372 return 1;
373 }
374
375 FUN_10015820(TRUE, 0);
376 ((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_ambulance);
378
379 if (UserActor()->GetActorId() != GameState()->GetActorId()) {
380 ((IslePathActor*) UserActor())->Exit();
381 }
382
383 m_time = Timer()->GetTime();
384 m_actorId = UserActor()->GetActorId();
385
386 Enter();
388 ControlManager()->Register(this);
389
390 if (m_state->m_unk0x08 == 1) {
392 m_state->m_startTime = Timer()->GetTime();
394 }
395
396 return 1;
397}
398
399// FUNCTION: LEGO1 0x10036e60
400// FUNCTION: BETA10 0x100236bb
402{
403 m_state->m_unk0x08 = 2;
404 PlayAnimation(IsleScript::c_hho027en_RunAnim);
405 m_lastAction = IsleScript::c_noneIsle;
406 m_lastAnimation = IsleScript::c_noneIsle;
407}
408
409// FUNCTION: LEGO1 0x10036e90
411{
413 StopActions();
414 FUN_10037250();
415 Leave();
416}
417
418// FUNCTION: LEGO1 0x10036ec0
419void Ambulance::Leave()
420{
422 CurrentWorld()->RemoveActor(this);
431 ControlManager()->Unregister(this);
433}
434
435// FUNCTION: LEGO1 0x10036f90
437{
438 MxLong result = 0;
439
440 if (p_param.m_unk0x28 == 1) {
441 switch (p_param.m_clickedObjectId) {
443 Exit();
445 result = 1;
446 break;
448 ((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain);
450 Exit();
452 result = 1;
453 break;
455 MxSoundPresenter* presenter =
456 (MxSoundPresenter*) CurrentWorld()->Find("MxSoundPresenter", "AmbulanceHorn_Sound");
457 presenter->Enable(p_param.m_unk0x28);
458 break;
459 }
460 }
461
462 return result;
463}
464
465// FUNCTION: LEGO1 0x10037060
467{
469
470 if (m_state->m_unk0x08 == 1) {
471 m_state->m_unk0x08 = 0;
473 }
474 else if (m_unk0x16c != 0 && m_unk0x16e != 0) {
475 IsleScript::Script objectId;
476
477 switch (rand() % 2) {
478 case 0:
480 break;
481 case 1:
483 break;
484 }
485
486 if (m_lastAction != IsleScript::c_noneIsle) {
488 }
489
490 PlayAction(objectId);
491 }
492 else {
493 IsleScript::Script objectId;
494
495 switch (rand() % 2) {
496 case 0:
498 break;
499 case 1:
501 break;
502 }
503
504 if (m_lastAction != IsleScript::c_noneIsle) {
506 }
507
508 PlayAction(objectId);
509 }
510}
511
512// FUNCTION: LEGO1 0x10037160
513// FUNCTION: BETA10 0x100237df
515{
516 if (m_unk0x172 == 0) {
517 m_unk0x172 = 1;
518 }
519 else if (m_lastAction == IsleScript::c_noneIsle) {
520 IsleScript::Script objectId;
521
522 switch ((rand() % 12) + 1) {
523 case 1:
525 break;
526 case 2:
528 break;
529 case 3:
531 break;
532 case 4:
534 break;
535 case 5:
537 break;
538 case 6:
540 break;
541 case 7:
543 break;
544 case 8:
546 break;
547 case 9:
549 break;
550 case 10:
552 break;
553 case 11:
555 break;
556 case 12:
558 break;
559 }
560
561 PlayAction(objectId);
562 }
563
564 return SUCCESS;
565}
566
567// FUNCTION: LEGO1 0x10037240
569{
571}
572
573// FUNCTION: LEGO1 0x10037250
575{
576 StopAction(m_lastAction);
578 ((Act1State*) GameState()->GetState("Act1State"))->m_unk0x018 = 0;
579 m_state->m_unk0x08 = 0;
580 m_unk0x16e = 0;
581 m_unk0x16c = 0;
585 m_state->m_startTime = INT_MIN;
586 m_state = NULL;
587}
588
589// FUNCTION: LEGO1 0x100372e0
590// FUNCTION: BETA10 0x100241a0
591void Ambulance::PlayAnimation(IsleScript::Script p_objectId)
592{
595 m_lastAnimation = p_objectId;
596}
597
598// FUNCTION: LEGO1 0x10037310
599// FUNCTION: BETA10 0x10024440
600void Ambulance::PlayFinalAnimation(IsleScript::Script p_objectId)
601{
604 m_lastAnimation = p_objectId;
605}
606
607// FUNCTION: LEGO1 0x10037340
608void Ambulance::StopAction(IsleScript::Script p_objectId)
609{
610 if (p_objectId != -1) {
612 }
613}
614
615// FUNCTION: LEGO1 0x10037360
616void Ambulance::PlayAction(IsleScript::Script p_objectId)
617{
618 if (p_objectId != -1) {
620 }
621
622 m_lastAction = p_objectId;
624}
625
626// FUNCTION: LEGO1 0x100373a0
628{
629 m_unk0x08 = 0;
630 m_startTime = 0;
631 m_peScore = 0;
632 m_maScore = 0;
633 m_paScore = 0;
634 m_niScore = 0;
635 m_laScore = 0;
636 m_peHighScore = 0;
637 m_maHighScore = 0;
638 m_paHighScore = 0;
639 m_niHighScore = 0;
640 m_laHighScore = 0;
641}
MxU32 g_isleFlags
Definition: isle.cpp:46
[AI] Holds state and transient gameplay data for the first act on Lego Island.
Definition: isle.h:29
Holds state and scoring information for the Ambulance mission.
Definition: ambulance.h:12
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]
Definition: ambulance.h:49
MxLong m_startTime
[AI] Mission timer: records when the mission started (in milliseconds?). [AI]
Definition: ambulance.h:46
MxS16 m_laScore
[AI] Last achieved mission score for Laura. [AI]
Definition: ambulance.h:57
MxS16 m_niHighScore
[AI] Highest ever mission score for Nick. [AI]
Definition: ambulance.h:66
MxS16 m_paHighScore
[AI] Highest ever mission score for Papa. [AI]
Definition: ambulance.h:64
MxS16 m_laHighScore
[AI] Highest ever mission score for Laura. [AI]
Definition: ambulance.h:68
MxS16 m_maScore
[AI] Last achieved mission score for Mama. [AI]
Definition: ambulance.h:51
MxS16 m_paScore
[AI] Last achieved mission score for Papa. [AI]
Definition: ambulance.h:53
MxS16 m_maHighScore
[AI] Highest ever mission score for Mama. [AI]
Definition: ambulance.h:62
AmbulanceMissionState()
[AI] Default constructor; initializes all scores, high scores, time and internal state to zero....
Definition: ambulance.cpp:627
MxS16 m_niScore
[AI] Last achieved mission score for Nick. [AI]
Definition: ambulance.h:55
undefined4 m_unk0x08
[AI] Flag/state variable—purpose unclear, likely denotes mission sub-state or phase....
Definition: ambulance.h:44
MxS16 m_peHighScore
[AI] Highest ever mission score for Pepper. [AI]
Definition: ambulance.h:60
Main game logic and control entity for the Ambulance gameplay activity.
Definition: ambulance.h:75
virtual MxLong HandleButtonDown(LegoControlManagerNotificationParam &p_param)
[AI] Handles button down events in the mission interface (e.g., gate click).
Definition: ambulance.cpp:242
virtual MxLong HandleEndAction(MxEndActionNotificationParam &p_param)
[AI] Handles end action notifications (e.g., animation completion), progresses mission or triggers fe...
Definition: ambulance.cpp:156
MxLong Notify(MxParam &p_param) override
[AI] Handles notifications from the system (events, actions, button presses, etc.).
Definition: ambulance.cpp:125
void CreateState()
[AI] Ensures AmbulanceMissionState is present in the game state manager; creates if missing....
Definition: ambulance.cpp:111
void FUN_10037250()
[AI] Resets game- and mission-related state after the mission; restores music, resets state objects,...
Definition: ambulance.cpp:574
MxLong HandleClick() override
[AI] Handles a "click" on this Ambulance actor (starts mission, triggers transitions,...
Definition: ambulance.cpp:365
void ActivateSceneActions()
[AI] Handles the enabling of in-game ambient/scene actions when player enters the hospital scene....
Definition: ambulance.cpp:466
void FUN_10036e60()
[AI] Marks mission as failed/successful, triggers cutscene/animation for mission outcome....
Definition: ambulance.cpp:401
~Ambulance() override
[AI] Destructor—unregisters the Ambulance from control and tickle managers and performs cleanup....
Definition: ambulance.cpp:51
void Animate(float p_time) override
[AI] Per-frame update for position, fuel, and any animation logic.
Definition: ambulance.cpp:85
MxResult Create(MxDSAction &p_dsAction) override
[AI] Creates this Ambulance object based on the provided DS action (from scripts/etc).
Definition: ambulance.cpp:59
void Exit() override
[AI] Exits the mission; triggers cleanup, world removal, and area/state updates. [AI]
Definition: ambulance.cpp:410
MxResult Tickle() override
[AI] Called on each game "tick" to update state, handle random sounds, etc.
Definition: ambulance.cpp:514
MxLong HandleControl(LegoControlManagerNotificationParam &p_param) override
[AI] Responds to control (UI/keyboard/joystick) input events.
Definition: ambulance.cpp:436
MxLong HandlePathStruct(LegoPathStructNotificationParam &p_param) override
[AI] Handles notifications related to path structure triggers such as mission segments or locations.
Definition: ambulance.cpp:265
void StopActions()
[AI] Stops currently running scripted actions/animations associated with the Ambulance mission....
Definition: ambulance.cpp:568
Derived path actor type for handling player transitions and activities on LEGO Island.
Definition: islepathactor.h:23
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...
Definition: isle.h:179
@ c_playMusic
[AI] If set, background music plays.
Definition: isle.h:184
@ c_nick
Nick ([AI])
Definition: legoactor.h:20
@ c_laura
Laura ([AI])
Definition: legoactor.h:21
@ c_mama
Mama ([AI])
Definition: legoactor.h:18
@ c_pepper
Pepper Roni ([AI])
Definition: legoactor.h:17
@ c_papa
Papa ([AI])
Definition: legoactor.h:19
virtual MxU8 GetActorId()
[AI] Gets this actor's numeric ID, corresponding to a known enumeration/actor.
Definition: legoactor.h:77
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]
Definition: legoentity.h:212
LegoROI * m_roi
[AI] Pointer to this entity's currently assigned ROI (3D instance in the world). [AI]
Definition: legoentity.h:215
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,...
Definition: legogamestate.h:78
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].
Definition: legogamestate.h:96
@ e_unk31
Unknown [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.
Definition: legoroi.h:43
const LegoChar * GetName() const
[AI] Gets this ROI's name.
Definition: legoroi.h:287
@ e_red
[AI] Warning/critical color (3) [AI]
Definition: legostate.h:26
@ e_yellow
[AI] First colored highlight (1) [AI]
Definition: legostate.h:24
@ e_blue
[AI] Second color, e.g. better score (2) [AI]
Definition: legostate.h:25
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.
Definition: legoworld.cpp:267
virtual void Add(MxCore *p_object)
Adds an object (entity, presenter, ROI, etc.) to the appropriate world-managed list or set.
Definition: legoworld.cpp:418
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
void RemoveActor(LegoPathActor *p_actor)
Removes an actor from all known path controllers.
Definition: legoworld.cpp:325
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...
Definition: mxdsaction.h:17
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
Definition: mxdsobject.h:130
[AI] Notification parameter marking the end of an action, specialization of MxActionNotificationParam...
void Enable(MxBool p_enable) override
[AI] Enables or disables media stream playback and transitions state as needed.
[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...
Definition: mxparam.h:7
[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.
Definition: mxtimer.h:50
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.
Definition: roi.h:235
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#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
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.
Definition: legoutils.cpp:271
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...
Definition: legoutils.cpp:495
LegoROI * PickROI(MxLong p_x, MxLong p_y)
[AI] Picks the ROI (Renderable Object Instance) at screen coordinates.
Definition: legoutils.cpp:39
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.
Definition: legoutils.cpp:48
MxAtomId * g_isleScript
[AI] Node used in hierarchical scene graphs and animation trees. [AI]
Definition: scripts.cpp:32
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]
Definition: misc.cpp:61
LegoAnimationManager * AnimationManager()
[AI] Accessor for the animation manager, which controls Lego character/world animation state....
Definition: misc.cpp:69
MxTransitionManager * TransitionManager()
[AI] Accessor for the MxTransitionManager, handling level transitions, fades, and world changes....
Definition: misc.cpp:208
MxBackgroundAudioManager * BackgroundAudioManager()
[AI] Accessor for the background audio manager. Used for background music and ambient sounds....
Definition: misc.cpp:37
LegoControlManager * ControlManager()
[AI] Accessor for the control manager through the input manager; manages higher-level user/game contr...
Definition: misc.cpp:53
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
Definition: misc.cpp:93
void FUN_10015820(MxBool p_disable, MxU16 p_flags)
[AI] Utility for enabling or disabling functionality in LegoOmni based on certain flags.
Definition: misc.cpp:143
LegoNavController * NavController()
[AI] Accessor for the navigation controller, managing player/camera navigation. [AI]
Definition: misc.cpp:77
void PlayMusic(JukeboxScript::Script p_objectId)
[AI] Starts music playback by scripting the background audio manager to play the music piece referenc...
Definition: misc.cpp:216
LegoPathActor * UserActor()
[AI] Accessor for the user (player-controllable) LegoPathActor. [AI]
Definition: misc.cpp:85
MxTimer * Timer()
[AI] Returns the global simulation timer.
Definition: mxmisc.cpp:33
MxVariableTable * VariableTable()
[AI] Returns the variable table used for script variables and global key/value state.
Definition: mxmisc.cpp:73
MxTickleManager * TickleManager()
[AI] Provides access to the global tickle manager.
Definition: mxmisc.cpp:25
@ 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]
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
@ c_hpz055pa_RunAnim
Definition: isle_actions.h:718
@ c_ham039ra_PlayWav
Definition: isle_actions.h:911
@ c_hpz049bd_RunAnim
Definition: isle_actions.h:714
@ c_AmbulanceHorn_Ctl
Definition: isle_actions.h:184
@ c_ham042cl_PlayWav
Definition: isle_actions.h:914
@ c_ham044cl_PlayWav
Definition: isle_actions.h:916
@ c_AmbulanceInfo_Ctl
Definition: isle_actions.h:182
@ c_hpz048pe_RunAnim
Definition: isle_actions.h:713
@ c_hpz047pe_RunAnim
Definition: isle_actions.h:712
@ c_hho144cl_RunAnim
Definition: isle_actions.h:705
@ c_pns018rd_RunAnim
Definition: isle_actions.h:446
@ c_AmbulanceFuelMeter
Definition: isle_actions.h:186
@ c_ham033cl_PlayWav
Definition: isle_actions.h:907
@ c_AmbulanceDashboard
Definition: isle_actions.h:179
@ c_hps117bd_RunAnim
Definition: isle_actions.h:708
@ c_AmbulanceArms_Ctl
Definition: isle_actions.h:181
@ c_ham036ra_PlayWav
Definition: isle_actions.h:910
@ c_hps118re_RunAnim
Definition: isle_actions.h:709
@ c_hho143cl_RunAnim
Definition: isle_actions.h:704
@ c_hpz053pa_RunAnim
Definition: isle_actions.h:717
@ c_Avo923In_PlayWav
Definition: isle_actions.h:959
@ c_ham088cl_PlayWav
Definition: isle_actions.h:924
@ c_Avo916In_PlayWav
Definition: isle_actions.h:953
@ c_ham076cl_PlayWav
Definition: isle_actions.h:920
@ c_hpz037ma_PlayWav
Definition: isle_actions.h:927
@ c_AmbulanceDashboard_Bitmap
Definition: isle_actions.h:180
@ c_ham045cl_PlayWav
Definition: isle_actions.h:917
@ c_ham035ra_PlayWav
Definition: isle_actions.h:909
@ c_hps116bd_RunAnim
Definition: isle_actions.h:707
@ c_ham041cl_PlayWav
Definition: isle_actions.h:913
@ c_ham040cl_PlayWav
Definition: isle_actions.h:912
@ c_Avo915In_PlayWav
Definition: isle_actions.h:952
@ c_AmbulanceHorn_Sound
Definition: isle_actions.h:183
@ c_AmbulanceSpeedMeter
Definition: isle_actions.h:185
@ c_ham113cl_PlayWav
Definition: isle_actions.h:925
@ c_hpz052ma_RunAnim
Definition: isle_actions.h:716
@ c_ham075cl_PlayWav
Definition: isle_actions.h:919
@ c_hpz057ma_RunAnim
Definition: isle_actions.h:719
@ c_hho142cl_RunAnim
Definition: isle_actions.h:703
@ c_ham034ra_PlayWav
Definition: isle_actions.h:908
@ c_sns078pa_PlayWav
Definition: isle_actions.h:928
@ c_ham043cl_PlayWav
Definition: isle_actions.h:915
@ c_hho027en_RunAnim
Definition: isle_actions.h:706
@ c_hpz050bd_RunAnim
Definition: isle_actions.h:715
@ c_Hospital_Music
[AI] Background music for the hospital.
[AI] Contains global script AtomId pointers and utility functions for managing script AtomIds in LEGO...
@ e_stop
[AI] Stop an activity or playback [AI]
Definition: extra.h:31
@ e_start
[AI] Start an activity or playback [AI]
Definition: extra.h:30