Isle
Loading...
Searching...
No Matches
hospital.cpp
Go to the documentation of this file.
1#include "hospital.h"
2
3#include "hospital_actions.h"
4#include "isle.h"
5#include "islepathactor.h"
6#include "jukebox.h"
7#include "jukebox_actions.h"
9#include "legoinputmanager.h"
10#include "legomain.h"
11#include "legoutils.h"
12#include "misc.h"
15#include "mxmisc.h"
17#include "mxstillpresenter.h"
18#include "mxticklemanager.h"
19#include "mxtimer.h"
20#include "mxtransitionmanager.h"
21#include "scripts.h"
22
25
26// GLOBAL: LEGO1 0x100f7918
28
29// GLOBAL: LEGO1 0x100f791c
31
32// GLOBAL: LEGO1 0x100f7920
34
35// FUNCTION: LEGO1 0x100745e0
37{
38 m_currentActorId = LegoActor::c_none;
39 m_unk0x100 = 0;
40 m_hospitalState = NULL;
41 m_unk0x108 = 0;
42 m_destLocation = LegoGameState::e_undefined;
43 m_currentAction = HospitalScript::c__StartUp;
44 m_copLedBitmap = NULL;
45 m_pizzaLedBitmap = NULL;
46 m_unk0x118 = 0;
47 m_copLedAnimTimer = 0;
48 m_pizzaLedAnimTimer = 0;
49 m_unk0x128 = 0;
51}
52
53// FUNCTION: LEGO1 0x100747f0
55{
56 InputManager()->UnRegister(this);
57 if (InputManager()->GetWorld() == this) {
59 }
60
63
64 m_hospitalState->m_unk0x08 = 3;
65
68}
69
70// FUNCTION: LEGO1 0x100748c0
72{
73 MxResult result = LegoWorld::Create(p_dsAction);
74 if (result == SUCCESS) {
75 InputManager()->SetWorld(this);
76 ControlManager()->Register(this);
77 }
78
80
81 m_hospitalState = (HospitalState*) GameState()->GetState("HospitalState");
82 if (!m_hospitalState) {
83 m_hospitalState = (HospitalState*) GameState()->CreateState("HospitalState");
84 m_hospitalState->m_unk0x08 = 1;
85 }
86 else if (m_hospitalState->m_unk0x08 == 4) {
87 m_hospitalState->m_unk0x08 = 4;
88 }
89 else {
90 m_hospitalState->m_unk0x08 = 3;
91 }
92
95
96 InputManager()->Register(this);
98
99 return result;
100}
101
102// FUNCTION: LEGO1 0x10074990
103// FUNCTION: BETA10 0x1002ca3b
105{
106 MxLong result = 0;
107 MxNotificationParam& param = (MxNotificationParam&) p_param;
108 LegoWorld::Notify(p_param);
109
110 if (m_worldStarted) {
111 switch (param.GetNotification()) {
113 result = HandleEndAction((MxEndActionNotificationParam&) p_param);
114 break;
116 result = HandleKeyPress((((LegoEventNotificationParam&) p_param)).GetKey());
117 break;
119 result = HandleButtonDown(((LegoControlManagerNotificationParam&) p_param));
120 break;
122 result = HandleControl((LegoControlManagerNotificationParam&) p_param);
123 break;
125 if (m_destLocation != LegoGameState::e_undefined) {
126 GameState()->SwitchArea(m_destLocation);
127 }
128 break;
129 }
130 }
131
132 return result;
133}
134
135// FUNCTION: LEGO1 0x10074a60
137{
139
140 m_copLedBitmap = (MxStillPresenter*) Find("MxStillPresenter", "CopLed_Bitmap");
141 m_pizzaLedBitmap = (MxStillPresenter*) Find("MxStillPresenter", "PizzaLed_Bitmap");
142
143 if (UserActor() == NULL) {
144 m_currentActorId = LegoActor::c_laura;
145 }
146 else {
147 m_currentActorId = UserActor()->GetActorId();
148 }
149
150 switch (m_currentActorId) {
152 m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x0e;
153
154 if (m_hospitalState->m_unk0x0e < 5) {
155 m_hospitalState->m_unk0x0e += 1;
156 }
157
158 break;
160 m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x10;
161
162 if (m_hospitalState->m_unk0x10 < 5) {
163 m_hospitalState->m_unk0x10 += 1;
164 }
165
166 break;
168 m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x12;
169
170 if (m_hospitalState->m_unk0x12 < 5) {
171 m_hospitalState->m_unk0x12 += 1;
172 }
173
174 break;
176 m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x14;
177
178 if (m_hospitalState->m_unk0x14 < 5) {
179 m_hospitalState->m_unk0x14 += 1;
180 }
181
182 break;
184 m_hospitalState->m_unk0x0c = m_hospitalState->m_unk0x16;
185
186 if (m_hospitalState->m_unk0x16 < 5) {
187 m_hospitalState->m_unk0x16 += 1;
188 }
189
190 break;
191 }
192
193 if (m_hospitalState->m_unk0x0c < 3) {
194 HospitalScript::Script hospitalScript[] = {
198 };
199
200 m_hospitalState->m_unk0x08 = 5;
201
202 PlayAction(hospitalScript[m_hospitalState->m_unk0x0c]);
203 m_currentAction = hospitalScript[m_hospitalState->m_unk0x0c];
204 m_unk0x108 = 1;
205 }
206 else {
207 m_unk0x100 = 1;
208 m_time = Timer()->GetTime();
209
210 m_hospitalState->m_unk0x08 = 6;
211
213 m_currentAction = HospitalScript::c_hho003cl_RunAnim;
214 m_unk0x108 = 1;
215 }
216
218}
219
220// FUNCTION: LEGO1 0x10074dd0
221MxLong Hospital::HandleKeyPress(MxS8 p_key)
222{
223 MxLong result = 0;
224
225 if (p_key == VK_SPACE && g_unk0x100f7918 == 0) {
227 result = 1;
228 }
229
230 return result;
231}
232
233// FUNCTION: LEGO1 0x10074e00
234MxLong Hospital::HandleEndAction(MxEndActionNotificationParam& p_param)
235{
236 MxLong result = 0;
237 MxDSAction* action = p_param.GetAction();
238 Act1State* act1State;
239
240 if (action->GetAtomId() != m_atomId) {
241 return result;
242 }
243
244 m_unk0x108 = 0;
245
246 switch (m_hospitalState->m_unk0x08) {
247 case 5:
248 m_hospitalState->m_unk0x08 = 7;
250
251 m_currentAction = HospitalScript::c_hho006cl_RunAnim;
252 m_unk0x108 = 1;
253 m_unk0x118 = 1;
254 g_unk0x100f7918 = 0;
255 break;
256 case 6:
257 m_time = Timer()->GetTime();
258 m_unk0x100 = 1;
259 break;
260 case 7:
261 case 10:
262 m_hospitalState->m_unk0x08 = 8;
263 m_unk0x100 = 1;
264 m_time = Timer()->GetTime();
265 break;
266 case 11:
267 switch (m_currentActorId) {
269 switch (m_hospitalState->m_unk0x0e) {
270 case 0:
271 case 1:
272 m_hospitalState->m_unk0x08 = 12;
274
275 m_currentAction = HospitalScript::c_hho017cl_RunAnim;
276 m_unk0x108 = 1;
277 break;
278 default:
279 m_hospitalState->m_unk0x08 = 12;
281
282 m_currentAction = HospitalScript::c_hho018cl_RunAnim;
283 m_unk0x108 = 1;
284 break;
285 }
286 break;
288 switch (m_hospitalState->m_unk0x10) {
289 case 0:
290 case 1:
291 m_hospitalState->m_unk0x08 = 12;
293
294 m_currentAction = HospitalScript::c_hho019cl_RunAnim;
295 m_unk0x108 = 1;
296 break;
297 default:
298 m_hospitalState->m_unk0x08 = 12;
300
301 m_currentAction = HospitalScript::c_hho020cl_RunAnim;
302 m_unk0x108 = 1;
303 break;
304 }
305 break;
307 switch (m_hospitalState->m_unk0x12) {
308 case 0:
309 case 1:
310 m_hospitalState->m_unk0x08 = 12;
312
313 m_currentAction = HospitalScript::c_hho023cl_RunAnim;
314 m_unk0x108 = 1;
315 break;
316 default:
317 m_hospitalState->m_unk0x08 = 12;
319
320 m_currentAction = HospitalScript::c_hho024cl_RunAnim;
321 m_unk0x108 = 1;
322 break;
323 }
324 break;
326 switch (m_hospitalState->m_unk0x14) {
327 case 0:
328 case 1:
329 m_hospitalState->m_unk0x08 = 12;
331
332 m_currentAction = HospitalScript::c_hho021cl_RunAnim;
333 m_unk0x108 = 1;
334 break;
335 default:
336 m_hospitalState->m_unk0x08 = 12;
338
339 m_currentAction = HospitalScript::c_hhoa22cl_RunAnim;
340 m_unk0x108 = 1;
341 break;
342 }
343 break;
345 switch (m_hospitalState->m_unk0x16) {
346 case 0:
347 case 1:
348 m_hospitalState->m_unk0x08 = 12;
350
351 m_currentAction = HospitalScript::c_hho025cl_RunAnim;
352 m_unk0x108 = 1;
353 break;
354 default:
355 m_hospitalState->m_unk0x08 = 12;
357
358 m_currentAction = HospitalScript::c_hho026cl_RunAnim;
359 m_unk0x108 = 1;
360 break;
361 }
362 break;
363 }
364 break;
365 case 12:
366 m_hospitalState->m_unk0x08 = 9;
367 act1State = (Act1State*) GameState()->GetState("Act1State");
368 act1State->SetUnknown18(9);
369 case 14:
370 if (m_unk0x128 == 0) {
371 m_unk0x128 = 1;
372 m_destLocation = LegoGameState::e_unk31;
373
376 }
377 break;
378 case 15:
379 if (m_unk0x128 == 0) {
380 m_unk0x128 = 1;
381 m_destLocation = LegoGameState::e_infomain;
382
385 }
386 break;
387 }
388
389 result = 1;
390
391 return result;
392}
393
394// FUNCTION: LEGO1 0x10075710
395// FUNCTION: BETA10 0x1002d2b1
396MxLong Hospital::HandleButtonDown(LegoControlManagerNotificationParam& p_param)
397{
398 if (m_unk0x100 == 1) {
399 LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
400 if (roi != NULL) {
401 const LegoChar* roiName = roi->GetName();
402
403 if (roiName[0] == '*') {
404 roiName += 1;
405 }
406
407 if (!strcmpi("actor_ha", roiName)) {
409
410 m_unk0x100 = 3;
411
412 if (m_hospitalState->m_unk0x08 == 6) {
413 if (m_unk0x128 == 0) {
414 m_unk0x128 = 1;
415
417
418 m_hospitalState->m_unk0x08 = 9;
419 Act1State* act1State = (Act1State*) GameState()->GetState("Act1State");
420 assert(act1State);
421
422 act1State->m_unk0x018 = 9;
423
424 m_destLocation = LegoGameState::e_unk31;
426 &m_atomId,
429 );
431 }
432 }
433 else if (m_hospitalState->m_unk0x08 == 10 || m_hospitalState->m_unk0x08 == 8) {
434 if (m_hospitalState->m_unk0x08 == 10) {
435 m_hospitalState->m_unk0x08 = 11;
436
439 &m_atomId,
442 );
443 }
444 else {
445 switch (m_currentActorId) {
447 switch (m_hospitalState->m_unk0x0e) {
448 case 0:
449 case 1:
450 m_hospitalState->m_unk0x08 = 12;
452
453 m_currentAction = HospitalScript::c_hho017cl_RunAnim;
454 m_unk0x108 = 1;
455 break;
456 default:
457 m_hospitalState->m_unk0x08 = 12;
459
460 m_currentAction = HospitalScript::c_hho018cl_RunAnim;
461 m_unk0x108 = 1;
462 break;
463 }
464 break;
466 switch (m_hospitalState->m_unk0x10) {
467 case 0:
468 case 1:
469 m_hospitalState->m_unk0x08 = 12;
471
472 m_currentAction = HospitalScript::c_hho019cl_RunAnim;
473 m_unk0x108 = 1;
474 break;
475 default:
476 m_hospitalState->m_unk0x08 = 12;
478
479 m_currentAction = HospitalScript::c_hho020cl_RunAnim;
480 m_unk0x108 = 1;
481 break;
482 }
483 break;
485 switch (m_hospitalState->m_unk0x14) {
486 case 0:
487 case 1:
488 m_hospitalState->m_unk0x08 = 12;
490
491 m_currentAction = HospitalScript::c_hho021cl_RunAnim;
492 m_unk0x108 = 1;
493 break;
494 default:
495 m_hospitalState->m_unk0x08 = 12;
497
498 m_currentAction = HospitalScript::c_hhoa22cl_RunAnim;
499 m_unk0x108 = 1;
500 break;
501 }
502 break;
504 switch (m_hospitalState->m_unk0x12) {
505 case 0:
506 case 1:
507 m_hospitalState->m_unk0x08 = 12;
509
510 m_currentAction = HospitalScript::c_hho023cl_RunAnim;
511 m_unk0x108 = 1;
512 break;
513 default:
514 m_hospitalState->m_unk0x08 = 12;
516
517 m_currentAction = HospitalScript::c_hho024cl_RunAnim;
518 m_unk0x108 = 1;
519 break;
520 }
521 break;
523 switch (m_hospitalState->m_unk0x16) {
524 case 0:
525 case 1:
526 m_hospitalState->m_unk0x08 = 12;
528
529 m_currentAction = HospitalScript::c_hho025cl_RunAnim;
530 m_unk0x108 = 1;
531 break;
532 default:
533 m_hospitalState->m_unk0x08 = 12;
535
536 m_currentAction = HospitalScript::c_hho026cl_RunAnim;
537 m_unk0x108 = 1;
538 break;
539 }
540 break;
541 }
542 }
543 }
544
545 return 1;
546 }
547 }
548 }
549
550 return 0;
551}
552
553// FUNCTION: LEGO1 0x10075f90
554MxBool Hospital::HandleControl(LegoControlManagerNotificationParam& p_param)
555{
556 if (p_param.m_unk0x28 == 1) {
557 switch (p_param.m_clickedObjectId) {
561
562 if (m_unk0x100 == 1) {
563 m_hospitalState->m_unk0x08 = 14;
564
566 m_currentAction = HospitalScript::c_hho016cl_RunAnim;
567 m_unk0x108 = 1;
568 }
569 else if (m_unk0x128 == 0) {
570 m_unk0x128 = 1;
571 m_hospitalState->m_unk0x08 = 13;
572 m_destLocation = LegoGameState::e_infomain;
573
576 }
577
578 break;
579
582
583 if (m_unk0x100 == 1) {
584 m_hospitalState->m_unk0x08 = 15;
585
587 m_currentAction = HospitalScript::c_hho016cl_RunAnim;
588 m_unk0x108 = 1;
589 }
590 else if (m_unk0x128 == 0) {
591 m_unk0x128 = 1;
592 m_hospitalState->m_unk0x08 = 13;
593 m_destLocation = LegoGameState::e_unk31;
594
597 }
598
599 break;
600 }
601 }
602
603 return TRUE;
604}
605
606// FUNCTION: LEGO1 0x10076220
608{
609 LegoWorld::Enable(p_enable);
610
611 if (p_enable) {
612 InputManager()->SetWorld(this);
614 }
615 else {
616 if (InputManager()->GetWorld() == this) {
618 }
619 }
620}
621
622inline void Hospital::PlayAction(MxU32 p_objectId)
623{
624 MxDSAction action;
626 action.SetObjectId(p_objectId);
627
629 Start(&action);
630}
631
632// FUNCTION: LEGO1 0x10076270
634{
635 if (!m_worldStarted) {
637 return SUCCESS;
638 }
639
640 if (g_unk0x100f7918 != 0) {
641 g_unk0x100f7918 -= 1;
642 }
643
644 MxLong time = Timer()->GetTime();
645
646 if (m_unk0x118 != 0) {
647 if (time - m_copLedAnimTimer > 300) {
648 m_copLedAnimTimer = time;
650 m_copLedBitmap->Enable(g_copLedEnabled);
651 }
652
653 if (time - m_pizzaLedAnimTimer > 200) {
654 m_pizzaLedAnimTimer = time;
656 m_pizzaLedBitmap->Enable(g_pizzaLedEnabled);
657 }
658 }
659
660 return SUCCESS;
661}
662
663// FUNCTION: LEGO1 0x10076330
665{
667 m_hospitalState->m_unk0x08 = 0;
668
669 m_destLocation = LegoGameState::e_infomain;
670
671 return TRUE;
672}
673
674// FUNCTION: LEGO1 0x10076370
676{
677 m_unk0x0c = 0;
678 m_unk0x0e = 0;
679 m_unk0x10 = 0;
680 m_unk0x12 = 0;
681 m_unk0x14 = 0;
682 m_unk0x16 = 0;
683}
684
685// FUNCTION: LEGO1 0x10076530
686// FUNCTION: BETA10 0x1002db26
688{
689 LegoState::Serialize(p_storage);
690
691 if (p_storage->IsWriteMode()) {
692 p_storage->WriteS16(m_unk0x0c);
693 p_storage->WriteS16(m_unk0x0e);
694 p_storage->WriteS16(m_unk0x10);
695 p_storage->WriteS16(m_unk0x12);
696 p_storage->WriteS16(m_unk0x14);
697 p_storage->WriteS16(m_unk0x16);
698 }
699 else if (p_storage->IsReadMode()) {
700 p_storage->ReadS16(m_unk0x0c);
701 p_storage->ReadS16(m_unk0x0e);
702 p_storage->ReadS16(m_unk0x10);
703 p_storage->ReadS16(m_unk0x12);
704 p_storage->ReadS16(m_unk0x14);
705 p_storage->ReadS16(m_unk0x16);
706 }
707
708 return SUCCESS;
709}
[AI] Holds state and transient gameplay data for the first act on Lego Island.
Definition: isle.h:29
void SetUnknown18(MxU32 p_unk0x18)
[AI] Sets the gameplay progress variable at 0x018 (controls state transitions, gameplay mode changes,...
Definition: isle.h:77
MxU32 m_unk0x018
[AI] Internal gameplay state variable; see Get/SetUnknown18 for usage. [AI]
Definition: isle.h:92
[AI] State-holding class for the hospital area; persists area-specific progress and variables between...
Definition: hospital.h:21
MxS16 m_unk0x0c
[AI] General area progress/counter for current actor (mirrors one of the counters below depending on ...
Definition: hospital.h:75
MxS16 m_unk0x16
[AI] Progress counter for LAURA character's hospital actions or visit.
Definition: hospital.h:100
MxS16 m_unk0x12
[AI] Progress counter for PAPA character's hospital actions or visit.
Definition: hospital.h:90
MxS16 m_unk0x14
[AI] Progress counter for NICK character's hospital actions or visit.
Definition: hospital.h:95
MxS16 m_unk0x0e
[AI] Progress counter for PEPPER character's hospital actions or visit.
Definition: hospital.h:80
MxResult Serialize(LegoStorage *p_storage) override
[AI] (De)serializes this state to or from the provided LegoStorage handler.
Definition: hospital.cpp:687
undefined4 m_unk0x08
[AI] State machine/counter variable determining narrative step or branch.
Definition: hospital.h:69
HospitalState()
[AI] Constructs a new HospitalState object and initializes all progression counters to zero.
Definition: hospital.cpp:675
MxS16 m_unk0x10
[AI] Progress counter for MAMA character's hospital actions or visit.
Definition: hospital.h:85
[AI] Implements the main 3D area and logic flow for the Hospital location/scene in LEGO Island.
Definition: hospital.h:111
MxResult Create(MxDSAction &p_dsAction) override
[AI] Loads/sets up this world using the provided data-driven action.
Definition: hospital.cpp:71
MxLong Notify(MxParam &p_param) override
[AI] Receives notifications (such as keypresses, control input, and completion of scripted actions) a...
Definition: hospital.cpp:104
MxResult Tickle() override
[AI] Advances the hospital's world logic per tick; animates cop/pizza LED icons, handles script step ...
Definition: hospital.cpp:633
MxBool Escape() override
[AI] Cleans up objects and switches the main menu or outside area, if requested; used for ESC or Info...
Definition: hospital.cpp:664
void Enable(MxBool p_enable) override
[AI] Enables or disables the hospital world; hooks/unhooks input, marks world active state.
Definition: hospital.cpp:607
void PlayAction(MxU32 p_objectId)
[AI] Triggers a new MxDSAction for the specified script object (e.g.
Definition: hospital.cpp:622
~Hospital() override
[AI] Tears down Hospital world handlers, unregisters from input/notification/tickle systems and reset...
Definition: hospital.cpp:54
void ReadyWorld() override
[AI] Initializes the hospital gameplay; loads area animations, resets scores/progress for the current...
Definition: hospital.cpp:136
@ 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_none
No actor ([AI])
Definition: legoactor.h:16
@ 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
[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 class for LEGO event notifications such as mouse events and modifier keys.
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.
void SwitchArea(Area p_area)
Switches the whole game state into a new area/world; manages transitions/scene loads.
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 StopArea(Area p_area)
Calls cleanup logic for the specified area (removes actors, VMs, closes handles, etc....
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_previousArea
Alias: go to previous area. [AI].
Definition: legogamestate.h:94
@ e_unk31
Unknown [AI].
@ e_undefined
Undefined or unset area. [AI].
Definition: legogamestate.h:93
@ e_hospital
Hospital interior. [AI].
void UnRegister(MxCore *)
[AI] Unregister a previously registered recipient so it will no longer receive input notifications.
void ClearWorld()
[AI] Remove any world assignment (used to clear targeting/scene changes). [AI]
void SetWorld(LegoWorld *p_world)
[AI] Assigns the current world to receive mouse/click/pick notifications.
void Register(MxCore *)
[AI] Register a core object as a recipient for keyboard events; safe for concurrent multi-threading.
void DisableInputProcessing()
[AI] Block most input processing, allowing only button-down and space events (UI modal input blocking...
@ c_clearScreen
[AI] When set, clears the display surface. [AI]
Definition: legomain.h:49
@ c_disable3d
[AI] When set, disables 3D rendering. [AI]
Definition: legomain.h:48
@ c_disableInput
[AI] When set, disables input processing. [AI]
Definition: legomain.h:47
[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
virtual MxResult Serialize(LegoStorage *p_storage)
[AI] Serialize state to a storage (for save/load).
Definition: legostate.h:141
Abstract base class providing an interface for file-like storage with binary and text read/write oper...
Definition: legostorage.h:16
virtual LegoBool IsWriteMode()
Returns TRUE if object was opened in write mode.
Definition: legostorage.h:72
LegoStorage * WriteS16(LegoS16 p_data)
Writes a 16-bit signed value to storage.
Definition: legostorage.h:110
LegoStorage * ReadS16(LegoS16 &p_data)
Reads a 16-bit signed value from storage.
Definition: legostorage.h:217
virtual LegoBool IsReadMode()
Returns TRUE if object was opened in read mode.
Definition: legostorage.h:78
virtual void Enable(MxBool p_enable)
Enables or disables (pauses) the world and its main components.
Definition: legoworld.cpp:684
MxResult Tickle() override
Main world tick/update, especially manages startup countdown.
Definition: legoworld.cpp:810
MxBool m_worldStarted
Indicates if the world has successfully started and is considered active.
Definition: legoworld.h:388
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
MxLong Notify(MxParam &p_param) override
Notification callback responding to registered events such as EndAction and NewPresenter.
Definition: legoworld.cpp:212
MxResult Create(MxDSAction &p_dsAction) override
Initializes the world using an action, creating entity and sound lists, and camera controller.
Definition: legoworld.cpp:58
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
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
Definition: mxdsobject.h:133
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
Definition: mxdsobject.h:118
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
Definition: mxdsobject.h:147
[AI] Notification parameter marking the end of an action, specialization of MxActionNotificationParam...
MxAtomId m_atomId
The AtomId associated with this entity, used for resource and script identification.
Definition: mxentity.h:124
void Unregister(MxCore *p_listener)
[AI] Removes a previously registered listener and flushes any pending notifications for it.
void Register(MxCore *p_listener)
[AI] Registers a listener object to receive notifications.
[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] Presenter for single still image/bitmap media sources in the game.
void Enable(MxBool p_enable) override
[AI] Sets the enabled/disabled state of the presenter, updating the video manager's rendering as need...
virtual void UnregisterClient(MxCore *p_client)
[AI] Unregisters (marks for destruction) a previously registered client.
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.
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
unsigned int undefined4
Definition: decomp.h:28
MxBool g_copLedEnabled
Definition: hospital.cpp:30
MxBool g_pizzaLedEnabled
Definition: hospital.cpp:33
undefined4 g_unk0x100f7918
Definition: hospital.cpp:27
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
char LegoChar
[AI] Alias for char, for use in character/byte data and string handling.
Definition: legotypes.h:83
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
void EnableAnimations(MxBool p_enable)
[AI] Enables or disables animation playback globally.
Definition: legoutils.cpp:554
LegoROI * PickROI(MxLong p_x, MxLong p_y)
[AI] Picks the ROI (Renderable Object Instance) at screen coordinates.
Definition: legoutils.cpp:39
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
Definition: misc.cpp:61
void DeleteObjects(MxAtomId *p_id, MxS32 p_first, MxS32 p_last)
[AI] Batch deletes objects, given by atom id, and within the entity id range [p_first,...
Definition: misc.cpp:237
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
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
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
void SetIsWorldActive(MxBool p_isWorldActive)
[AI] Toggles whether the world should be considered active (enables/disables camera/user control etc)...
Definition: misc.cpp:228
LegoInputManager * InputManager()
[AI] Accessor for the input manager, which handles keyboard, mouse, and controller input....
Definition: misc.cpp:45
MxTimer * Timer()
[AI] Returns the global simulation timer.
Definition: mxmisc.cpp:33
MxResult Start(MxDSAction *p_dsAction)
[AI] Schedules and initiates execution of a script action.
Definition: mxmisc.cpp:97
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
Definition: mxmisc.cpp:17
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_notificationKeyPress
[AI] Keyboard key press detected [AI]
@ c_notificationTransitioned
[AI] Object has transitioned states or locations [AI]
@ c_notificationEndAction
[AI] Indicates the end of an action [AI]
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
signed char MxS8
[AI]
Definition: mxtypes.h:14
@ c_Hospital_Music
[AI] Background music for the hospital.
[AI] Contains global script AtomId pointers and utility functions for managing script AtomIds in LEGO...
MxAtomId * g_hospitalScript
[AI] Script AtomId for the hospital SI logic.
Definition: scripts.cpp:54