102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference | GitLab repository
Loading...
Searching...
No Matches
player_behavior.c
Go to the documentation of this file.
1/* Recovered game implementation; original addresses identify provenance. */
15#include "pcdogs/actor/types.h"
26#include "pcdogs/entity/types.h"
28#include "pcdogs/game/globals.h"
29#include "pcdogs/game/types.h"
34#include "pcdogs/math/types.h"
40#include <math.h>
41#include <stdarg.h>
42#include <string.h>
43
44// Original pcdogs.exe: 0x40a200
45// Runs phase-one actor behavior, including movement, animation, audio, hazards, death, and respawn handling. Eligible actors are not restricted to the currently active player.
47{
48 struct Actor_State *behavior_actor = actor;
49 struct Player_ControllerRecordView *controller = behavior_actor->record_ptr;
50 struct Entity *owner_entity =
51 &pkg_resource_current_level_data->entity_array[(int32_t)controller->owner_entity_index];
52
53 if (!behavior_actor->collision_class && behavior_actor->component_count && !(behavior_actor->behavior_flags & ACTOR_BEHAVIOR_WORKLIST_MEMBER) && !controller->contact_slots[0].target)
54 {
55 struct EntityNavigationWorkListBuffer *entity_navigation_work_list_staging_buffer_ptr =
57 int32_t nav_work_index = 0;
58
59 if (entity_navigation_work_list_staging_buffer_ptr->active_count > 0)
60 {
61 /* Native NULL entries only change an inactive distance scalar. The next
62 live target replaces it unconditionally; later NULL entries cannot win
63 the strict comparison. Skip them to avoid inherited stack reads. */
64 int32_t dy;
65 int32_t dz;
66 bool has_more_navigation_entries;
67
68 do
69 {
70 struct Actor *navigation_target_actor = entity_navigation_work_list_staging_buffer_ptr->active_entities[nav_work_index]->runtime_actor;
71
72 if (navigation_target_actor)
73 {
74 int32_t dx = navigation_target_actor->position.x - behavior_actor->position.x;
75
76 dy = navigation_target_actor->position.y - behavior_actor->position.y;
77 dz = navigation_target_actor->position.z - behavior_actor->position.z;
78
79 int32_t navigation_target_distance = Math_ApproxDistance3DWeighted(dx, dy, dz) >> 6;
80
81 if (!controller->contact_slots[0].target || navigation_target_distance < controller->contact_slots[0].distance)
82 {
83 controller->contact_slots[0].target = navigation_target_actor;
84 controller->contact_slots[0].distance = navigation_target_distance;
85 }
86 }
87
88 entity_navigation_work_list_staging_buffer_ptr =
90 has_more_navigation_entries =
91 nav_work_index + 1 < entity_navigation_work_list_staging_buffer_ptr->active_count;
92 nav_work_index += 1;
93 } while (has_more_navigation_entries);
94 }
95 }
96
97 int32_t surface_trail_mode;
98
99 if (!(behavior_actor->behavior_flags & ACTOR_BEHAVIOR_AIRBORNE))
100 {
101 uint16_t surface_flags = behavior_actor->ground_contact_polygon->flags;
102 int32_t surface_trail_selector = surface_flags >> COLLISION_SURFACE_TRAIL_SHIFT & COLLISION_SURFACE_TRAIL_MASK;
103
104 surface_trail_mode = surface_trail_selector - 1;
105
106 if (surface_trail_selector - 1 >= 0)
107 {
108 if (surface_trail_selector == COLLISION_SURFACE_TRAIL_IMPACT) // Check ground collision and apply gravity via Physics_ApplyGroundReaction
109 {
110 struct Actor_State *child_actor = behavior_actor->child_actor;
111
113 }
114
115 if ((behavior_actor->behavior_flags & ACTOR_BEHAVIOR_GROUNDED_MOTION) ||
116 ((behavior_actor->velocity.x || behavior_actor->velocity.y || behavior_actor->velocity.z) &&
117 !((int64_t)(uint32_t)g_frameCounter %
118 ((int32_t)pkg_resource_current_level_data->trail_list[surface_trail_selector - 1].spawn_interval + 1))))
119 {
120 Trail_SpawnFromEntry(behavior_actor, surface_trail_selector - 1);
121
122 if (surface_trail_selector == COLLISION_SURFACE_TRAIL_IMPACT && behavior_actor->behavior_flags & ACTOR_BEHAVIOR_GROUNDED_MOTION)
123 Trail_SpawnFromEntry(behavior_actor, 3);
124 }
125 }
126 }
127 else
128 surface_trail_mode = ((int32_t)UINT32_MAX);
129
130 uint8_t forced_animation_ticks = controller->forced_animation_ticks;
131
132 if (forced_animation_ticks)
133 {
134 if (!(behavior_actor->behavior_flags & ACTOR_BEHAVIOR_AIRBORNE) || behavior_actor->parent_actor)
135 controller->forced_animation_ticks = 0;
136 else
137 controller->forced_animation_ticks = forced_animation_ticks - 1;
138 }
139
140 // Handle actor attachment release and navigation command queue processing
141 int16_t health_delta = Actor_ProcessHazardsAndDamage(behavior_actor, controller);
142
143 controller->health_or_energy += (int32_t)health_delta;
144
145 int32_t ground_reaction;
146 uint32_t state_rumble_or_death_bits;
147
148 ground_reaction = Physics_ApplyGroundReaction(behavior_actor, (struct Physics_GroundReactionRecordView *)(controller));
149
150 if (ground_reaction)
151 {
152 state_rumble_or_death_bits = controller->state_flags;
153 state_rumble_or_death_bits |= ACTOR_CONTROLLER_GROUND_REACTION;
154
155 bool attachment_expired = controller->attachment_ticks <= 0;
156
157 controller->state_flags = state_rumble_or_death_bits;
158
159 if (!attachment_expired)
160 {
161 int32_t source_id = (uint8_t)(controller->input_source_index);
162
164 state_rumble_or_death_bits = Input_TriggerRumbleIfAllowed(source_id, 0, PHYSICS_FIXED_ONE, 3);
165
166 if (ground_reaction > 0)
168 }
169 }
170 else
171 {
172 uint32_t state_flags = controller->state_flags;
173
175 controller->state_flags = state_flags;
176 }
177
178 int32_t health_or_energy = controller->health_or_energy;
179
180 if (health_or_energy > 0)
181 {
182 int32_t maximum_health = owner_entity->param_max_health;
183
184 if (health_or_energy > maximum_health)
185 controller->health_or_energy = maximum_health;
186
187 struct Actor_State **attachment_slot = (struct Actor_State **)(&controller->attached_actors);
188 struct Actor_State **attachment_slot_cursor = attachment_slot;
189
190 for (int32_t component_index = 0; component_index < 2; ++component_index)
191 {
192 struct Actor_State *component_position_actor_x =
193 controller->component_records[component_index].position_source_actor;
194
195 if (component_position_actor_x)
196 {
197 component_position_actor_x->position.x += behavior_actor->sub_pos.x;
198
199 struct Actor_State *component_position_actor_y =
200 controller->component_records[component_index].position_source_actor;
201
202 component_position_actor_y->position.y += behavior_actor->sub_pos.y;
203
204 struct Actor_State *component_position_actor_z =
205 controller->component_records[component_index].position_source_actor;
206
207 component_position_actor_z->position.z += behavior_actor->sub_pos.z;
208 }
209
210 struct Actor_State *current_attachment = (struct Actor_State *)(*(uint32_t *)attachment_slot);
211
212 if (current_attachment && current_attachment->lifecycle_flags & ACTOR_LIFECYCLE_DESTROYING)
213 {
214 uint8_t attach_refcount = current_attachment->attach_refcount;
215
216 if (attach_refcount)
217 current_attachment->attach_refcount = attach_refcount - 1;
218
219 *(uint32_t *)attachment_slot = (uint32_t)(NULL);
220 }
221
222 int32_t component_action_mask = 1 << ((uint8_t)component_index & PHYSICS_WORD_SHIFT_MASK);
223
224 if (owner_entity->flags & component_action_mask)
225 {
226 struct Component_CollisionRecord *action_component_record =
227 &controller->component_records[component_index];
228
229 if (action_component_record->damage_cooldown)
230 owner_entity->flags &= ~component_action_mask;
231 else
232 {
233 struct Component_Definition *definition = action_component_record->definition;
234
235 if (definition)
236 {
237 if (!Component_CheckHeightConstraint(behavior_actor, definition))
238 owner_entity->flags &= ~component_action_mask;
239 else if (!Component_HasSpawnCapacity(definition))
240 owner_entity->flags &= ~component_action_mask;
241 else
242 {
243 struct Actor_State *spawned_attachment_or_command_bits = Component_SpawnFromCollisionRecord(
244 behavior_actor, behavior_actor, &controller->component_records[component_index]);
245
246 if (spawned_attachment_or_command_bits)
247 {
248 struct Actor_State *previous_attachment = (struct Actor_State *)(*(uint32_t *)attachment_slot_cursor);
249
250 if (previous_attachment)
251 {
252 uint8_t previous_attachment_refcount = previous_attachment->attach_refcount;
253
254 if (previous_attachment_refcount)
255 previous_attachment->attach_refcount = previous_attachment_refcount - 1;
256 }
257
258 *(uint32_t *)attachment_slot_cursor = (uint32_t)(spawned_attachment_or_command_bits);
259 spawned_attachment_or_command_bits->attach_refcount += 1;
260 }
261
262 uint8_t component_command = (uint8_t)(component_index + ACTOR_NAV_COMMAND_FIRST_COMPONENT_ACTION);
263
264 Navigation_AddCommand(component_command,
265 controller->owner_entity_index + 1, NAVIGATION_COMMAND_DEFAULT_SELECTOR, 0, &behavior_actor->position);
266 }
267 }
268 }
269 }
270
271 attachment_slot_cursor = &attachment_slot_cursor[1];
272
273 attachment_slot = attachment_slot_cursor;
274 }
275
276 struct Actor_State *movement_target_actor = Collision_GetValidCollisionTarget(behavior_actor, 2);
277
278 if (movement_target_actor)
279 {
280 behavior_actor->velocity = (struct Math_Vec3I32){
281 .z = 0,
282 .y = 0,
283 .x = 0};
284
285 Actor_MoveToTarget(behavior_actor, (const struct Math_Vec3I32 *)(movement_target_actor->runtime_vertex_array), ACTOR_FACING_RELATIVE, 0,
286 (int32_t)(movement_target_actor->scene_anim_data));
287 }
288 }
289 else
290 switch ((int32_t)controller->death_stage)
291 {
293 {
294 behavior_actor->lifecycle_flags &= ((uint8_t)~(ACTOR_LIFECYCLE_DISABLED | ACTOR_LIFECYCLE_HIDDEN));
295
296 // Check PkgActorRecord flags bits 0-1 for animation trigger events
297 int16_t owner_entity_index = controller->owner_entity_index;
298
303 owner_entity->position_ptr);
304
305 uint32_t death_entity_flags = owner_entity->flags;
306
307 death_entity_flags |= ENTITY_FLAG_RESTORE_DEFAULTS;
308 owner_entity->flags = death_entity_flags;
309
310 if ((uint8_t)death_entity_flags & ENTITY_FLAG_ACTIVE_WORKLIST_REQUEST)
311 owner_entity->flags = death_entity_flags | ENTITY_FLAG_PAUSE_EXEMPT;
312
313 break;
314 }
315
317 {
318 if (behavior_actor->behavior_flags & ACTOR_BEHAVIOR_AIRBORNE)
319 controller->death_ticks -= 1;
320
321 if (!(behavior_actor->behavior_flags & ACTOR_BEHAVIOR_AIRBORNE) || !controller->death_ticks)
322 {
323 // Component spawning: instantiate child actors/components from definition data
325
326 int16_t facing_current = behavior_actor->facing_current;
327 struct Animation_StateTable *anim_asset_table = behavior_actor->anim_asset_table;
328
329 behavior_actor->movement_handler_index = 0;
330 behavior_actor->velocity = (struct Math_Vec3I32){
331 .z = 0,
332 .y = 0,
333 .x = 0};
334
335 behavior_actor->facing_target = facing_current;
336
337 struct Animation_DataBlock *death_animation = anim_asset_table->anim_ptrs[ACTOR_ANIMATION_DEATH];
338
339 if (death_animation)
340 {
341 uint16_t death_frame_count = death_animation->keyframe_range.max - death_animation->keyframe_range.min;
342
343 controller->death_ticks = death_frame_count + 1;
345 }
346 else
347 controller->death_ticks = 0;
348
349 controller->death_ticks += 1;
350
351 if (!(owner_entity->flags & ENTITY_FLAG_ACTIVE_WORKLIST_REQUEST))
352 {
353 Trail_SpawnFromEntry(behavior_actor, 5);
354 }
355 else
356 {
357 uint32_t death_transition_flags = Game_FrameTransitionFlags | GAME_TRANSITION_RESPAWN_PENDING;
358
360 Game_FrameTransitionFlags = death_transition_flags;
363 behavior_actor = Trail_SpawnFromEntry(behavior_actor, 8);
364
365 if (behavior_actor)
366 {
367 behavior_actor->fade_timer = controller->death_ticks + ACTOR_DEATH_SETTLE_TICKS;
369 }
370 }
371 }
372 else
373 break;
374 }
375
376 /* Fall through: the newly entered death stage processes its first tick now. */
378 {
379 if (!(owner_entity->flags & ENTITY_FLAG_ACTIVE_WORKLIST_REQUEST))
380 {
381 controller->death_ticks -= 1;
382
383 if (controller->death_ticks)
384 return;
385
387 behavior_actor->fade_timer = ACTOR_DEATH_FADE_TICKS;
388 behavior_actor->move_anim_speed = 0;
389
390 return;
391 }
392
393 int16_t death_fade_progress = g_renderingStateFlag + ACTOR_DEATH_FADE_STEP_Q12;
394
395 g_renderingStateFlag = death_fade_progress;
396
397 if (death_fade_progress > PHYSICS_FIXED_ONE)
399
400 controller->death_ticks -= 1;
401
402 if (controller->death_ticks)
403 return;
404
405 controller->death_stage = ACTOR_DEATH_SETTLING;
408
409 return;
410 }
411
413 {
414 controller->death_ticks -= 1;
415
416 if (controller->death_ticks)
417 return;
418
420 behavior_actor->move_anim_speed = 0;
421
422 return;
423 }
424
426 {
427 if (owner_entity->flags & ENTITY_FLAG_ACTIVE_WORKLIST_REQUEST)
428 {
429 Player_RespawnAfterDeath(owner_entity, behavior_actor, controller);
430
431 return;
432 }
433
434 int16_t death_fade_timer = behavior_actor->fade_timer;
435
436 if (death_fade_timer <= 0)
437 {
439
440 return;
441 }
442
443 behavior_actor->fade_timer = death_fade_timer - 1;
444 Actor_SetAlphaFade(behavior_actor, (int32_t)(death_fade_timer - 1), 0);
445
446 return;
447 }
448 }
449
451 {
452 int32_t previous_animation_state = Actor_GetAnimSeqIndex(behavior_actor);
453 int32_t next_animation_state;
454
455 if (controller->forced_animation_ticks && behavior_actor->anim_asset_table->anim_ptrs[ACTOR_ANIMATION_FORCED])
456 next_animation_state = ACTOR_ANIMATION_FORCED;
457 else if (!controller->reaction_animation_ticks || !behavior_actor->anim_asset_table->anim_ptrs[ACTOR_ANIMATION_DAMAGE])
458 {
459 int32_t default_anim_state = (int32_t)owner_entity->default_anim_state;
460
461 next_animation_state = default_anim_state;
462
463 if (default_anim_state == ACTOR_ANIMATION_NONE)
464 {
465 int32_t preserve_active_animation;
466
467 if (previous_animation_state == ACTOR_ANIMATION_JUMP_START || previous_animation_state == ACTOR_ANIMATION_DAMAGE || (previous_animation_state >= ACTOR_ANIMATION_PRIMARY_ACTION && previous_animation_state < ACTOR_ANIMATION_FORCED))
468 {
469 preserve_active_animation = 1;
470
471 if (Actor_GetAnimationProgress(behavior_actor) >= PHYSICS_FIXED_ONE)
472 {
473 if (previous_animation_state >= ACTOR_ANIMATION_PRIMARY_ACTION && previous_animation_state < ACTOR_ANIMATION_FORCED)
474 controller->turn_step = owner_entity->param_turn_step;
475
476 previous_animation_state = ACTOR_ANIMATION_NONE;
477 preserve_active_animation = 0;
478 }
479 }
480 else
481 preserve_active_animation = 0;
482
483 char behavior_flags = (char)behavior_actor->behavior_flags;
484
485 if (!(behavior_flags & ACTOR_BEHAVIOR_AIRBORNE))
486 {
487 char jump_phase_ticks = controller->jump_phase_ticks;
488
489 /* Native MOVSX at 0x40a9c0 sign-extends startup before negation. */
490 if (jump_phase_ticks >= 0 || (int32_t)jump_phase_ticks != -((int32_t)(int8_t)controller->configured_jump_startup_ticks))
491 {
492 next_animation_state = previous_animation_state;
493
494 if (previous_animation_state == ACTOR_ANIMATION_NONE || behavior_flags & ACTOR_BEHAVIOR_GROUNDED_MOTION)
495 next_animation_state = ACTOR_ANIMATION_IDLE;
496 }
497 else
498 {
499 next_animation_state = ACTOR_ANIMATION_JUMP_START;
500 previous_animation_state = ACTOR_ANIMATION_NONE;
501 }
502 }
503 /* Native CMP DL,AL / JLE at 0x40a993 compares signed bytes. */
504 else if (controller->jump_phase_ticks > (int8_t)controller->configured_jump_hold_ticks)
505 {
506 next_animation_state = ACTOR_ANIMATION_JUMP_START;
507
508 if (!controller->configured_jump_startup_ticks)
509 previous_animation_state = ACTOR_ANIMATION_NONE;
510 }
511 else if (!preserve_active_animation)
512 next_animation_state = ACTOR_ANIMATION_AIRBORNE;
513 }
514 }
515 else
516 next_animation_state = ACTOR_ANIMATION_DAMAGE;
517
518 for (int32_t action = ACTOR_ANIMATION_PRIMARY_ACTION; action <= ACTOR_ANIMATION_ATTACHMENT_ACTION; ++action)
519 {
520 uint32_t request = 1u << (action - ACTOR_ANIMATION_PRIMARY_ACTION);
521 if (!(owner_entity->flags & request))
522 continue;
523
524 owner_entity->flags &= ~request;
525 if (behavior_actor->anim_asset_table->anim_ptrs[action])
527 }
528
529 if (next_animation_state != ACTOR_ANIMATION_NONE && next_animation_state != previous_animation_state)
530 // This final append limits the local path to three queued states.
531 Animation_QueueStateChange(next_animation_state);
532 }
533 else
534 {
535 Level_CheckBonusUnlock(&behavior_actor->position);
536 Actor_UpdateAnimationState(behavior_actor, controller, surface_trail_mode);
537 }
538
539 if (!(owner_entity->flags & ENTITY_FLAG_ACTIVE_WORKLIST_REQUEST))
540 return;
541
542 struct Collision_Node *ground_collision_node = behavior_actor->ground_collision_node;
543
544 if (ground_collision_node)
545 {
548 }
549}
#define ACTOR_DEATH_MUSIC_FADE_FRAMES
Definition constants.h:245
#define ACTOR_CAMERA_DEATH_TRANSITION_TICKS
Definition constants.h:205
#define ACTOR_DEATH_SETTLE_TICKS
Definition constants.h:125
@ ACTOR_ANIMATION_NONE
Definition constants.h:97
@ ACTOR_ANIMATION_PRIMARY_ACTION
Definition constants.h:106
@ ACTOR_ANIMATION_ATTACHMENT_ACTION
Definition constants.h:107
@ ACTOR_ANIMATION_IDLE
Definition constants.h:98
@ ACTOR_ANIMATION_JUMP_START
Definition constants.h:102
@ ACTOR_ANIMATION_DAMAGE
Definition constants.h:104
@ ACTOR_ANIMATION_FORCED
Definition constants.h:108
@ ACTOR_ANIMATION_DEATH
Definition constants.h:99
@ ACTOR_ANIMATION_AIRBORNE
Definition constants.h:103
@ ACTOR_ANIMATION_DEATH_SETTLE
Definition constants.h:111
#define ACTOR_BEHAVIOR_AIRBORNE
Definition constants.h:13
#define ACTOR_DEATH_AIRBORNE_TIMEOUT
Definition constants.h:124
#define ACTOR_LIFECYCLE_HIDDEN
Definition constants.h:40
#define ACTOR_LIFECYCLE_DISABLED
Definition constants.h:39
#define ACTOR_CONTROLLER_GROUND_REACTION
Definition constants.h:51
#define ACTOR_DEATH_INITIAL_HEALTH
Definition constants.h:126
#define ACTOR_BEHAVIOR_WORKLIST_MEMBER
Definition constants.h:34
@ ACTOR_DEATH_ANIMATING
Definition constants.h:133
@ ACTOR_DEATH_RESPAWN_OR_FADE
Definition constants.h:135
@ ACTOR_DEATH_SETTLING
Definition constants.h:134
@ ACTOR_DEATH_ALIVE
Definition constants.h:131
@ ACTOR_DEATH_WAIT_FOR_LANDING
Definition constants.h:132
#define ACTOR_LIFECYCLE_DESTROYING
Definition constants.h:43
@ ACTOR_FACING_RELATIVE
Definition constants.h:189
@ ACTOR_NAV_COMMAND_FIRST_COMPONENT_ACTION
Definition constants.h:262
@ ACTOR_NAV_COMMAND_DEATH
Definition constants.h:259
#define ACTOR_DEATH_FADE_TICKS
Definition constants.h:203
#define ACTOR_BEHAVIOR_GROUNDED_MOTION
Definition constants.h:14
#define ACTOR_DEATH_FADE_STEP_Q12
Definition constants.h:127
#define ACTOR_DEATH_MUSIC_VOLUME_Q12
Definition constants.h:244
#define ACTOR_BEHAVIOR_FORCE_VISIBLE
Definition constants.h:30
void Actor_MoveToTarget(struct Actor_State *actor, struct Math_Vec3I32 const *target_pos, int16_t facing_selector, int32_t facing_angle_degrees_q12, int32_t duration_frames)
Definition movement.c:142
int32_t Actor_ProcessHazardsAndDamage(struct Actor_State *actor, struct Player_ControllerRecordView *record)
Definition collision.c:1254
void Actor_ReleaseAttachment(struct Actor_MovementRecordView *record)
Definition attachments.c:34
void Actor_UpdateAnimationState(struct Actor_State *actor, struct Player_ControllerRecordView *record, int32_t surface_trail_mode)
Definition animation.c:291
void Actor_SetAlphaFade(struct Actor_State *actor, int32_t fade_steps, int32_t fade_in)
Definition rendering.c:715
int32_t Actor_GetAnimSeqIndex(struct Actor_State *actor)
Definition animation.c:519
int32_t Actor_GetAnimationProgress(struct Actor_State *actor)
Definition animation.c:526
int32_t global_type_g_actorBehaviorAIState0
Definition globals.h:60
#define g_actorBehaviorAIState0
Definition globals.h:61
void Animation_QueueStateChange(int32_t anim_state)
Definition controller.c:71
int32_t Audio_SetMusicFadeTarget(int32_t target_volume, int16_t frame_count)
Definition music.c:194
#define g_cameraTransitionTrigger
Definition globals.h:33
#define COLLISION_SURFACE_TRAIL_MASK
Definition constants.h:97
@ COLLISION_SURFACE_TRAIL_IMPACT
Definition constants.h:102
#define COLLISION_SURFACE_TRAIL_SHIFT
Definition constants.h:96
struct Actor_State * Collision_GetValidCollisionTarget(struct Actor_State *actor, int32_t collision_slot)
Definition actors.c:868
#define g_renderingDepthMode
Definition globals.h:87
BOOL Component_CheckHeightConstraint(struct Actor_State *actor, struct Component_Definition *definition)
Definition collision.c:352
BOOL Component_HasSpawnCapacity(struct Component_Definition *definition)
Definition lifecycle.c:30
struct Actor_State * Component_SpawnFromCollisionRecord(struct Actor_State *owner_actor, struct Actor_State *target_actor, struct Component_CollisionRecord *collision_record)
Definition lifecycle.c:54
#define ENTITY_FLAG_PAUSE_EXEMPT
Definition constants.h:26
#define ENTITY_FLAG_ACTIVE_WORKLIST_REQUEST
Definition constants.h:9
#define ENTITY_FLAG_SCRIPT_PAUSED
Definition constants.h:20
#define ENTITY_FLAG_ACTIVE_WORKLIST_DEFERRED
Definition constants.h:11
#define ENTITY_FLAG_RESTORE_DEFAULTS
Definition constants.h:18
#define EntityNavigationWorkList_StagingBufferPtr
Definition globals.h:15
#define GAME_TRANSITION_RESPAWN_PENDING
Definition constants.h:31
void Player_RespawnAfterDeath(struct Entity *current_entity, struct Actor_State *actor, struct Player_ControllerRecordView *record)
Definition player.c:583
#define Game_FrameTransitionFlags
Definition globals.h:47
#define INPUT_BUTTON_ACTION_2
Definition constants.h:9
int32_t Input_TriggerRumbleIfAllowed(int32_t source_id, BOOL full_strength, int32_t magnitude_fp12, int32_t duration_units)
void Level_CheckBonusUnlock(struct Math_Vec3I32 *player_position)
Definition progress.c:247
int32_t Math_ApproxDistance3DWeighted(int32_t dx, int32_t dy, int32_t dz)
Definition fixed_point.c:59
#define NAVIGATION_COMMAND_DEFAULT_SELECTOR
Definition constants.h:11
#define NAVIGATION_COMMAND_UNLIMITED_SPEED
Definition constants.h:12
void Navigation_AddCommand(uint8_t command_type, int16_t target_selector_a, int16_t target_selector_b, int32_t speed, struct Math_Vec3I32 const *position)
Definition commands.c:42
#define pkg_resource_current_level_data
Definition globals.h:117
#define PHYSICS_WORD_SHIFT_MASK
Definition constants.h:14
#define PHYSICS_FIXED_ONE
Definition constants.h:7
int32_t Physics_ApplyGroundReaction(struct Actor_State *actor, struct Physics_GroundReactionRecordView *record)
Definition ground.c:71
void Actor_ProcessPlayerBehavior(struct Actor_State *actor)
struct Actor * target
Definition types.h:73
int32_t distance
Definition types.h:72
uint8_t collision_class
Definition types.h:435
uint8_t component_count
Definition types.h:430
struct Math_Vec3I32 velocity
Definition types.h:446
int16_t move_anim_speed
Definition types.h:428
int16_t facing_current
Definition types.h:447
uint8_t lifecycle_flags
Definition types.h:392
struct Mesh_RuntimeVertex * runtime_vertex_array
Definition types.h:397
uint8_t movement_handler_index
Definition types.h:433
struct Actor_State * child_actor
Definition types.h:478
struct Collision_Polygon * ground_contact_polygon
Definition types.h:452
struct Collision_Node * ground_collision_node
Definition types.h:451
struct Animation_StateTable * anim_asset_table
Definition types.h:425
int32_t behavior_flags
Definition types.h:407
struct Actor_State * parent_actor
Definition types.h:488
int16_t facing_target
Definition types.h:448
void * scene_anim_data
Definition types.h:398
void * record_ptr
Definition types.h:477
int16_t fade_timer
Definition types.h:438
struct Math_Vec3I32 sub_pos
Definition types.h:386
struct Math_Vec3I32 position
Definition types.h:385
uint8_t attach_refcount
Definition types.h:436
Definition types.h:118
struct Math_Vec3I32 position
Definition types.h:132
struct Actor_ContactSlot contact_slots[0x4]
Definition types.h:277
struct Math_RangeI16 keyframe_range
Definition types.h:763
struct Animation_DataBlock * anim_ptrs[0x2b]
Definition types.h:422
uint16_t flags
Definition types.h:66
struct Component_Definition * definition
Definition types.h:43
uint16_t damage_cooldown
Definition types.h:45
struct Actor_State * position_source_actor
Definition types.h:46
struct Entity * active_entities[0x4]
Definition types.h:133
Definition types.h:22
uint32_t flags
Definition types.h:25
int32_t param_max_health
Definition types.h:98
struct Math_Vec3I32 * position_ptr
Definition types.h:78
struct Actor * runtime_actor
Definition types.h:107
int32_t param_turn_step
Definition types.h:91
int16_t default_anim_state
Definition types.h:43
uint32_t button_bits
Definition types.h:83
int16_t max
Definition types.h:232
int16_t min
Definition types.h:231
int32_t y
Definition types.h:471
int32_t x
Definition types.h:470
int32_t z
Definition types.h:472
struct Input_State input
Definition types.h:125
struct Actor_ContactSlot contact_slots[4]
Definition types.h:216
uint8_t configured_jump_hold_ticks
Definition types.h:153
uint16_t reaction_animation_ticks
Definition types.h:136
struct Component_CollisionRecord * component_records
Definition types.h:209
uint8_t configured_jump_startup_ticks
Definition types.h:154
struct Actor_State * attached_actors[2]
Definition types.h:215
struct Actor_State * Trail_SpawnFromEntry(struct Actor_State *actor, int32_t trail_index)
Definition effects.c:124
#define g_renderingStateFlag
Definition values.h:627
#define g_frameCounter
Definition values.h:501