Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
rooms.c
Go to the documentation of this file.
1#include "common.h"
2#include "model.h"
3
4void func_800EF414(s32, s32);
5void get_flat_collider_normal(s32, f32*, f32*, f32*);
8
11
17
18typedef struct MapRoom {
19 /* 0x00 */ RoomState state;
20 /* 0x04 */ s32 flags;
21 /* 0x08 */ s16 newItemVisGroup;
22 /* 0x0A */ s16 prevItemVisGroup;
23 /* 0x0C */ VecXZf posEnterA;
24 /* 0x14 */ VecXZf posEnterB;
25 /* 0x1C */ VecXZf posExitA;
26 /* 0x24 */ VecXZf posExitB;
31 /* 0x3C */ s32 modelID;
32 /* 0x40 */ s32 bgColor[3];
33 /* 0x4C */ s32 scriptIDs[4];
34 /* 0x5C */ s32* npcList;
35 /* 0x60 */ s32 colliderID;
36} MapRoom; // size = 0x64
37
38// data fetched with GetDoorData is stored in these local vars
39enum {
54};
55
56enum {
61};
62
63enum {
66};
67
68API_CALLABLE(MovePartnerThroughDoor) {
69 Bytecode* args = script->ptrReadPos;
70 s32 posX = evt_get_variable(script, *args++);
71 s32 posZ = evt_get_variable(script, *args++);
72
73 func_800EF414(posX, posZ);
75 return ApiStatus_DONE2;
76}
77
78API_CALLABLE(ResetPartnerMovement) {
81 return ApiStatus_DONE2;
82}
83
84/* ARGS:
85 s32 packed flags and itemVisGroup via PACK_ROOM_FLAGS()
86 EvtScript* openDoor
87 EvtScript* moveWalls
88 EvtScript* dropDoor
89 EvtScript* stateListener
90 s32 doorInColliderID
91 s32 doorOutColliderID
92 s32 interiorModelGroup
93 s32* interiorNPCs
94*/
95API_CALLABLE(CreateMapRoom) {
96 Bytecode* args = script->ptrReadPos;
97 MapRoom* room = heap_malloc(sizeof(*room));
98 EvtScript* openDoorScript;
99 EvtScript* moveWallsScript;
100 EvtScript* dropDoorScript;
101 EvtScript* stateListenerScript;
102 s32 colliderID;
103 s32 triggerColliderID;
104 s32 roomFlags;
105 f32 centerX, centerZ;
106 f32 nX, nZ;
107 f32 tempY;
108
109 room->state = ROOM_STATE_IDLE;
110 roomFlags = evt_get_variable(script, *args++);
111 room->flags = roomFlags & (ROOM_FLAGS_MASK | ROOM_FLAGS_DOOR_TYPE_MASK);
112 room->newItemVisGroup = (roomFlags & ROOM_FLAGS_VISGROUP_MASK) >> 0xC;
114 openDoorScript = (EvtScript*) evt_get_variable(script, *args++);
115 moveWallsScript = (EvtScript*) evt_get_variable(script, *args++);
116 dropDoorScript = (EvtScript*) evt_get_variable(script, *args++);
117 stateListenerScript = (EvtScript*) evt_get_variable(script, *args++);
118 room->colliderID = colliderID = evt_get_variable(script, *args++);
119 triggerColliderID = evt_get_variable(script, *args++);
120 room->modelID = evt_get_variable(script, *args++);
121 room->npcList = (s32*) evt_get_variable(script, *args++);
122 if (dropDoorScript != NULL) {
123 roomFlags |= ROOM_FLAG_EXIT_DOOR_DROPS;
124 room->flags = roomFlags;
125 }
126 get_collider_center(colliderID, &centerX, &tempY, &centerZ);
127 get_flat_collider_normal(colliderID, &nX, &tempY, &nZ);
128
129 switch (roomFlags & ROOM_FLAGS_DOOR_TYPE_MASK) {
131 room->posEnterA.x = centerX + (nX * 30.0f) - (nZ * 20.0f);
132 room->posEnterA.z = centerZ + (nZ * 30.0f) + (nX * 20.0f);
133 room->posEnterB.x = centerX - (nX * 30.0f);
134 room->posEnterB.z = centerZ - (nZ * 30.0f);
135 break;
137 room->posEnterA.x = centerX + (nX * 60.0f) - (nZ * 20.0f);
138 room->posEnterA.z = centerZ + (nZ * 60.0f) + (nX * 20.0f);
139 room->posEnterB.x = centerX - (nX * 30.0f);
140 room->posEnterB.z = centerZ - (nZ * 30.0f);
141 break;
143 room->posEnterA.x = centerX + (nX * 30.0f);
144 room->posEnterA.z = centerZ + (nZ * 30.0f);
145 room->posEnterB.x = centerX - (nX * 30.0f) - (nZ * 20.0f);
146 room->posEnterB.z = centerZ - (nZ * 30.0f) - (nX * 20.0f);
147 break;
149 room->posEnterA.x = centerX + (nX * 30.0f);
150 room->posEnterA.z = centerZ + (nZ * 30.0f);
151 room->posEnterB.x = centerX - (nX * 60.0f) - (nZ * 20.0f);
152 room->posEnterB.z = centerZ - (nZ * 60.0f) - (nX * 20.0f);
153 break;
155 room->posEnterA.x = centerX + (nX * 30.0f) + (nZ * 20.0f);
156 room->posEnterA.z = centerZ + (nZ * 30.0f) - (nX * 20.0f);
157 room->posEnterB.x = centerX - (nX * 30.0f);
158 room->posEnterB.z = centerZ - (nZ * 30.0f);
159 break;
161 room->posEnterA.x = centerX + (nX * 60.0f) + (nZ * 20.0f);
162 room->posEnterA.z = centerZ + (nZ * 60.0f) - (nX * 20.0f);
163 room->posEnterB.x = centerX - (nX * 30.0f);
164 room->posEnterB.z = centerZ - (nZ * 30.0f);
165 break;
167 room->posEnterA.x = centerX + (nX * 30.0f);
168 room->posEnterA.z = centerZ + (nZ * 30.0f);
169 room->posEnterB.x = centerX - (nX * 30.0f) + (nZ * 20.0f);
170 room->posEnterB.z = centerZ - (nZ * 30.0f) + (nX * 20.0f);
171 break;
173 room->posEnterA.x = centerX + (nX * 30.0f);
174 room->posEnterA.z = centerZ + (nZ * 30.0f);
175 room->posEnterB.x = centerX - (nX * 30.0f);
176 room->posEnterB.z = centerZ - (nZ * 30.0f);
177 break;
178 }
179 room->overrideOpenDoor = openDoorScript;
180 room->overrideMoveWall = moveWallsScript;
181 room->overrideDropDoor = dropDoorScript;
182 room->stateListenerScript = stateListenerScript;
183
184 room->posExitA.x = room->posEnterB.x;
185 room->posExitA.z = room->posEnterB.z;
186 room->posExitB.x = room->posEnterA.x;
187 room->posExitB.z = room->posEnterA.z;
188
189 room->bgColor[0] = gCameras[CAM_DEFAULT].bgColor[0];
190 room->bgColor[1] = gCameras[CAM_DEFAULT].bgColor[1];
191 room->bgColor[2] = gCameras[CAM_DEFAULT].bgColor[2];
192
193 bind_trigger_1(&EVS_EnterRoomDoor, TRIGGER_WALL_PRESS_A, colliderID, 0, (s32) room, 3);
194 if (roomFlags & ROOM_FLAG_EXIT_DOOR_DROPS) {
195 bind_trigger_1(&EVS_ExitRoomDoor, TRIGGER_WALL_PUSH, triggerColliderID, 1, (s32) room, 3);
196 } else {
197 bind_trigger_1(&EVS_ExitRoomDoor, TRIGGER_WALL_PRESS_A, triggerColliderID, 1, (s32) room, 3);
198 }
199 return ApiStatus_DONE2;
200}
201
202API_CALLABLE(PlayRoomDoorSound) {
203 Bytecode* args = script->ptrReadPos;
204 MapRoom* door = script->functionTempPtr[1];
205 s32 sound = evt_get_variable(script, *args++);
206 f32 posX, posY, posZ;
207
208 get_collider_center(door->colliderID, &posX, &posY, &posZ);
209 sfx_play_sound_at_position(sound, 0, posX, posY, posZ);
210 return ApiStatus_DONE2;
211}
212
213API_CALLABLE(SaveDoorPtr) {
214 script->functionTemp[1] = script->varTable[1];
215 return ApiStatus_DONE2;
216}
217
218API_CALLABLE(GetDoorState) {
219 MapRoom* door = script->functionTempPtr[1];
220
221 script->varTable[0] = door->state;
222 return ApiStatus_DONE2;
223}
224
225API_CALLABLE(SetDoorState) {
226 MapRoom* door = script->functionTempPtr[1];
227
228 door->state = evt_get_variable(script, *script->ptrReadPos);
229 return ApiStatus_DONE2;
230}
231
232API_CALLABLE(AwaitUseDoorScript) {
233 Bytecode* args = script->ptrReadPos;
234 MapRoom* door = script->functionTempPtr[1];
235 s32 index = evt_get_variable(script, *args++);
236
237 if (does_script_exist(door->scriptIDs[index])) {
238 return ApiStatus_BLOCK;
239 } else {
240 return ApiStatus_DONE2;
241 }
242}
243
244API_CALLABLE(SaveUseDoorScript) {
245 Bytecode* args = script->ptrReadPos;
246 MapRoom* door = script->functionTempPtr[1];
247 s32 index = evt_get_variable(script, *args++);
248 s32 scriptID = evt_get_variable(script, *args++);
249
250 door->scriptIDs[index] = scriptID;
251 return ApiStatus_DONE2;
252}
253
254API_CALLABLE(RoomVisibilityToggleImpl) {
255 MapRoom* door = script->varTablePtr[1];
256 s32 alpha, r, g, b;
257
258 if (isInitialCall) {
259 if (script->varTable[0] == ROOM_VISIBILITY_SHOW) {
260 mdl_group_set_custom_gfx(script->varTable[15], CUSTOM_GFX_NONE, ENV_TINT_SHROUD, TRUE);
261 }
262 script->functionTemp[1] = 0;
263 }
264 script->functionTemp[1] += 32;
265 if (script->functionTemp[1] > 255) {
266 script->functionTemp[1] = 255;
267 }
268 if (script->varTable[0] == ROOM_VISIBILITY_SHOW) {
269 alpha = script->functionTemp[1];
270 } else {
271 alpha = 255 - script->functionTemp[1];
272 }
273 mdl_set_shroud_tint_params(0, 0, 0, alpha);
274 r = door->bgColor[0] * (255 - alpha) / 255;
275 g = door->bgColor[1] * (255 - alpha) / 255;
276 b = door->bgColor[2] * (255 - alpha) / 255;
280
281 if (script->functionTemp[1] >= 255) {
282 if (script->varTable[0] == ROOM_VISIBILITY_HIDE) {
283 // ROOM_DATA_MODEL_ID
284 mdl_group_set_custom_gfx(script->varTable[15], CUSTOM_GFX_NONE, ENV_TINT_NONE, TRUE);
285 }
286 return ApiStatus_DONE2;
287 } else {
288 return ApiStatus_BLOCK;
289 }
290}
291
292// saves the previous value, call again with a negative value to restore it
293API_CALLABLE(SetRoomCamMoveSpeed) {
294 Bytecode* args = script->ptrReadPos;
295 f32 newMoveSpeed = evt_get_float_variable(script, *args++);
296 Camera* camera = &gCameras[CAM_DEFAULT];
297 static f32 savedCamMoveSpeed;
298
299 if (newMoveSpeed >= 0.0f) {
300 savedCamMoveSpeed = camera->moveSpeed;
301 camera->moveSpeed = newMoveSpeed;
302 } else {
303 camera->moveSpeed = savedCamMoveSpeed;
304 }
305
306 return ApiStatus_DONE2;
307}
308
309API_CALLABLE(SetEntityHideMode1) {
311 return ApiStatus_DONE2;
312}
313
314API_CALLABLE(SetEntityHideMode2) {
316 return ApiStatus_DONE2;
317}
318
319API_CALLABLE(SetEntityHideMode0) {
321 return ApiStatus_DONE2;
322}
323
324API_CALLABLE(HideRoomNPCs) {
325 MapRoom* door = script->functionTempPtr[1];
326 s32* npcList = door->npcList;
327 s32 endOfList;
328 s32 mask;
329 s32 i;
330
331 if (npcList == NULL) {
332 return ApiStatus_DONE2;
333 }
334
335 for (i = 0; i < MAX_NPCS; i++) {
336 Npc* npc = get_npc_by_index(i);
337 if (npc != NULL) {
338 if ((npc->flags != 0) && (npc->npcID != NPC_PARTNER)) {
339 npc->flags |= NPC_FLAG_HIDING;
340 }
341 }
342 }
343
344 endOfList = -1;
345 mask = ~NPC_FLAG_HIDING;
346
347 do {
348 Npc* npc;
349 if (*npcList == endOfList) {
350 return ApiStatus_DONE2;
351 }
352 npc = get_npc_safe(*npcList++);
353 if (npc != NULL) {
354 npc->flags &= mask;
355 }
356 } while (TRUE);
357
358 return ApiStatus_DONE2;
359}
360
361API_CALLABLE(RevealHiddenRoomNPCs) {
362 MapRoom* door = script->functionTempPtr[1];
363 s32 i;
364
365 if (door->npcList == NULL) {
366 return ApiStatus_DONE2;
367 }
368
369 for (i = 0; i < MAX_NPCS; i++) {
370 Npc* npc = get_npc_by_index(i);
371 if (npc != NULL) {
372 if (npc->flags != 0) {
373 npc->flags &= ~NPC_FLAG_HIDING;
374 }
375 }
376 }
377
378 return ApiStatus_DONE2;
379}
380
381API_CALLABLE(UseRoomItemVisGroup) {
382 MapRoom* door = script->functionTempPtr[1];
383
386 return ApiStatus_DONE2;
387}
388
389API_CALLABLE(RestorePrevItemVisGroup) {
390 MapRoom* door = script->functionTempPtr[1];
391
393 return ApiStatus_DONE2;
394}
395
396API_CALLABLE(GetDoorData) {
397 MapRoom* door = script->functionTempPtr[1];
398
399 script->varTable[2] = door->flags;
400 script->varTable[3] = door->posEnterA.x;
401 script->varTable[4] = door->posEnterA.z;
402 script->varTable[5] = door->posEnterB.x;
403 script->varTable[6] = door->posEnterB.z;
404 script->varTable[7] = door->posExitA.x;
405 script->varTable[8] = door->posExitA.z;
406 script->varTable[9] = door->posExitB.x;
407 script->varTable[10] = door->posExitB.z;
408 script->varTablePtr[11] = door->overrideOpenDoor;
409 script->varTablePtr[12] = door->overrideMoveWall;
410 script->varTablePtr[13] = door->overrideDropDoor;
411 script->varTablePtr[14] = door->stateListenerScript;
412 script->varTable[15] = door->modelID;
413 return ApiStatus_DONE2;
414}
415
416API_CALLABLE(GetDoorPtr) {
417 script->varTable[1] = script->functionTemp[1];
418 return ApiStatus_DONE2;
419}
420
422 Call(RoomVisibilityToggleImpl)
423 Return
424 End
425};
426
436
448
450 Call(SetRoomCamMoveSpeed, Float(1.796))
454 Set(LVarE, 10)
456 Call(SetRoomCamMoveSpeed, -1)
457 Return
458 End
459};
460
471
483
485 Call(SetRoomCamMoveSpeed, Float(1.796))
489 Set(LVarE, 10)
491 Call(SetRoomCamMoveSpeed, -1)
492 Return
493 End
494};
495
528
551
574
575// executed from trigger activatation with MapRoom* stored in LVar1
578 // ensure valid player action state
580 Set(LVar4, 0)
582 Add(LVar4, 1)
583 EndIf
585 Add(LVar4, 1)
586 EndIf
588 Add(LVar4, 1)
589 EndIf
590 IfEq(LVar4, 0)
591 Return
592 EndIf
593
594 // initialize
595 Call(SaveDoorPtr)
596 Call(GetDoorState)
598 Return
599 EndIf
600 Call(SetDoorState, ROOM_STATE_ENTERING)
601 Call(HideRoomNPCs)
602 Call(UseRoomItemVisGroup)
605
606 // notify listener ROOM_UPDATE_ENTER_BEGIN
607 Call(GetDoorData)
611 EndIf
613 Goto(1)
614 EndIf
615
616 // adjust camera to face door
617 Call(GetDoorData)
619
620 // move player to door
621 Call(GetDoorData)
623 Set(LVarE, 10)
632 Set(LVarE, 20)
635 Set(LVarE, 20)
638
639 // reveal room interior and hide world
640 Call(GetDoorData)
642 Call(GetDoorPtr)
645 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_0, LVar5)
646 EndIf
647 Call(SetEntityHideMode1)
649 Call(AwaitUseDoorScript, ROOM_SCRIPT_IDX_0)
650 EndIf
651
652 // wall movement animation
653 Call(GetDoorData)
659 Else
661 EndIf
662 EndIf
664 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_0, LVar5)
665 EndIf
666
667 // open the door
672 Else
674 EndIf
675 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_3, LVar5)
677 Call(AwaitUseDoorScript, ROOM_SCRIPT_IDX_3)
678
679 // move party through the doorway
680 Call(SetEntityHideMode2)
682 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_3, LVar7)
683 Wait(10)
684 Call(SaveDoorPtr)
685 Call(GetDoorData)
686 Call(MovePartnerThroughDoor, ROOM_DATA_ENTER_POS_BX, ROOM_DATA_ENTER_POS_BZ)
687
688 // allow input when movement is done
689 Call(AwaitUseDoorScript, ROOM_SCRIPT_IDX_3)
693 Call(ResetPartnerMovement)
694
695 // close the door
700 Else
702 EndIf
703 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_3, LVar5)
704
705 // drop the door
709 Call(AwaitUseDoorScript, ROOM_SCRIPT_IDX_3)
712 Else
714 EndIf
715 EndIf
717 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_1, LVar5)
718 EndIf
719
720 // notify listener ROOM_UPDATE_ENTER_DONE
724 EndIf
726 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_2, LVar5)
727 EndIf
729 Call(AwaitUseDoorScript, ROOM_SCRIPT_IDX_2)
730 EndIf
731
732 // wait for all anim scripts
734 Call(AwaitUseDoorScript, ROOM_SCRIPT_IDX_0)
735 EndIf
737 Call(AwaitUseDoorScript, ROOM_SCRIPT_IDX_1)
738 EndIf
739
740 // reset and return
741 Call(SetDoorState, ROOM_STATE_IDLE)
742 Return
743
744 // handle ROOM_UPDATE_REQUEST_CANCEL from callback to ROOM_UPDATE_ENTER_BEGIN
745 Label(1)
746 Call(SetDoorState, ROOM_STATE_IDLE)
747 Label(0)
750 Return
751 End
752};
753
754// executed from trigger activatation with MapRoom* stored in LVar1
757 // ensure valid player action state
759 Set(LVar4, 0)
761 Add(LVar4, 1)
762 EndIf
764 Add(LVar4, 1)
765 EndIf
767 Add(LVar4, 1)
768 EndIf
769 IfEq(LVar4, 0)
770 Return
771 EndIf
772
773 // initialize
774 Call(SaveDoorPtr)
775 Call(GetDoorState)
777 Return
778 EndIf
779 Call(SetDoorState, ROOM_STATE_EXITING)
782
783 // notify listener ROOM_UPDATE_EXIT_BEGIN
784 Call(GetDoorData)
788 EndIf
790 Goto(1)
791 EndIf
792
793 // adjust camera to face door
794 Call(GetDoorData)
796
797 // move player to door
798 Call(GetDoorData)
808
809 // wall movement animation
810 Call(GetDoorData)
811 Call(GetDoorPtr)
815 IfNe(LVar2, 0)
817 Else
819 EndIf
820 EndIf
822 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_0, LVar5)
823 EndIf
824
825 // raise the door if its been dropped
829 IfNe(LVar2, 0)
831 Else
833 EndIf
834 EndIf
836 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_1, LVar5)
837 EndIf
839 Call(AwaitUseDoorScript, ROOM_SCRIPT_IDX_1)
840 EndIf
841
842 // open the door
845 IfNe(LVar2, 0)
847 Else
849 EndIf
850 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_1, LVar5)
851 Call(AwaitUseDoorScript, ROOM_SCRIPT_IDX_1)
852
853 // move party through the doorway
854 Call(GetDoorPtr)
856 Call(SaveDoorPtr)
857 Call(GetDoorData)
858 Call(MovePartnerThroughDoor, ROOM_DATA_EXIT_POS_BX, ROOM_DATA_EXIT_POS_BZ)
860 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_1, LVar5)
861 Call(SetEntityHideMode0)
862
863 // hide room interior and reveal world
867 EndIf
869 Call(SaveUseDoorScript, ROOM_SCRIPT_IDX_2, LVar5)
870 EndIf
872 Call(AwaitUseDoorScript, ROOM_SCRIPT_IDX_2)
873 EndIf
874
875 // allow input when movement is done
876 Call(AwaitUseDoorScript, ROOM_SCRIPT_IDX_1)
880 Call(ResetPartnerMovement)
881
882 // close the door
883 Call(GetDoorData)
886 IfNe(LVar2, 0)
888 Else
890 EndIf
891
892 // notify listener ROOM_UPDATE_EXIT_END
893 Call(GetDoorData)
897 EndIf
898
899 // reset and return
900 Call(RevealHiddenRoomNPCs)
901 Call(RestorePrevItemVisGroup)
902 Call(SetDoorState, ROOM_STATE_IDLE)
903 Return
904
905 // handle ROOM_UPDATE_REQUEST_CANCEL from callback to ROOM_UPDATE_ENTER_BEGIN
906 Label(1)
907 Call(SetDoorState, ROOM_STATE_IDLE)
908 Label(0)
911 Return
912 End
913};
Bytecode EvtScript[]
#define sfx_play_sound_at_position
@ ENV_TINT_SHROUD
Definition enums.h:4387
@ ENV_TINT_NONE
Definition enums.h:4385
@ ENTITY_HIDE_MODE_1
Definition enums.h:2661
@ ENTITY_HIDE_MODE_0
Definition enums.h:2660
@ ENTITY_HIDE_MODE_2
Definition enums.h:2662
@ ROOM_FLAGS_MASK
Definition enums.h:4479
@ ROOM_FLAG_EXIT_DOOR_DROPS
Definition enums.h:4492
@ ROOM_LARGE_DOOR_RIGHT_HINGE_OPENS_OUT
Definition enums.h:4486
@ ROOM_DOOR_LEFT_HINGE_OPENS_OUT
Definition enums.h:4483
@ ROOM_DOOR_RIGHT_HINGE_OPENS_OUT
Definition enums.h:4481
@ ROOM_FLAG_CUSTOM_ANIM_DROP_DOOR
Definition enums.h:4491
@ ROOM_FLAGS_DOOR_TYPE_MASK
Definition enums.h:4480
@ ROOM_LARGE_DOOR_LEFT_HINGE_OPENS_OUT
Definition enums.h:4488
@ ROOM_DOOR_STRAIGHT_THROUGH
Definition enums.h:4485
@ ROOM_FLAG_CUSTOM_ANIM_OPEN_DOOR
Definition enums.h:4489
@ ROOM_FLAG_CUSTOM_ANIM_WALL_ROT
Definition enums.h:4490
@ ROOM_DOOR_LEFT_HINGE_OPENS_IN
Definition enums.h:4484
@ ROOM_FLAGS_VISGROUP_MASK
Definition enums.h:4478
@ ROOM_DOOR_RIGHT_HINGE_OPENS_IN
Definition enums.h:4482
@ ROOM_LARGE_DOOR_RIGHT_HINGE_OPENS_IN
Definition enums.h:4487
@ ROOM_UPDATE_ENTER_BEGIN
Definition enums.h:4497
@ ROOM_UPDATE_REQUEST_CANCEL
Definition enums.h:4502
@ ROOM_DROP_DOOR_ENTER
Definition enums.h:4514
@ ROOM_MOVE_WALL_OPEN
Definition enums.h:4509
@ ROOM_DROP_DOOR_EXIT
Definition enums.h:4517
@ ROOM_MOVE_WALL_1
Definition enums.h:4510
@ ROOM_DROP_DOOR_2
Definition enums.h:4516
@ ROOM_UPDATE_EXIT_BEGIN
Definition enums.h:4499
@ ROOM_UPDATE_ENTER_DONE
Definition enums.h:4498
@ ROOM_MOVE_WALL_2
Definition enums.h:4511
@ ROOM_MOVE_DOOR_ENTER_CLOSE
Definition enums.h:4505
@ ROOM_MOVE_DOOR_EXIT_CLOSE
Definition enums.h:4507
@ ROOM_DROP_DOOR_1
Definition enums.h:4515
@ ROOM_UPDATE_EXIT_END
Definition enums.h:4500
@ ROOM_MOVE_DOOR_EXIT_OPEN
Definition enums.h:4506
@ ROOM_MOVE_WALL_CLOSE
Definition enums.h:4512
@ ROOM_MOVE_DOOR_ENTER_OPEN
Definition enums.h:4504
@ VIS_GROUP_0
Definition enums.h:2280
@ NPC_PARTNER
Definition enums.h:2528
@ EASING_CUBIC_IN
Definition enums.h:512
@ EASING_CUBIC_OUT
Definition enums.h:515
@ SOUND_ROOM_DOOR_CLOSE
Definition enums.h:1697
@ SOUND_ROOM_DOOR_OPEN
Definition enums.h:1696
@ ACTION_STATE_IDLE
Definition enums.h:2426
@ ACTION_STATE_WALK
Definition enums.h:2427
@ ACTION_STATE_RUN
Definition enums.h:2428
@ CUSTOM_GFX_NONE
Definition enums.h:4420
@ TRIGGER_WALL_PRESS_A
Definition enums.h:2678
@ TRIGGER_WALL_PUSH
Definition enums.h:2676
@ CAM_DEFAULT
Definition enums.h:1800
@ NPC_FLAG_IGNORE_WORLD_COLLISION
Definition enums.h:3004
@ NPC_FLAG_HIDING
Definition enums.h:3021
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
@ EVT_GROUP_NEVER_PAUSE
Definition evt.h:142
#define ApiStatus_BLOCK
Definition evt.h:116
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
void func_800EF3E4(void)
Definition partners.c:2418
void get_collider_center(s32 colliderID, f32 *x, f32 *y, f32 *z)
Definition collision.c:497
s32 does_script_exist(s32 id)
f32 evt_get_float_variable(Evt *script, Bytecode var)
Definition evt.c:1930
void mdl_group_set_custom_gfx(u16, s32, s32, b32)
Definition model.c:3695
void partner_set_tether_distance(f32)
Definition partners.c:2401
void partner_reset_tether_distance(void)
Definition partners.c:2405
Trigger * bind_trigger_1(EvtScript *script, s32 flags, s32 triggerFlagIndex, s32 triggerVar0, s32 triggerVar1, s32 priority)
void * heap_malloc(s32 size)
Definition heap.c:34
void mdl_set_shroud_tint_params(u8 r, u8 g, u8 b, u8 a)
Definition model.c:3906
Npc * get_npc_by_index(s32 listIndex)
Definition npc.c:271
Npc * get_npc_safe(s32 npcID)
Definition npc.c:1010
s32 modelID
Definition rooms.c:31
s32 bgColor[3]
Definition rooms.c:32
s16 newItemVisGroup
Definition rooms.c:21
s32 colliderID
Definition rooms.c:35
EvtScript * overrideDropDoor
Definition rooms.c:29
EvtScript EVS_Default_AnimateWallRot
Definition rooms.c:529
EvtScript EVS_EnterRoomDoor
Definition rooms.c:576
VecXZf posEnterB
Definition rooms.c:24
EvtScript EVS_ExitRoom_MovePlayerB
Definition rooms.c:472
EvtScript EVS_EnterRoom_MoveCam
Definition rooms.c:449
EvtScript * stateListenerScript
Definition rooms.c:30
s32 * npcList
Definition rooms.c:34
RoomState state
Definition rooms.c:19
RoomState
Definition rooms.c:12
@ ROOM_STATE_EXITING
Definition rooms.c:15
@ ROOM_STATE_ENTERING
Definition rooms.c:14
@ ROOM_STATE_IDLE
Definition rooms.c:13
VecXZf posExitB
Definition rooms.c:26
EvtScript EVS_ExitRoom_MoveCam
Definition rooms.c:484
@ ROOM_DATA_EXIT_POS_AX
Definition rooms.c:45
@ ROOM_DATA_EVT_MOVE_WALL
Definition rooms.c:50
@ ROOM_DATA_ENTER_POS_AZ
Definition rooms.c:42
@ ROOM_DATA_ENTER_POS_BX
Definition rooms.c:43
@ ROOM_DATA_ENTER_POS_AX
Definition rooms.c:41
@ ROOM_DATA_EVT_DROP_DOOR
Definition rooms.c:51
@ ROOM_DATA_EXIT_POS_BZ
Definition rooms.c:48
@ ROOM_DATA_EXIT_POS_BX
Definition rooms.c:47
@ ROOM_DATA_FLAGS
Definition rooms.c:40
@ ROOM_DATA_EVT_LISTENER
Definition rooms.c:52
@ ROOM_DATA_EXIT_POS_AZ
Definition rooms.c:46
@ ROOM_DATA_EVT_OPEN_DOOR
Definition rooms.c:49
@ ROOM_DATA_ENTER_POS_BZ
Definition rooms.c:44
@ ROOM_DATA_MODEL_ID
Definition rooms.c:53
@ ROOM_VISIBILITY_HIDE
Definition rooms.c:65
@ ROOM_VISIBILITY_SHOW
Definition rooms.c:64
s32 scriptIDs[4]
Definition rooms.c:33
void get_flat_collider_normal(s32, f32 *, f32 *, f32 *)
Definition collision.c:489
VecXZf posEnterA
Definition rooms.c:23
VecXZf posExitA
Definition rooms.c:25
EvtScript * overrideOpenDoor
Definition rooms.c:27
EvtScript EVS_Default_AnimateDropDoor
Definition rooms.c:552
EvtScript EVS_EnterRoom_MovePlayerA
Definition rooms.c:427
EvtScript EVS_RoomContentVisiblityToggle
Definition rooms.c:421
s32 flags
Definition rooms.c:20
EvtScript EVS_ExitRoomDoor
Definition rooms.c:755
void func_800EF414(s32, s32)
Definition partners.c:2425
void set_current_item_entity_render_group(s32)
s32 get_current_item_entity_render_group(void)
s16 prevItemVisGroup
Definition rooms.c:22
EvtScript * overrideMoveWall
Definition rooms.c:28
@ ROOM_SCRIPT_IDX_1
Definition rooms.c:58
@ ROOM_SCRIPT_IDX_2
Definition rooms.c:59
@ ROOM_SCRIPT_IDX_3
Definition rooms.c:60
@ ROOM_SCRIPT_IDX_0
Definition rooms.c:57
EvtScript EVS_ExitRoom_MovePlayerA
Definition rooms.c:461
EvtScript EVS_Default_AnimateDoorRot
Definition rooms.c:496
EvtScript EVS_EnterRoom_MovePlayerB
Definition rooms.c:437
ApiStatus DisablePlayerInput(Evt *script, b32 isInitialCall)
Disables player and partner input, and disables the status menu.
ApiStatus UpdateLerp(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerActionState(Evt *script, b32 isInitialCall)
ApiStatus FacePlayerTowardPoint(Evt *script, b32 isInitialCall)
ApiStatus InterpCamTargetPos(Evt *script, b32 isInitialCall)
ApiStatus PlayerMoveTo(Evt *script, b32 isInitialCall)
ApiStatus DisablePlayerPhysics(Evt *script, b32 isInitialCall)
Disables player physics if disable is TRUE, enables it if FALSE.
ApiStatus MakeLerp(Evt *script, b32 isInitialCall)
ApiStatus SetNpcFlagBits(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerPos(Evt *script, b32 isInitialCall)
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#define LVar6
Definition macros.h:154
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:319
#define LVarF
Definition macros.h:163
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define LVarC
Definition macros.h:160
#define Float(DOUBLE)
Definition macros.h:51
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar5
Definition macros.h:153
#define LVarB
Definition macros.h:159
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define LVar7
Definition macros.h:155
#define BitwiseAndConst(VAR, CONST)
VAR &= CONST, but CONST is treated as-is rather than dereferenced with evt_get_variable.
Definition macros.h:439
#define LVar8
Definition macros.h:156
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define LVarD
Definition macros.h:161
#define ExecGetTID(EVT_SOURCE, OUTVAR)
Identical to Exec, but the newly-launched thread ID is stored in OUTVAR.
Definition macros.h:460
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define SetGroup(GROUP)
Sets the current thread's group. Group value meanings are currently not known.
Definition macros.h:519
#define LVar9
Definition macros.h:157
#define MAX_NPCS
Definition macros.h:91
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define LVar4
Definition macros.h:152
#define LVar3
Definition macros.h:151
#define LVarE
Definition macros.h:162
#define LVar0
Definition macros.h:148
#define Exec(EVT_SOURCE)
Launches a new thread.
Definition macros.h:455
#define Return
Kills the current EVT thread.
Definition macros.h:217
s16 bgColor[3]
s32 flags
s32 gEntityHideMode
Definition entity.c:37
Camera gCameras[4]
Definition cam_main.c:17