102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference | GitLab repository
Loading...
Searching...
No Matches
actor_commands.c
Go to the documentation of this file.
1/* Recovered game implementation; original addresses identify provenance. */
11#include "pcdogs/actor/types.h"
15#include "pcdogs/audio/types.h"
19#include "pcdogs/entity/types.h"
21#include "pcdogs/game/globals.h"
22#include "pcdogs/game/types.h"
26#include "pcdogs/input/types.h"
29#include "pcdogs/level/types.h"
36#include <math.h>
37#include <stdarg.h>
38#include <string.h>
39
40// Original pcdogs.exe: 0x403f50
41// Decodes a collision slot and path selector and, when a runtime actor exists, updates the selected collision record when its resolved attachment selector is nonzero. It then restores the path-result vector and sets the slot's result bit even when no collision update occurred. With no runtime actor it only consumes the operands.
42void Script_OpUpdateCollisionAndSetFlag(struct Entity *entity, uint8_t **script_cursor_inout)
43{
44 (void)entity;
45 uint8_t *operand_cursor = (*script_cursor_inout + 1);
46
47 *script_cursor_inout = (operand_cursor);
48
49 uint8_t collision_slot = operand_cursor[-1];
50
51 *script_cursor_inout = (&operand_cursor[2]);
52
53 struct Entity *script_entity = g_scriptCurrentEntity;
54 int16_t path_selector = 0;
55 struct Actor *runtime_actor = script_entity->runtime_actor;
56
57 /* Native 0x403f7a/0x403f7d fetches both bytes before the null-actor test. */
58 path_selector = (uint32_t)(*(const volatile uint8_t *)operand_cursor) << 8;
59 path_selector |= ((const volatile uint8_t *)operand_cursor)[1];
60
61 if (!runtime_actor)
62 return;
63
64 int16_t attach_offset_x;
65 int32_t saved_path_x = script_entity->path_result.x;
66 int32_t saved_path_y = script_entity->path_result.y;
67 int32_t saved_path_z = script_entity->path_result.z;
68
69 if (path_selector)
70 attach_offset_x =
71 Actor_TracePath(script_entity, (int32_t)path_selector, INT32_MAX, INT32_MAX, 0);
72 else
73 attach_offset_x = script_entity->attach_offset_x;
74
75 if (attach_offset_x)
76 {
77 struct Actor_State *other_actor;
78
79 if (attach_offset_x > 0)
80 other_actor = (struct Actor_State *)pkg_resource_current_level_data->entity_array[(int32_t)attach_offset_x - 1].runtime_actor;
81 else
82 other_actor = NULL;
83
85 &((struct Actor_MovementRecordView *)runtime_actor->record_ptr)->collision_records[(uint32_t)collision_slot], 0xffffffff,
86 (struct Actor_State *)(runtime_actor), other_actor, &script_entity->path_result);
87 }
88
89 script_entity->path_result.x = saved_path_x;
90 script_entity->path_result.y = saved_path_y;
91
92 uint32_t flags = script_entity->flags;
93
94 script_entity->path_result.z = saved_path_z;
95 script_entity->flags = flags | SCRIPT_FLAG_BIT_UNIT << (collision_slot & SCRIPT_FLAG_INDEX_MASK);
96}
97
98// Original pcdogs.exe: 0x404aa0
99// Selects the player's input source and requests active entity-worklist membership. It reinitializes player state when the controller's lives field is negative.
100void Script_OpSetPlayerState(struct Entity *entity, uint8_t **script_cursor_inout)
101{
102 uint8_t *operand_cursor = (*script_cursor_inout + 1);
103
104 *script_cursor_inout = operand_cursor;
105
106 uint8_t input_source_index = operand_cursor[-1];
107 struct Actor *runtime_actor = entity->runtime_actor;
108
110
111 if (!runtime_actor)
112 return;
113
114 struct Player_ControllerRecordView *player_record = (struct Player_ControllerRecordView *)(runtime_actor->record_ptr);
115
117 {
118 uint32_t input_state_index;
119
120 if (input_source_index < 2)
121 input_state_index = (uint32_t)input_source_index;
122
123 if (input_source_index >= 2 || g_inputStateCurrentP1[input_state_index].button_bits == INPUT_STATE_DISABLED)
125 }
126
127 bool has_nonnegative_lives = (int16_t)player_record->lives_remaining >= 0;
128
129 player_record->input_source_index = input_source_index;
130
131 if (!has_nonnegative_lives)
132 {
134 Player_InitializeState(entity, (struct Pkg_ActorRecord *)(player_record));
135 }
136}
137
138// Original pcdogs.exe: 0x4069d0
139// Pauses or restores eligible world entities, their collision-list membership, music, and transition state. Null arguments allow only the reference-actor position snapshot.
140void Script_OpPauseToggle(struct Entity *entity, uint8_t **script_cursor_inout)
141{
142 int32_t current_game_mode = g_currentGameMode;
143 int32_t pause_entity_index = 0;
144
145 if (!current_game_mode || current_game_mode == (int32_t)GAME_MODE_PAUSE_BLOCKED)
146 {
147 struct Actor_State *pause_reference_actor = Entity_GetCurrentOrFirstActiveActor();
148
150
151 if (pause_reference_actor)
152 {
156 }
157 }
158
159 if (!entity || !script_cursor_inout)
160 return;
161
162 int32_t pause_mode = 0;
163 uint8_t *operand_cursor = (*script_cursor_inout + 1);
164
165 *script_cursor_inout = (operand_cursor);
166 pause_mode = (uint8_t)(operand_cursor[-1]);
167 g_screenBorderStateFlag = pause_mode;
168
169 uint32_t game_frame_transition_flags = Game_FrameTransitionFlags;
170
171 if (pause_mode != SCRIPT_PAUSE_CLEAR)
172 {
173 if (!((uint8_t)game_frame_transition_flags & GAME_TRANSITION_SCRIPT_PAUSED))
174 {
175 game_frame_transition_flags |= (uint8_t)(GAME_TRANSITION_SCRIPT_PAUSED);
176 Game_FrameTransitionFlags = game_frame_transition_flags;
177
178 if (!(((uint32_t)game_frame_transition_flags >> 8 & 0xff) & (GAME_TRANSITION_FADE_COUNTDOWN >> 8)))
179 {
180 int32_t fade_counter = g_fadeCounter;
181
182 g_fadeCounter = GAME_PAUSE_FRAMES - fade_counter;
183
184 if (GAME_PAUSE_FRAMES == fade_counter)
185 g_fadeCounter = 1;
186 }
187
188 struct Level_Data *pkg_resource_current_level_data_3 = pkg_resource_current_level_data;
189
192 pkg_resource_current_level_data_3->cam_current = NULL;
193
194 struct Level_Data *pkg_resource_current_level_data_4 = pkg_resource_current_level_data;
195
202
203 struct Pkg_CameraDef *cam_default = pkg_resource_current_level_data_4->cam_default;
204 struct Pkg_CameraDef default_camera_lens;
205
206 default_camera_lens.fov_distance = cam_default->fov_distance;
207 default_camera_lens.orbit_yaw = cam_default->orbit_yaw;
208 g_pauseCameraFOV = (*(uint32_t *)&default_camera_lens.fov_distance * SCRIPT_CAMERA_FOV_SCALE) >> 9;
211
212 struct Actor *collision_head = Actor_CollisionListHead;
213 struct Actor **actor_collision_list_head = &Actor_CollisionListHead;
214
215 if (collision_head)
216 {
217 struct Player_ControllerRecordView *list_actor_record = (struct Player_ControllerRecordView *)(entity);
218
219 do
220 {
221 int32_t behavior_flags = collision_head->behavior_flags;
222 int32_t has_player_controller = behavior_flags & ACTOR_BEHAVIOR_GROUND_TRACKING;
223
224 if (has_player_controller && !(behavior_flags & ACTOR_BEHAVIOR_WORKLIST_MEMBER))
225 list_actor_record = (struct Player_ControllerRecordView *)(collision_head->record_ptr);
226
227 if (!has_player_controller || (!(behavior_flags & ACTOR_BEHAVIOR_WORKLIST_MEMBER) && (list_actor_record->death_stage || collision_head->lifecycle_flags & ACTOR_LIFECYCLE_DESTROYING)))
228 {
229 uint8_t lifecycle_flags = collision_head->lifecycle_flags;
230
231 actor_collision_list_head = (struct Actor **)(collision_head);
232
234 {
236 {
237 collision_head->movement_handler_index = 0;
238 collision_head->lifecycle_flags = lifecycle_flags & (uint8_t)~ACTOR_LIFECYCLE_DISABLED;
239 collision_head->collision_class = 0;
240 collision_head->fade_timer = 1;
241 }
242 else if (!has_player_controller)
244 else
246 &pkg_resource_current_level_data->entity_array[(int32_t)
247 list_actor_record->owner_entity_index],
249 }
250 }
251 else
252 *(uint32_t *)actor_collision_list_head = (uint32_t)(collision_head->list_next);
253
254 collision_head = (struct Actor *)(*(uint32_t *)actor_collision_list_head);
255 } while (collision_head);
256 }
257
258 struct Level_Data *pkg_resource_current_level_data_2 = pkg_resource_current_level_data;
259 struct Entity *entity_array_1 = pkg_resource_current_level_data_2->entity_array;
260
261 if (pkg_resource_current_level_data_2->entity_count > 0)
262 {
263 int32_t pause_entity_count;
264
265 do
266 {
267 struct Actor *runtime_actor_1 = entity_array_1->runtime_actor;
268
269 if (entity_array_1 != entity && !(entity_array_1->flags & ENTITY_FLAG_PAUSE_EXEMPT))
270 {
272 entity_array_1->position_ptr, 0);
273
274 uint32_t flags_1 = entity_array_1->flags;
275
276 flags_1 &= ~(uint32_t)(uint8_t)((ENTITY_FLAG_BIT_0 | ENTITY_FLAG_BIT_1));
277 flags_1 |= ENTITY_FLAG_SCRIPT_PAUSED;
278 entity_array_1->flags = flags_1;
279
280 if (runtime_actor_1)
281 {
282 struct Player_ControllerRecordView *paused_actor_record =
283 (struct Player_ControllerRecordView *)(runtime_actor_1->record_ptr);
284
286 Actor_SnapToPosition((struct Actor_State *)(runtime_actor_1));
287 else if (paused_actor_record->attachment_ticks > 0)
288 Actor_ReleaseAttachment((struct Actor_MovementRecordView *)(paused_actor_record));
289
290 uint32_t state_flags = paused_actor_record->state_flags;
291
293 paused_actor_record->attachment_ticks = SCRIPT_PAUSE_DETACH_TICKS;
294 paused_actor_record->state_flags = state_flags;
295 Actor_ReleaseBindings(paused_actor_record);
296
297 if (!(runtime_actor_1->lifecycle_flags & ACTOR_LIFECYCLE_DESTROYING))
298 {
299 uint32_t flags_2 = entity_array_1->flags;
300
302 entity_array_1->flags = flags_2;
303 }
304 else
305 entity_array_1->runtime_actor = NULL;
306 }
307 }
308 else if (runtime_actor_1 && !(entity_array_1->flags_high_byte & (ENTITY_FLAG_COLLISION_LIST_UNLINKED >> 8)))
309 Actor_AddToCollisionList((struct Actor_State *)(runtime_actor_1));
310
311 pause_entity_index += 1;
312 entity_array_1 = &entity_array_1[1];
313 pause_entity_count = (uint16_t)pkg_resource_current_level_data->entity_count;
314 } while (pause_entity_index < pause_entity_count);
315 }
316
319 }
320 }
321 else if ((uint8_t)game_frame_transition_flags & GAME_TRANSITION_SCRIPT_PAUSED)
322 {
323 game_frame_transition_flags &= ~(uint32_t)(uint8_t)(GAME_TRANSITION_SCRIPT_PAUSED);
324 Game_FrameTransitionFlags = game_frame_transition_flags;
325
326 if (!(((uint32_t)game_frame_transition_flags >> 8 & 0xff) & (GAME_TRANSITION_FADE_COUNTDOWN >> 8)))
328
329 struct Level_Data *current_level = pkg_resource_current_level_data;
330 int32_t resume_entity_index = 0;
331 struct Entity *entity_array = current_level->entity_array;
332
333 if (current_level->entity_count > 0)
334 {
335 int32_t resume_entity_count;
336
337 do
338 {
339 if (entity_array != entity)
340 {
341 uint32_t flags = entity_array->flags;
342
344 {
346 entity_array->flags = flags;
347
348 if (((uint32_t)flags >> 8 & 0xff) & (ENTITY_FLAG_COLLISION_LIST_UNLINKED >> 8))
349 {
350 uint32_t flags_3 = flags;
351 struct Actor *runtime_actor = entity_array->runtime_actor;
352
354 entity_array->flags = flags_3;
355
356 if (runtime_actor)
357 Actor_AddToCollisionList((struct Actor_State *)(runtime_actor));
358 }
359 }
360 }
361
362 resume_entity_index += 1;
363 entity_array = &entity_array[1];
364 resume_entity_count = (uint16_t)pkg_resource_current_level_data->entity_count;
365 } while (resume_entity_index < resume_entity_count);
366 }
367
369 {
372
373 int32_t music_track_index = (uint8_t)(Audio_TriggerMusicTransition_CurrentTrackIndex);
374
377 }
378
379 Level_TriggerTransition(0xffffffff, 0, NULL);
380 }
381}
382
383// Original pcdogs.exe: 0x40f890
384// Consumes one byte and stores it as the entity's behavior index.
385void Script_OpSetEntityIndex(struct Entity *entity, uint8_t **script_cursor_inout)
386{
387 uint8_t *operand_cursor = &(*script_cursor_inout)[1];
388
389 *script_cursor_inout = operand_cursor;
390 entity->behavior_index = operand_cursor[-1];
391}
392
393// Original pcdogs.exe: 0x4106d0
394// Decodes an animation identifier and relative branch target and queries the current actor's animation wait status. A nonzero status stores the identifier and branches; zero stores -1 and continues.
395void Script_OpWaitForAnimation(struct Entity *entity, uint8_t **script_cursor_inout)
396{
397 (void)entity;
398 uint32_t wait_delta = 0;
399 int16_t animation_id = 0;
400 // Parse 2-byte offset and 2-byte animation index from bytecode
401 uint8_t *operand_cursor = (*script_cursor_inout + 2);
402
403 *script_cursor_inout = (operand_cursor);
404 wait_delta = (uint32_t)(operand_cursor[-2]) << 8;
405 wait_delta |= operand_cursor[-1];
406 *script_cursor_inout = (&operand_cursor[2]);
407
408 struct Entity *script_entity = g_scriptCurrentEntity;
409
410 animation_id = (uint32_t)(*(uint8_t *)operand_cursor) << 8;
411 animation_id |= operand_cursor[1];
412
413 if (!Actor_GetAnimationWaitStatus((struct Actor_State *)(script_entity->runtime_actor), (int32_t)animation_id))
414 {
416
417 return;
418 }
419
420 script_entity->default_anim_state = animation_id;
421 *script_cursor_inout = (&operand_cursor[wait_delta]);
422}
423
424// Original pcdogs.exe: 0x410730
425// Decodes a property identifier and 32-bit value and applies them to the current script entity. Properties 0x64 and 0x65 consume their payload but force a zero value.
426void Script_OpSetActorProperty(struct Entity *entity, uint8_t **script_cursor_inout)
427{
428 (void)entity;
429 uint8_t *operand_cursor = (*script_cursor_inout + 1);
430
431 *script_cursor_inout = (operand_cursor);
432
433 enum Actor_PropID prop_id = operand_cursor[-1];
434
435 if ((uint8_t)prop_id >= PROP_TRACEMODE0 && (uint8_t)prop_id <= PROP_TRACEMODE1)
436 {
437 *script_cursor_inout = (&operand_cursor[4]);
439
440 return;
441 }
442
443 *script_cursor_inout = (&operand_cursor[4]);
444
445 int32_t property_value = (uint32_t)(*(uint8_t *)operand_cursor) << 24;
446
447 property_value |= (uint32_t)(operand_cursor[2]) << 8;
448 property_value |= (uint32_t)(operand_cursor[1]) << 16;
449 property_value |= operand_cursor[3];
450 Entity_SetActorProperty(g_scriptCurrentEntity, prop_id, property_value);
451}
452
453// Original pcdogs.exe: 0x410790
454// Consumes a property identifier and applies the clear value -1 to the current script entity.
455void Script_OpClearActorProperty(struct Entity *entity, uint8_t **script_cursor_inout)
456{
457 (void)entity;
458 uint8_t *operand_cursor = (*script_cursor_inout + 1);
459
460 *script_cursor_inout = (operand_cursor);
461
462 enum Actor_PropID prop_id = operand_cursor[-1];
463
465}
466
467// Original pcdogs.exe: 0x410e40
468// Consumes an actor selector and the trailing operand byte, then destroys the selected entity's actor. Selector 0x8008 uses the executing entity, and zero uses its positive attachment selector.
469void Script_OpRemoveActor(struct Entity *entity, uint8_t **script_cursor_inout)
470{
471 int16_t actor_selector = 0;
472 uint8_t *operand_cursor = &(*script_cursor_inout)[2];
473
474 *script_cursor_inout = operand_cursor;
475 actor_selector = (uint32_t)(operand_cursor[-2]) << 8;
476 actor_selector |= operand_cursor[-1];
477 *script_cursor_inout = &operand_cursor[1];
478
479 if (actor_selector == (int16_t)SCRIPT_ENTITY_CURRENT)
480 {
482
483 return;
484 }
485
486 if (actor_selector)
487 {
489 &pkg_resource_current_level_data->entity_array[(int32_t)actor_selector - 1], ENTITY_FLAG_RESTORE_DEFAULTS);
490
491 return;
492 }
493
494 actor_selector = entity->attach_offset_x;
495
496 if (actor_selector > 0)
498 &pkg_resource_current_level_data->entity_array[(int32_t)actor_selector - 1], ENTITY_FLAG_RESTORE_DEFAULTS);
499}
500
501// Original pcdogs.exe: 0x411050
502// Decodes a level transition and optional timing values, updates the current entity selection for transition 0xc8, and branches while the transition reports pending.
503void Script_OpTriggerLevelTransition(struct Entity *entity, uint8_t **script_cursor_inout)
504{
505 (void)entity;
506 uint32_t wait_delta = 0;
507 uint8_t *operand_cursor = (*script_cursor_inout + 2);
508
509 *script_cursor_inout = (operand_cursor);
510 wait_delta = (uint32_t)(operand_cursor[0xfffffffe]) << 8;
511 wait_delta |= operand_cursor[-1];
512 *script_cursor_inout = (&operand_cursor[1]);
513
514 uint8_t transition_id = *(uint8_t *)operand_cursor;
515
516 *script_cursor_inout = (&operand_cursor[2]);
517
518 uint8_t mode_byte = operand_cursor[1];
519 struct Level_TransitionTimingData transition_timing;
520
521 if (mode_byte)
522 {
523 *script_cursor_inout = (&operand_cursor[6]);
524
525 int32_t start_delay = (uint32_t)(operand_cursor[2]) << 24;
526
527 // Mode 0 still passes three transition params; param0/param2 are zero, param1 comes from bytecode.
528 start_delay |= (uint32_t)(operand_cursor[4]) << 8;
529 start_delay |= (uint32_t)(operand_cursor[3]) << 16;
530 start_delay |= operand_cursor[5];
531 *script_cursor_inout = (&operand_cursor[0xa]);
532
533 transition_timing.start_delay_fp12 = start_delay;
534
535 int32_t mid_duration = (uint32_t)(operand_cursor[8]) << 8;
536
537 mid_duration |= (uint32_t)(operand_cursor[6]) << 24;
538 mid_duration |= (uint32_t)(operand_cursor[7]) << 16;
539 mid_duration |= operand_cursor[9];
540 *script_cursor_inout = (&operand_cursor[0xe]);
541
542 transition_timing.mid_duration_fp12 = mid_duration;
543
544 int32_t end_duration = (uint32_t)(operand_cursor[0xc]) << 8;
545
546 end_duration |= (uint32_t)(operand_cursor[0xa]) << 24;
547 end_duration |= (uint32_t)(operand_cursor[0xb]) << 16;
548 end_duration |= operand_cursor[0xd];
549 transition_timing.end_duration_fp12 = end_duration;
550 }
551 else
552 {
553 transition_timing.start_delay_fp12 = 0;
554 *script_cursor_inout = (&operand_cursor[0xa]);
555
556 int32_t direct_mid_duration = (uint32_t)(operand_cursor[6]) << 24;
557
558 direct_mid_duration |= (uint32_t)(operand_cursor[7]) << 16;
559 direct_mid_duration |= (uint32_t)(operand_cursor[8]) << 8;
560 direct_mid_duration |= operand_cursor[9];
561 transition_timing.end_duration_fp12 = 0;
562 transition_timing.mid_duration_fp12 = direct_mid_duration;
563 *script_cursor_inout = (&operand_cursor[0xe]);
564 }
565
566 // Level ID 200 (0xC8) triggers room change within current level. Room index stored at
567 // Level->room_transition_state+4 (short).
568 if (transition_id == LEVEL_TRANSITION_DEFAULT)
569 {
570 struct Level_Data *current_level = pkg_resource_current_level_data;
571 int32_t entity_index_quotient = (int32_t)(((int64_t)ENTITY_INDEX_RECIPROCAL * ((char *)g_scriptCurrentEntity - (char *)current_level->entity_array)) >> 38);
572 int16_t selected_entity_index = (uint16_t)entity_index_quotient + (int16_t)(entity_index_quotient >> 0x1f);
573
574 if (current_level->current_entity_index != selected_entity_index)
575 {
577 current_level->current_entity_index = selected_entity_index;
578 pkg_resource_current_level_data->cam_current = NULL;
579 }
580 }
581
582 if (Level_TriggerTransition((uint32_t)transition_id, (uint32_t)mode_byte, &transition_timing))
583 *script_cursor_inout = (&operand_cursor[wait_delta]);
584}
585
586// Original pcdogs.exe: 0x411440
587// Checks a decoded input group and button, branching when the input result is below 100. Button identifier 0xff bypasses the check.
588void Script_OpCheckButtonState(struct Entity *entity, uint8_t **script_cursor_inout)
589{
590 (void)entity;
591 uint32_t fail_delta = 0;
592 uint8_t *operand_cursor = (*script_cursor_inout + 2);
593
594 *script_cursor_inout = operand_cursor;
595 fail_delta = (uint32_t)(operand_cursor[0xfffffffe]) << 8;
596 fail_delta |= operand_cursor[-1];
597 *script_cursor_inout = &operand_cursor[1];
598
599 uint8_t input_device = *operand_cursor;
600
601 *script_cursor_inout = &operand_cursor[2];
602
603 uint8_t button_id = operand_cursor[1];
604
605 *script_cursor_inout = &operand_cursor[3];
606
607 if ((uint8_t)button_id != SCRIPT_INPUT_ANY_BUTTON && Input_CheckButtonState((uint32_t)input_device, (const struct Input_State *)(&g_inputStateCurrentP1), (uint32_t)button_id, (uint32_t)operand_cursor[2]) < INPUT_DIGITAL_STRENGTH)
608 *script_cursor_inout = &operand_cursor[fail_delta];
609}
#define ACTOR_LIFECYCLE_DISABLED
Definition constants.h:39
#define ACTOR_BEHAVIOR_GROUND_TRACKING
Definition constants.h:12
#define ACTOR_BEHAVIOR_WORKLIST_MEMBER
Definition constants.h:34
#define ACTOR_LIFECYCLE_DESTROYING
Definition constants.h:43
Actor_PropID
Definition enums.h:7
@ PROP_TRACEMODE1
Definition enums.h:43
@ PROP_TRACEMODE0
Definition enums.h:40
void Actor_AddToCollisionList(struct Actor_State *actor)
Definition collision.c:1414
void Actor_ReleaseBindings(struct Player_ControllerRecordView *record)
Definition attachments.c:68
int32_t Actor_TracePath(struct Entity *entity, int32_t target_selector, int32_t max_path_distance, int32_t best_path_distance, int32_t trace_flags)
int32_t Actor_GetAnimationWaitStatus(struct Actor_State *actor, int32_t anim_seq_index)
Definition animation.c:545
void Actor_ReleaseAttachment(struct Actor_MovementRecordView *record)
Definition attachments.c:34
void Actor_SnapToPosition(struct Actor_State *actor)
Definition movement.c:232
#define Actor_CollisionListHead
Definition globals.h:58
void Script_OpCheckButtonState(struct Entity *entity, uint8_t **script_cursor_inout)
void Script_OpPauseToggle(struct Entity *entity, uint8_t **script_cursor_inout)
void Script_OpSetEntityIndex(struct Entity *entity, uint8_t **script_cursor_inout)
void Script_OpSetPlayerState(struct Entity *entity, uint8_t **script_cursor_inout)
void Script_OpSetActorProperty(struct Entity *entity, uint8_t **script_cursor_inout)
void Script_OpUpdateCollisionAndSetFlag(struct Entity *entity, uint8_t **script_cursor_inout)
void Script_OpClearActorProperty(struct Entity *entity, uint8_t **script_cursor_inout)
void Script_OpRemoveActor(struct Entity *entity, uint8_t **script_cursor_inout)
void Script_OpWaitForAnimation(struct Entity *entity, uint8_t **script_cursor_inout)
void Script_OpTriggerLevelTransition(struct Entity *entity, uint8_t **script_cursor_inout)
#define g_animationTimerState
Definition globals.h:22
void Audio_StartMusicWithFade(struct Audio_MusicStreamRecord *stream_record)
Definition music.c:268
void Audio_StopOrUpdateSoundsAtPosition(int32_t sound_index_or_mode, struct Math_Vec3I32 *position, char looping_only)
Definition spatial.c:76
void Audio_StopMusicAndPause(void)
Definition music.c:245
#define Audio_TriggerMusicTransition_CurrentTrackIndex
Definition globals.h:57
#define g_pauseCameraFOV
Definition globals.h:102
#define g_cameraTransitionCountdown
Definition globals.h:36
#define g_pauseCameraDistance
Definition globals.h:99
#define g_pauseCameraOrbitAngleDeg
Definition globals.h:93
#define g_pauseCameraHeight
Definition globals.h:96
@ COMPONENT_PHASE_PAUSE_ATTACHMENT
Definition constants.h:64
@ COMPONENT_PHASE_DEFERRED_PROJECTILE
Definition constants.h:63
void Component_UpdateCollisionDetection(struct Component_CollisionRecord *collision_records, int32_t slot_count, struct Actor_State *actor, struct Actor_State *other_actor, struct Math_Vec3I32 *test_pos)
void Projectile_DestroyAllLiveActors(void)
Definition lifecycle.c:655
#define ENTITY_FLAG_COLLISION_LIST_UNLINKED
Definition constants.h:21
#define ENTITY_FLAG_PAUSE_EXEMPT
Definition constants.h:26
#define ENTITY_INDEX_RECIPROCAL
Definition constants.h:33
#define ENTITY_FLAG_BIT_1
Definition constants.h:8
#define ENTITY_FLAG_BIT_0
Definition constants.h:7
#define ENTITY_FLAG_ACTIVE_WORKLIST_REQUEST
Definition constants.h:9
#define ENTITY_FLAG_SCRIPT_PAUSED
Definition constants.h:20
#define ENTITY_FLAG_RESTORE_DEFAULTS
Definition constants.h:18
void Entity_SetActorProperty(struct Entity *entity, enum Actor_PropID prop_id, int32_t value)
Definition lifecycle.c:63
struct Actor_State * Entity_GetCurrentOrFirstActiveActor(void)
Definition lifecycle.c:753
void Entity_DestroyActor(struct Entity *entity, int32_t restore_defaults)
Definition lifecycle.c:403
#define GAME_TRANSITION_FADE_COUNTDOWN
Definition constants.h:25
#define GAME_PAUSE_FRAMES
Definition constants.h:45
#define GAME_TRANSITION_SCRIPT_PAUSED
Definition constants.h:20
@ GAME_MODE_PAUSE_BLOCKED
Definition enums.h:29
void Player_InitializeState(struct Entity *entity, struct Pkg_ActorRecord *record)
Definition player.c:648
#define Game_FrameTransitionFlags
Definition globals.h:47
#define g_currentGameMode
Definition globals.h:74
#define INPUT_STATE_DISABLED
Definition constants.h:20
#define INPUT_DIGITAL_STRENGTH
Definition constants.h:43
int32_t Input_CheckButtonState(int32_t state_index, struct Input_State const *state_table, int32_t control_code, int32_t mode_or_threshold)
Definition state.c:27
#define g_inputStateCurrentP1
Definition globals.h:72
@ LEVEL_TRANSITION_DEFAULT
Definition constants.h:29
@ LEVEL_TRANSITION_IDLE
Definition constants.h:30
BOOL Level_TriggerTransition(int32_t target_level_index, int32_t transition_mode, struct Level_TransitionTimingData const *transition_timing)
Definition transitions.c:47
#define g_levelTransitionState
Definition globals.h:118
#define g_levelTransitionFlag
Definition globals.h:46
#define pkg_resource_current_level_data
Definition globals.h:117
void Powerup_Cleanup(void)
Definition lifecycle.c:76
void Powerup_InitializeSystem(void)
Definition lifecycle.c:292
#define SCRIPT_DEFAULT_PAUSE_CAMERA_OFFSET
Definition constants.h:80
#define SCRIPT_FLAG_INDEX_MASK
Definition constants.h:61
@ SCRIPT_ENTITY_CURRENT
Definition constants.h:36
#define SCRIPT_FLAG_BIT_UNIT
Definition constants.h:62
#define SCRIPT_PLAYER_PAUSE_ATTACHMENT
Definition constants.h:63
#define SCRIPT_PAUSE_DETACH_TICKS
Definition constants.h:78
@ SCRIPT_PAUSE_CLEAR
Definition constants.h:85
#define SCRIPT_ANIMATION_PENDING
Definition constants.h:77
#define SCRIPT_DEFAULT_PAUSE_ORBIT_DEGREES
Definition constants.h:79
@ SCRIPT_INPUT_ANY_BUTTON
Definition constants.h:104
#define SCRIPT_CAMERA_FOV_SCALE
Definition constants.h:81
struct Actor * global_type_g_scriptPauseToggleState
Definition globals.h:41
#define Script_OpPauseToggle_SavedActorWorldRenderPosZ
Definition globals.h:51
#define g_scriptCurrentEntity
Definition globals.h:32
#define g_scriptPauseToggleState
Definition globals.h:42
#define Script_OpPauseToggle_SavedActorWorldRenderPosX
Definition globals.h:45
#define Script_OpPauseToggle_SavedActorWorldRenderPosY
Definition globals.h:48
struct Math_Vec3I32 world_render_pos
Definition types.h:420
Definition types.h:118
uint8_t transition_phase
Definition types.h:187
uint8_t collision_class
Definition types.h:188
struct Pkg_ActorRecord * record_ptr
Definition types.h:207
uint8_t lifecycle_flags
Definition types.h:139
struct Actor * list_next
Definition types.h:119
int32_t behavior_flags
Definition types.h:160
uint8_t movement_handler_index
Definition types.h:186
int16_t fade_timer
Definition types.h:191
Definition types.h:22
uint32_t flags
Definition types.h:25
int16_t attach_offset_x
Definition types.h:42
uint8_t flags_high_byte
Definition types.h:30
struct Math_Vec3I32 * position_ptr
Definition types.h:78
uint8_t behavior_index
Definition types.h:110
struct Actor * runtime_actor
Definition types.h:107
struct Math_Vec3I32 path_result
Definition types.h:114
int16_t default_anim_state
Definition types.h:43
int16_t entity_count
Definition types.h:44
struct Pkg_CameraDef * cam_default
Definition types.h:41
struct Pkg_CameraDef * cam_current
Definition types.h:42
int16_t current_entity_index
Definition types.h:43
struct Entity * entity_array
Definition types.h:45
int32_t y
Definition types.h:471
int32_t x
Definition types.h:470
int32_t z
Definition types.h:472
int16_t fov_distance
Definition types.h:182
int16_t orbit_yaw
Definition types.h:183
void Trail_ResetBone(void)
Definition effects.c:400
#define g_pauseTargetDistance
Definition values.h:837
#define g_screenBorderStateFlag
Definition values.h:144
#define g_pauseTargetRotationAngle
Definition values.h:831
#define g_pauseTargetYOffset
Definition values.h:834
#define g_fadeCounter
Definition values.h:147