Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
7E9D0.c File Reference

Go to the source code of this file.

Macros

#define PLAYER_ACTION_VRAM_DEF   (void*) 0x802B6000
 

Functions

void func_800E5520 (void)
 
void phys_set_landing_adjust_cam_check (s32(*funcPtr)(void))
 
s32 phys_adjust_cam_on_landing (void)
 
void phys_clear_spin_history (void)
 
f32 phys_get_spin_history (s32 lag, s32 *x, s32 *y, s32 *z)
 
void phys_reset_spin_history (void)
 
void phys_update_action_state (void)
 
void phys_peach_update (void)
 
void set_action_state (s32 actionState)
 
void update_locomotion_state (void)
 
void start_falling (void)
 
void start_bounce_a (void)
 
void start_bounce_b (void)
 
b32 check_input_hammer (void)
 
b32 check_input_jump (void)
 
void check_input_spin (void)
 
void peach_set_disguise_anim (AnimID anim)
 
void peach_force_disguise_action (s32 useParasol)
 
void peach_check_for_parasol_input (void)
 
void peach_sync_disguise_npc (void)
 
Npcpeach_make_disguise_npc (s32 peachDisguise)
 
s32 peach_disguise_check_overlaps (void)
 

Variables

void * LastLoadedActionOffset
 
s32 PeachDisguiseReapplyDelay
 
s32 D_8010C964
 
s32 gSpinHistoryBufferPos
 
s16 D_8010C9B0
 
s32 gSpinHistoryPosX [5]
 
s32 gSpinHistoryPosY [5]
 
s32 gSpinHistoryPosZ [5]
 
s16 gSpinHistoryPosAngle [5]
 
s32 PrevPlayerCamRelativeYaw = 0
 
s32 D_800F7B44 = 0
 
f32 LastMidairPlayerVelY = 0.0
 
s32(* LandingAdjustCamCallback )(void) = NULL
 
AnimID ClubbaDisguiseExtraAnims []
 
AnimID HammerBroDisguiseExtraAnims []
 
AnimID KoopatrolDisguiseExtraAnims []
 
DisguiseAnims BasicPeachDisguiseAnims []
 
AnimIDPeachDisguiseExtraAnims []
 

Macro Definition Documentation

◆ PLAYER_ACTION_VRAM_DEF

#define PLAYER_ACTION_VRAM_DEF   (void*) 0x802B6000

Definition at line 18 of file 7E9D0.c.

Referenced by phys_peach_update(), and phys_update_action_state().

Function Documentation

◆ func_800E5520()

void func_800E5520 ( void )

Definition at line 36 of file 7E9D0.c.

36 {
37 D_8010C9B0 = 0;
38}
s16 D_8010C9B0
Definition 7E9D0.c:25

Referenced by player_reset_data().

◆ phys_set_landing_adjust_cam_check()

void phys_set_landing_adjust_cam_check ( s32(*)(void) funcPtr)

Definition at line 42 of file 7E9D0.c.

42 {
44}
s32(* LandingAdjustCamCallback)(void)
Definition 7E9D0.c:40

Referenced by load_map_by_IDs().

◆ phys_adjust_cam_on_landing()

s32 phys_adjust_cam_on_landing ( void )

Definition at line 46 of file 7E9D0.c.

46 {
48
49 if (LandingAdjustCamCallback != NULL) {
51 }
52
53 if (ret == LANDING_CAM_CHECK_SURFACE) {
55
56 if (surfaceType == SURFACE_TYPE_LAVA) {
59 } else {
60 gCameras[CAM_DEFAULT].moveFlags &= ~CAMERA_MOVE_IGNORE_PLAYER_Y;
61 }
64 } else {
65 gCameras[CAM_DEFAULT].moveFlags &= ~CAMERA_MOVE_NO_INTERP_Y;
66 }
67
68 return ret;
69}
@ SURFACE_TYPE_LAVA
Definition enums.h:4673
@ PARTNER_ACTION_NONE
Definition enums.h:2932
@ LANDING_CAM_NEVER_ADJUST
Definition enums.h:6419
@ LANDING_CAM_CHECK_SURFACE
Definition enums.h:6420
@ COLLIDER_FLAGS_SURFACE_TYPE_MASK
Definition enums.h:4693
@ PARTNER_PARAKARRY
Definition enums.h:2889
@ CAMERA_MOVE_IGNORE_PLAYER_Y
Definition enums.h:4732
@ CAMERA_MOVE_NO_INTERP_Y
Definition enums.h:4733
@ CAM_DEFAULT
Definition enums.h:1800
s32 get_collider_flags(s32 colliderID)
Definition collision.c:481
CollisionStatus gCollisionStatus
Definition 7BB60.c:6
PartnerStatus gPartnerStatus
Definition partners.c:42
Camera gCameras[4]
Definition cam_main.c:17

Referenced by action_update_hit_lava(), action_update_jump(), action_update_land(), action_update_peach_land(), action_update_peach_step_down_land(), action_update_step_down_land(), action_update_step_up(), action_update_use_spinning_flower(), entity_CymbalPlant_idle(), phys_main_collision_below(), and phys_player_land().

◆ phys_clear_spin_history()

void phys_clear_spin_history ( void )

Definition at line 71 of file 7E9D0.c.

71 {
72 s32 i;
73
75
76 for (i = 0; i < ARRAY_COUNT(gSpinHistoryPosAngle); i++) {
77 gSpinHistoryPosAngle[i] = 180;
78 gSpinHistoryPosY[i] = 0x80000000;
79 }
80}
s32 gSpinHistoryPosY[5]
Definition 7E9D0.c:27
s32 gSpinHistoryBufferPos
Definition 7E9D0.c:24
s16 gSpinHistoryPosAngle[5]
Definition 7E9D0.c:29
#define ARRAY_COUNT(arr)
Definition macros.h:40

Referenced by action_update_spin(), and action_update_tornado_jump().

◆ phys_get_spin_history()

f32 phys_get_spin_history ( s32 lag,
s32 * x,
s32 * y,
s32 * z )

Definition at line 82 of file 7E9D0.c.

82 {
83 s32 idx = gSpinHistoryBufferPos - lag;
84
85 if (idx < 0) {
87 }
88
89 *x = gSpinHistoryPosX[idx];
90 *y = gSpinHistoryPosY[idx];
91 *z = gSpinHistoryPosZ[idx];
92 return gSpinHistoryPosAngle[idx];
93}
s32 gSpinHistoryPosX[5]
Definition 7E9D0.c:26
s32 gSpinHistoryPosZ[5]
Definition 7E9D0.c:28

Referenced by appendGfx_player_spin().

◆ phys_reset_spin_history()

void phys_reset_spin_history ( void )

Definition at line 95 of file 7E9D0.c.

95 {
96 s32 i;
97
100
101 for (i = 0; i < ARRAY_COUNT(gSpinHistoryPosAngle); i++) {
103 gSpinHistoryPosX[i] = 0;
104 gSpinHistoryPosY[i] = 0;
105 gSpinHistoryPosZ[i] = 0;
106 }
107
108 D_8010C964 = 0;
110}
void * LastLoadedActionOffset
Definition 7E9D0.c:21
s32 D_8010C964
Definition 7E9D0.c:23
#define mem_clear
PlayerSpinState gPlayerSpinState
Definition 7B440.c:11

Referenced by reset_player_status().

◆ phys_update_action_state()

void phys_update_action_state ( void )

Definition at line 112 of file 7E9D0.c.

112 {
113 PlayerStatus* playerStatus = &gPlayerStatus;
114 PlayerSpinState* playerSpinState = &gPlayerSpinState;
115
116 if (!(playerStatus->flags & PS_FLAG_ENTERING_BATTLE)) {
117 playerStatus->flags &= ~PS_FLAG_TIME_STOPPED;
118 }
119
120 if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) {
122 return;
123 }
124
125 if (playerStatus->camResetDelay != 0) {
126 playerStatus->camResetDelay--;
127 if (playerStatus->camResetDelay == 0) {
129 }
130 }
131
132 // if midair, look for velocity inflection
133 if (playerStatus->timeInAir != 0) {
134 if (playerStatus->gravityIntegrator[0] <= 0.0f && LastMidairPlayerVelY > 0.0f) {
135 playerStatus->peakJumpTime = playerStatus->timeInAir;
136 }
137 LastMidairPlayerVelY = playerStatus->gravityIntegrator[0];
138 }
139
141
142 if (playerSpinState->stopSoundTimer != 0) {
143 playerSpinState->stopSoundTimer--;
144 if (playerSpinState->stopSoundTimer == 0) {
145 playerStatus->animFlags &= ~PA_FLAG_SPINNING;
146 if (playerSpinState->spinSoundID != 0) {
147 sfx_stop_sound(playerSpinState->spinSoundID);
148 }
149 }
150 }
151
152 do {
153 s32 actionState = playerStatus->actionState;
154
155 if (actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN) {
156 s32 cond;
157
158 if (!(playerStatus->flags & PS_FLAG_INPUT_DISABLED)) {
160 } else {
161 cond = FALSE;
162 }
163
164 if ((gPartnerStatus.partnerActionState == PARTNER_ACTION_NONE) && !(playerStatus->flags & PS_FLAG_PAUSED) && cond) {
166 }
168 }
169
171
172 if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
173 if (action->dmaStart != NULL && action->dmaStart != LastLoadedActionOffset) {
176 }
177 }
178 action->update();
179 } while (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED);
180}
void check_input_spin(void)
Definition 7E9D0.c:386
void phys_peach_update(void)
Definition 7E9D0.c:182
#define PLAYER_ACTION_VRAM_DEF
Definition 7E9D0.c:18
void set_action_state(s32 actionState)
Definition 7E9D0.c:209
f32 LastMidairPlayerVelY
Definition 7E9D0.c:34
Action PlayerActionsTable[]
Definition actions.c:77
f32 gravityIntegrator[4]
@ PS_FLAG_PAUSED
Definition enums.h:3040
@ PS_FLAG_ENTERING_BATTLE
Definition enums.h:3061
@ PS_FLAG_ACTION_STATE_CHANGED
Definition enums.h:3084
@ PS_FLAG_INPUT_DISABLED
Definition enums.h:3052
@ PA_FLAG_USING_PEACH_PHYSICS
Definition enums.h:3103
@ ACTION_STATE_IDLE
Definition enums.h:2426
@ ACTION_STATE_TALK
Reading signs doesn't count.
Definition enums.h:2440
@ ACTION_STATE_WALK
Definition enums.h:2427
@ ACTION_STATE_RUN
Definition enums.h:2428
@ CAMERA_MOVE_ACCEL_INTERP_Y
Definition enums.h:4734
b32 check_conversation_trigger(void)
Definition encounter.c:2322
u32 dma_copy(Addr romStart, Addr romEnd, void *vramDest)
Definition 43F0.c:444
void calculate_camera_yinterp_rate(void)
Definition 7B440.c:183
void sfx_stop_sound(s32 soundID)
Definition sfx.c:507
void * dmaStart
Definition actions.h:8
void(* update)(void)
Definition actions.h:7
void * dmaEnd
Definition actions.h:9
PlayerStatus gPlayerStatus
Definition 77480.c:39

Referenced by phys_update_lava_reset(), phys_update_standard(), and update_player().

◆ phys_peach_update()

void phys_peach_update ( void )

Definition at line 182 of file 7E9D0.c.

182 {
184
185 do {
188 }
189
191
192 if (action->flag) {
194 if (action->dmaStart != NULL && action->dmaStart != LastLoadedActionOffset) {
197 }
198 }
199 action->update();
200 }
202
206 }
207}
void peach_sync_disguise_npc(void)
Definition 7E9D0.c:555
void peach_check_for_parasol_input(void)
Definition 7E9D0.c:530
@ PA_FLAG_INVISIBLE
Definition enums.h:3104
s8 flag
Definition actions.h:10

Referenced by phys_update_action_state().

◆ set_action_state()

void set_action_state ( s32 actionState)

Definition at line 209 of file 7E9D0.c.

209 {
210 PlayerStatus* playerStatus = &gPlayerStatus;
211 PlayerData* playerData = &gPlayerData;
212 PlayerSpinState* spinState = &gPlayerSpinState;
213
214 if (playerStatus->flags & PS_FLAG_SPECIAL_JUMP) {
215 playerStatus->flags &= ~PS_FLAG_SPECIAL_JUMP;
217 }
218
219 if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) {
220 if (actionState >= ACTION_STATE_IDLE && actionState < ACTION_STATE_TALK) {
221 playerStatus->prevActionState = playerStatus->actionState;
222 playerStatus->actionState = actionState;
223 playerStatus->flags |= PS_FLAG_ACTION_STATE_CHANGED;
224 }
225 return;
226 }
227
228 if (actionState == ACTION_STATE_HIT_FIRE || actionState == ACTION_STATE_HIT_LAVA) {
229 s8 partner;
230
231 if (playerStatus->hazardType == HAZARD_TYPE_FIRE_BAR) {
232 actionState = ACTION_STATE_HIT_FIRE;
233 }
234
235 // Whilst Sushie, Lakilester, or Parakarry's ability is active, hazards have no effect.
236 partner = playerData->curPartner;
237
238 if (partner == PARTNER_SUSHIE || partner == PARTNER_LAKILESTER || partner == PARTNER_PARAKARRY) {
241 playerStatus->flags |= PS_FLAG_HIT_FIRE;
242 return;
243 }
244 }
245 }
246
247 if (actionState == ACTION_STATE_SLIDING) {
248 playerStatus->flags |= PS_FLAG_SLIDING;
249 playerStatus->moveFrames = 0;
250 playerStatus->flags &= ~PS_FLAG_CUTSCENE_MOVEMENT;
251 }
252
253 playerStatus->prevActionState = playerStatus->actionState;
254 if (actionState == ACTION_STATE_USE_TWEESTER) {
255 playerStatus->prevActionState = ACTION_STATE_IDLE;
256 }
257
258 if (actionState == ACTION_STATE_ENEMY_FIRST_STRIKE) {
260 }
261 playerStatus->actionState = actionState;
262 playerStatus->flags |= PS_FLAG_ACTION_STATE_CHANGED;
263
264 if (playerStatus->actionState == ACTION_STATE_SPIN) {
265 return;
266 }
267
268 playerStatus->flags &= ~PS_FLAG_SPINNING;
269 playerStatus->animFlags &= ~PA_FLAG_SPINNING;
270
271 if (spinState->spinSoundID != 0) {
272 sfx_stop_sound(spinState->spinSoundID);
273 }
274
275 if (playerStatus->specialDecorationEffect != NULL) {
276 playerStatus->specialDecorationEffect->data.spin->timeLeft = 10;
277 playerStatus->specialDecorationEffect = NULL;
278 }
279}
struct EffectInstance * specialDecorationEffect
s32 timeLeft
Definition effects.h:1207
struct SpinFXData * spin
Definition effects.h:2534
EffectData data
Definition effects.h:2605
@ PS_FLAG_SPECIAL_JUMP
Definition enums.h:3046
@ PS_FLAG_SLIDING
Definition enums.h:3038
@ PS_FLAG_HIT_FIRE
Definition enums.h:3050
@ HAZARD_TYPE_FIRE_BAR
Definition enums.h:3502
@ PA_FLAG_INTERRUPT_USE_PARTNER
forces actions with bow, parakarry, watt, and lakilester to end (sushie not tested)
Definition enums.h:3093
@ PA_FLAG_8BIT_MARIO
Definition enums.h:3105
@ PARTNER_LAKILESTER
Definition enums.h:2893
@ PARTNER_SUSHIE
Definition enums.h:2892
@ ACTION_STATE_HIT_LAVA
Definition enums.h:2451
@ ACTION_STATE_USE_TWEESTER
Definition enums.h:2459
@ ACTION_STATE_SLIDING
Definition enums.h:2445
@ ACTION_STATE_ENEMY_FIRST_STRIKE
Definition enums.h:2455
@ ACTION_STATE_HIT_FIRE
Causes Mario to fly up and take damage. Used for fire bars.
Definition enums.h:2449
@ ACTION_STATE_SPIN
Definition enums.h:2454
s32 enable_player_input(void)
Definition 77480.c:998
PlayerData gPlayerData
Definition 77480.c:40

Referenced by action_hammer_end_swing(), action_update_first_strike(), action_update_hit_fire(), action_update_hit_lava(), action_update_idle(), action_update_idle_peach(), action_update_knockback(), action_update_land(), action_update_launch(), action_update_parasol(), action_update_peach_land(), action_update_peach_step_down_land(), action_update_pushing_block(), action_update_raise_arms(), action_update_run(), action_update_sliding(), action_update_spin(), action_update_spin_jump(), action_update_state_23(), action_update_step_down(), action_update_step_up(), action_update_step_up_peach(), action_update_tornado_jump(), action_update_use_munchlesia(), action_update_use_spinning_flower(), action_update_use_tweester(), action_update_walk(), check_input_hammer(), check_input_jump(), check_input_midair_jump(), check_input_open_menus(), check_input_spin(), check_player_action_debug(), collision_lateral_peach(), end_outta_sight_cleanup(), entity_CymbalPlant_idle(), entity_ScriptSpring_idle(), entity_SimpleSpring_set_jump_params(), entity_TriggerBlock_disable_player_input(), entity_Tweester_idle(), entity_WoodenCrate_idle(), func_802BB000_E2D930(), func_802BC274_E2EBA4(), func_802BC3A0_E2ECD0(), handle_jumping_launch(), move_player(), peach_check_for_parasol_input(), peach_force_disguise_action(), phys_main_collision_below(), phys_peach_update(), phys_player_land(), phys_update_action_state(), phys_update_jump(), player_handle_floor_collider_type(), post_battle(), post_battle(), pre_battle(), pre_battle(), pre_battle(), pre_battle(), pre_battle(), pre_battle(), reset_player_status(), start_bounce_a(), start_bounce_b(), start_falling(), update_encounters_conversation(), update_encounters_neutral(), update_encounters_post_battle(), update_item_entity_pickup(), and update_locomotion_state().

◆ update_locomotion_state()

void update_locomotion_state ( void )

Definition at line 281 of file 7E9D0.c.

281 {
282 PlayerStatus* playerStatus = &gPlayerStatus;
283
285 SQ(playerStatus->stickAxis[0]) + SQ(playerStatus->stickAxis[1]) > SQ(55))
286 {
288 } else {
290 }
291}
@ ABILITY_SLOW_GO
Definition enums.h:447
s32 is_ability_active(s32 arg0)
Definition inventory.c:1725
#define SQ(x)
Definition macros.h:166

Referenced by action_update_land(), action_update_step_down_land(), action_update_step_up(), and phys_player_land().

◆ start_falling()

void start_falling ( void )

Definition at line 293 of file 7E9D0.c.

293 {
294 PlayerStatus* playerStatus = &gPlayerStatus;
295
298}
@ ACTION_STATE_FALLING
Definition enums.h:2435
#define LOAD_INTEGRATOR_FALL(ptr)
Definition macros.h:186

Referenced by action_update_use_spinning_flower().

◆ start_bounce_a()

void start_bounce_a ( void )

Definition at line 300 of file 7E9D0.c.

300 {
301 PlayerStatus* playerStatus = &gPlayerStatus;
302
304 playerStatus->gravityIntegrator[0] = 10.0f;
305 playerStatus->gravityIntegrator[1] = -2.0f;
306 playerStatus->gravityIntegrator[2] = 0.8f;
307 playerStatus->gravityIntegrator[3] = -0.75f;
308}
@ ACTION_STATE_BOUNCE
Used with Kooper.
Definition enums.h:2431

Referenced by update_encounters_neutral().

◆ start_bounce_b()

void start_bounce_b ( void )

Definition at line 310 of file 7E9D0.c.

310 {
311 PlayerStatus* playerStatus = &gPlayerStatus;
312
314 playerStatus->gravityIntegrator[0] = 8.0f;
315 playerStatus->gravityIntegrator[1] = -1.0f;
316 playerStatus->gravityIntegrator[2] = 0;
317 playerStatus->gravityIntegrator[3] = 0;
318 playerStatus->flags |= PS_FLAG_SCRIPTED_FALL;
319}
@ PS_FLAG_SCRIPTED_FALL
Definition enums.h:3071

◆ check_input_hammer()

b32 check_input_hammer ( void )

Definition at line 321 of file 7E9D0.c.

321 {
322 PlayerStatus* playerStatus = &gPlayerStatus;
323 PlayerData* playerData = &gPlayerData;
324
325 if (playerStatus->pressedButtons & BUTTON_B) {
326 if (playerStatus->flags & PS_FLAG_FALLING) {
327 return FALSE;
328 }
329
331 return FALSE;
332 }
333
334 if (playerData->hammerLevel == -1) {
335 return FALSE;
336 }
337
339 return TRUE;
340 }
341 return FALSE;
342}
@ BUTTON_B
Definition enums.h:2789
@ PS_FLAG_FALLING
Definition enums.h:3036
@ PARTNER_ACTION_USE
Definition enums.h:2933
@ PARTNER_WATT
Definition enums.h:2891
@ ACTION_STATE_HAMMER
Definition enums.h:2446

Referenced by action_update_idle(), action_update_run(), action_update_spin(), and action_update_walk().

◆ check_input_jump()

b32 check_input_jump ( void )

Definition at line 344 of file 7E9D0.c.

344 {
345 PlayerStatus* playerStatus = &gPlayerStatus;
346 CollisionStatus* collisionStatus = &gCollisionStatus;
347 s32 surfaceType;
348
349 if (!(playerStatus->pressedButtons & BUTTON_A)) {
350 return FALSE;
351 }
352
354 if ((surfaceType == SURFACE_TYPE_SLIDE) && phys_should_player_be_sliding()) {
355 return FALSE;
356 }
357
358 if (collisionStatus->touchingWallTrigger != 0 ||
361 {
362 return FALSE;
363 }
364
365 if ((collisionStatus->curInspect != -1) && (collisionStatus->curInspect & COLLISION_WITH_ENTITY_BIT)) {
366 Entity* entity = get_entity_by_index(collisionStatus->curInspect);
367
369 if ((entity->boundScriptBytecode == NULL) || (entity->flags & ENTITY_FLAG_4000)) {
370 if (entity->type == ENTITY_TYPE_PINK_FLOWER ||
371 entity->type == ENTITY_TYPE_BELLBELL_PLANT ||
373 {
374 return FALSE;
375 }
376 } else {
377 return FALSE;
378 }
379 }
380 }
381
383 return TRUE;
384}
@ BUTTON_A
Definition enums.h:2790
@ SURFACE_TYPE_SLIDE
Definition enums.h:4675
@ ENTITY_TYPE_TRUMPET_PLANT
Definition enums.h:2591
@ ENTITY_TYPE_BELLBELL_PLANT
Definition enums.h:2590
@ ENTITY_TYPE_PINK_FLOWER
Definition enums.h:2594
@ PA_FLAG_SPEECH_PROMPT_AVAILABLE
(...) prompt
Definition enums.h:3096
@ PA_FLAG_INTERACT_PROMPT_AVAILABLE
! prompt
Definition enums.h:3095
@ ENTITY_FLAG_SHOWS_INSPECT_PROMPT
Definition enums.h:2625
@ ENTITY_FLAG_4000
Definition enums.h:2627
@ ACTION_STATE_JUMP
Definition enums.h:2430
Entity * get_entity_by_index(s32 index)
Definition entity.c:530
s32 phys_should_player_be_sliding(void)
Definition 7BB60.c:839
#define COLLISION_WITH_ENTITY_BIT
Definition macros.h:152
EvtScript * boundScriptBytecode

Referenced by action_update_idle(), action_update_land(), action_update_pushing_block(), action_update_run(), action_update_spin(), action_update_step_down(), action_update_step_down_land(), and action_update_walk().

◆ check_input_spin()

void check_input_spin ( void )

Definition at line 386 of file 7E9D0.c.

386 {
387 PlayerStatus* playerStatus = &gPlayerStatus;
388 PlayerSpinState* spinState = &gPlayerSpinState;
389 PlayerSpinState* temp2 = spinState;
390
391 if (!((playerStatus->flags & (PS_FLAG_NO_STATIC_COLLISION | PS_FLAG_CUTSCENE_MOVEMENT)) ||
392 (playerStatus->animFlags & PA_FLAG_USING_WATT) ||
393 (playerStatus->curButtons & BUTTON_C_DOWN) ||
395
396 s32 actionState = playerStatus->actionState;
397 s32 btnPressed = playerStatus->pressedButtons & Z_TRIG;
398
399 // TODO
400 if (actionState != ACTION_STATE_RIDE) {
401 if (actionState < ACTION_STATE_STEP_UP) {
402 if (actionState < ACTION_STATE_JUMP) {
403 if (actionState >= 0 && !(playerStatus->animFlags & PA_FLAG_SPINNING)) {
404 if (btnPressed || spinState->hasBufferedSpin) {
406 if (spinState->hasBufferedSpin != FALSE) {
407 if (spinState->bufferedStickAxis.x != 0 || spinState->bufferedStickAxis.y != 0) {
408 playerStatus->prevActionState = temp2->prevActionState;
409 } else {
410 playerStatus->prevActionState = ACTION_STATE_IDLE;
411 }
412 }
413 }
414 }
415 }
416 }
417 }
418 }
419}
@ BUTTON_C_DOWN
Definition enums.h:2779
@ PS_FLAG_CUTSCENE_MOVEMENT
Definition enums.h:3054
@ PS_FLAG_NO_STATIC_COLLISION
Definition enums.h:3051
@ PA_FLAG_SPINNING
Definition enums.h:3107
@ PA_FLAG_USING_WATT
Definition enums.h:3090
@ ACTION_STATE_RIDE
Definition enums.h:2461
@ ACTION_STATE_STEP_UP
Definition enums.h:2462

Referenced by phys_update_action_state().

◆ peach_set_disguise_anim()

void peach_set_disguise_anim ( AnimID anim)

Definition at line 506 of file 7E9D0.c.

506 {
507 s32 listIndex = PeachDisguiseNpcIndex;
508
509 if (listIndex >= 0) {
510 get_npc_by_index(listIndex)->curAnim = anim;
511 }
512}
Npc * get_npc_by_index(s32 listIndex)
Definition npc.c:271
AnimID curAnim
s32 PeachDisguiseNpcIndex
Definition 7B440.c:4

Referenced by action_update_idle_peach(), action_update_step_up_set_peach_anim(), action_update_talk(), action_update_walk_set_peach_anim(), and get_overriding_player_anim().

◆ peach_force_disguise_action()

void peach_force_disguise_action ( s32 useParasol)

Definition at line 514 of file 7E9D0.c.

514 {
515 PlayerStatus* playerStatus = &gPlayerStatus;
516
517 if (useParasol) {
519 } else {
520 playerStatus->animFlags &= ~PA_FLAG_INVISIBLE;
521 gGameStatusPtr->peachFlags &= ~PEACH_FLAG_DISGUISED;
522 playerStatus->peachDisguise = PEACH_DISGUISE_NONE;
525 playerStatus->colliderHeight = 55;
526 playerStatus->colliderDiameter = 38;
527 }
528}
@ PEACH_DISGUISE_NONE
Definition enums.h:2518
@ ACTION_STATE_USE_SNEAKY_PARASOL
Definition enums.h:2453
void free_npc_by_index(s32 listIndex)
Definition npc.c:202
GameStatus * gGameStatusPtr
Definition main_loop.c:32

Referenced by action_update_parasol().

◆ peach_check_for_parasol_input()

void peach_check_for_parasol_input ( void )

Definition at line 530 of file 7E9D0.c.

530 {
531 PlayerStatus* playerStatus = &gPlayerStatus;
532 s32 actionState = playerStatus->actionState;
533 Npc* disguiseNpc;
534
535 if (actionState == ACTION_STATE_IDLE || actionState == ACTION_STATE_WALK || actionState == ACTION_STATE_RUN) {
536 if (PeachDisguiseReapplyDelay != 0) {
538 if (PeachDisguiseReapplyDelay == 0) {
540 playerStatus->animFlags |= PA_FLAG_INVISIBLE;
542
544 if (disguiseNpc != NULL) {
545 disguiseNpc->flags &= ~NPC_FLAG_IGNORE_CAMERA_FOR_YAW;
546 }
547 }
548 }
551 }
552 }
553}
s32 PeachDisguiseReapplyDelay
Definition 7E9D0.c:22
Npc * peach_make_disguise_npc(s32 peachDisguise)
Definition 7E9D0.c:573
@ PEACH_FLAG_DISGUISED
Definition enums.h:2489
@ PEACH_FLAG_HAS_PARASOL
Definition enums.h:2490
s32 flags

Referenced by phys_peach_update().

◆ peach_sync_disguise_npc()

void peach_sync_disguise_npc ( void )

Definition at line 555 of file 7E9D0.c.

555 {
556 PlayerStatus* playerStatus = &gPlayerStatus;
557
558 if (PeachDisguiseNpcIndex >= 0) {
560
562 npc->renderYaw = playerStatus->spriteFacingAngle;
563 } else {
564 npc->yaw = playerStatus->targetYaw;
565 }
566
567 npc->pos.x = playerStatus->pos.x;
568 npc->pos.y = playerStatus->pos.y;
569 npc->pos.z = playerStatus->pos.z;
570 }
571}
@ NPC_FLAG_IGNORE_CAMERA_FOR_YAW
Definition enums.h:3016
f32 renderYaw
Vec3f pos

Referenced by action_update_parasol(), and phys_peach_update().

◆ peach_make_disguise_npc()

Npc * peach_make_disguise_npc ( s32 peachDisguise)

Definition at line 573 of file 7E9D0.c.

573 {
574 PlayerStatus* playerStatus = &gPlayerStatus;
575 NpcBlueprint bp;
576 NpcBlueprint* bpPtr = &bp;
577 Npc* npc;
578 f32 yaw;
579
580 if (peachDisguise == PEACH_DISGUISE_NONE) {
581 return NULL;
582 }
583
584 playerStatus->colliderHeight = 37;
585 playerStatus->colliderDiameter = 38;
586 playerStatus->peachDisguise = peachDisguise;
587 gGameStatusPtr->peachDisguise = peachDisguise;
588
591 bpPtr->onUpdate = NULL;
592 bpPtr->onRender = NULL;
593
596
598
599 if (!(playerStatus->spriteFacingAngle >= 90.0f) || !(playerStatus->spriteFacingAngle < 270.0f)) {
600 yaw = 180.0f;
601 } else {
602 yaw = 0.0f;
603 }
604
605 set_npc_yaw(npc, yaw);
606
607 npc->pos.x = playerStatus->pos.x;
608 npc->pos.y = playerStatus->pos.y;
609 npc->pos.z = playerStatus->pos.z;
610
611 return npc;
612}
DisguiseAnims BasicPeachDisguiseAnims[]
Definition 7E9D0.c:464
AnimID * PeachDisguiseExtraAnims[]
Definition 7E9D0.c:499
@ NPC_FLAG_FLYING
Definition enums.h:3001
@ NPC_FLAG_IGNORE_WORLD_COLLISION
Definition enums.h:3004
@ NPC_FLAG_IGNORE_PLAYER_COLLISION
Definition enums.h:3006
s32 create_standard_npc(NpcBlueprint *blueprint, AnimID *animList)
Definition npc.c:194
void disable_npc_shadow(Npc *npc)
Definition npc.c:1037
void set_npc_yaw(Npc *npc, f32 yaw)
Definition npc.c:1246
void(* onRender)(struct Npc *)
Definition npc.h:89
void(* onUpdate)(struct Npc *)
Definition npc.h:88
s32 initialAnim
Definition npc.h:87
s32 flags
Definition npc.h:86

Referenced by action_update_parasol(), and peach_check_for_parasol_input().

◆ peach_disguise_check_overlaps()

s32 peach_disguise_check_overlaps ( void )

Definition at line 614 of file 7E9D0.c.

614 {
615 PlayerStatus* playerStatus = &gPlayerStatus;
616 Camera* camera = &gCameras[gCurrentCameraID];
617 f32 yaw, dx, dy;
618 s32 radius;
619 s32 hitID;
620 s32 i;
621
622 if (playerStatus->spriteFacingAngle >= 90.0f && playerStatus->spriteFacingAngle < 270.0f) {
623 yaw = camera->curYaw - 270.0f;
624 } else {
625 yaw = camera->curYaw - 90.0f;
626 }
627 sin_cos_rad(DEG_TO_RAD(clamp_angle(yaw)), &dx, &dy);
628
629 for (radius = 2, i = 2; i > 0; radius += 18, i--) {
630 f32 x = playerStatus->pos.x + (dx * radius);
631 f32 y = playerStatus->pos.y + 4.0f;
632 f32 z = playerStatus->pos.z - (dy * radius);
633 hitID = player_test_lateral_overlap(PLAYER_COLLISION_HAMMER, playerStatus, &x, &y, &z, 4.0f, yaw);
634 if (hitID > NO_COLLIDER) {
635 break;
636 }
637 }
638
639 return hitID;
640}
#define clamp_angle
@ PLAYER_COLLISION_HAMMER
Definition enums.h:4715
s32 player_test_lateral_overlap(s32, PlayerStatus *, f32 *, f32 *, f32 *, f32, f32)
Definition 77480.c:370
void sin_cos_rad(f32 rad, f32 *outSinTheta, f32 *outCosTheta)
Definition 43F0.c:706
#define DEG_TO_RAD(deg)
Definition macros.h:134
#define NO_COLLIDER
Definition macros.h:156
s32 gCurrentCameraID
Definition cam_math.c:4

Referenced by action_update_parasol().

Variable Documentation

◆ LastLoadedActionOffset

void* LastLoadedActionOffset

Definition at line 21 of file 7E9D0.c.

Referenced by phys_peach_update(), phys_reset_spin_history(), and phys_update_action_state().

◆ PeachDisguiseReapplyDelay

s32 PeachDisguiseReapplyDelay

Definition at line 22 of file 7E9D0.c.

Referenced by peach_check_for_parasol_input(), and reset_player_status().

◆ D_8010C964

s32 D_8010C964

Definition at line 23 of file 7E9D0.c.

Referenced by phys_reset_spin_history().

◆ gSpinHistoryBufferPos

◆ D_8010C9B0

s16 D_8010C9B0

Definition at line 25 of file 7E9D0.c.

Referenced by func_800E5520().

◆ gSpinHistoryPosX

s32 gSpinHistoryPosX[5]

Definition at line 26 of file 7E9D0.c.

Referenced by action_update_spin(), phys_get_spin_history(), and phys_reset_spin_history().

◆ gSpinHistoryPosY

◆ gSpinHistoryPosZ

s32 gSpinHistoryPosZ[5]

Definition at line 28 of file 7E9D0.c.

Referenced by action_update_spin(), phys_get_spin_history(), and phys_reset_spin_history().

◆ gSpinHistoryPosAngle

s16 gSpinHistoryPosAngle[5]

◆ PrevPlayerCamRelativeYaw

s32 PrevPlayerCamRelativeYaw = 0

◆ D_800F7B44

s32 D_800F7B44 = 0

Definition at line 32 of file 7E9D0.c.

Referenced by action_update_walk(), and reset_player_status().

◆ LastMidairPlayerVelY

f32 LastMidairPlayerVelY = 0.0

Definition at line 34 of file 7E9D0.c.

Referenced by phys_update_action_state().

◆ LandingAdjustCamCallback

s32(* LandingAdjustCamCallback) (void) ( void ) = NULL

Definition at line 40 of file 7E9D0.c.

Referenced by phys_adjust_cam_on_landing(), and phys_set_landing_adjust_cam_check().

◆ ClubbaDisguiseExtraAnims

AnimID ClubbaDisguiseExtraAnims[]
Initial value:
= {
ANIM_WorldClubba_Anim00,
ANIM_WorldClubba_Anim02,
ANIM_WorldClubba_Anim03,
ANIM_WorldClubba_Anim04,
ANIM_WorldClubba_Anim05,
ANIM_WorldClubba_Anim08,
ANIM_WorldClubba_Anim07,
ANIM_WorldClubba_Anim13,
ANIM_WorldClubba_Anim14,
}
#define ANIM_LIST_END
Terminates an extraAnimationList.
Definition types.h:22

Definition at line 421 of file 7E9D0.c.

421 {
422 ANIM_WorldClubba_Anim00,
423 ANIM_WorldClubba_Anim02,
424 ANIM_WorldClubba_Anim03,
425 ANIM_WorldClubba_Anim04,
426 ANIM_WorldClubba_Anim05,
427 ANIM_WorldClubba_Anim08,
428 ANIM_WorldClubba_Anim07,
429 ANIM_WorldClubba_Anim13,
430 ANIM_WorldClubba_Anim14,
432};

◆ HammerBroDisguiseExtraAnims

AnimID HammerBroDisguiseExtraAnims[]
Initial value:
= {
ANIM_HammerBros_Anim00,
ANIM_HammerBros_Anim02,
ANIM_HammerBros_Anim03,
ANIM_HammerBros_Anim04,
ANIM_HammerBros_Anim06,
ANIM_HammerBros_Anim07,
ANIM_HammerBros_Anim09,
ANIM_HammerBros_Anim0A,
ANIM_HammerBros_Anim0B,
ANIM_HammerBros_Anim1A,
}

Definition at line 434 of file 7E9D0.c.

434 {
435 ANIM_HammerBros_Anim00,
436 ANIM_HammerBros_Anim02,
437 ANIM_HammerBros_Anim03,
438 ANIM_HammerBros_Anim04,
439 ANIM_HammerBros_Anim06,
440 ANIM_HammerBros_Anim07,
441 ANIM_HammerBros_Anim09,
442 ANIM_HammerBros_Anim0A,
443 ANIM_HammerBros_Anim0B,
444 ANIM_HammerBros_Anim1A,
446};

◆ KoopatrolDisguiseExtraAnims

AnimID KoopatrolDisguiseExtraAnims[]
Initial value:
= {
ANIM_WorldKoopatrol_Anim00,
ANIM_WorldKoopatrol_Anim01,
ANIM_WorldKoopatrol_Anim02,
ANIM_WorldKoopatrol_Anim04,
ANIM_WorldKoopatrol_Anim05,
ANIM_WorldKoopatrol_Anim06,
ANIM_WorldKoopatrol_Anim07,
ANIM_WorldKoopatrol_Anim08,
ANIM_WorldKoopatrol_Anim09,
ANIM_WorldKoopatrol_Anim12,
ANIM_WorldKoopatrol_Anim14,
ANIM_WorldKoopatrol_Anim1B,
}

Definition at line 448 of file 7E9D0.c.

448 {
449 ANIM_WorldKoopatrol_Anim00,
450 ANIM_WorldKoopatrol_Anim01,
451 ANIM_WorldKoopatrol_Anim02,
452 ANIM_WorldKoopatrol_Anim04,
453 ANIM_WorldKoopatrol_Anim05,
454 ANIM_WorldKoopatrol_Anim06,
455 ANIM_WorldKoopatrol_Anim07,
456 ANIM_WorldKoopatrol_Anim08,
457 ANIM_WorldKoopatrol_Anim09,
458 ANIM_WorldKoopatrol_Anim12,
459 ANIM_WorldKoopatrol_Anim14,
460 ANIM_WorldKoopatrol_Anim1B,
462};

◆ BasicPeachDisguiseAnims

DisguiseAnims BasicPeachDisguiseAnims[]

Definition at line 464 of file 7E9D0.c.

464 {
466 ANIM_WorldKoopatrol_Anim01,
467 ANIM_WorldKoopatrol_Anim04,
468 ANIM_WorldKoopatrol_Anim06,
469 ANIM_WorldKoopatrol_Anim08,
470 ANIM_WorldKoopatrol_Anim00,
471 ANIM_WorldKoopatrol_Anim1B
472 },
474 ANIM_WorldKoopatrol_Anim01,
475 ANIM_WorldKoopatrol_Anim04,
476 ANIM_WorldKoopatrol_Anim06,
477 ANIM_WorldKoopatrol_Anim08,
478 ANIM_WorldKoopatrol_Anim00,
479 ANIM_WorldKoopatrol_Anim1B
480 },
482 ANIM_HammerBros_Anim03,
483 ANIM_HammerBros_Anim06,
484 ANIM_HammerBros_Anim09,
485 ANIM_HammerBros_Anim0B,
486 ANIM_HammerBros_Anim00,
487 ANIM_HammerBros_Anim1A
488 },
490 ANIM_WorldClubba_Anim02,
491 ANIM_WorldClubba_Anim03,
492 ANIM_WorldClubba_Anim04,
493 ANIM_WorldClubba_Anim05,
494 ANIM_WorldClubba_Anim00,
495 ANIM_WorldClubba_Anim14
496 },
497};
@ PEACH_DISGUISE_KOOPATROL
Definition enums.h:2519
@ PEACH_DISGUISE_HAMMER_BROS
Definition enums.h:2520
@ PEACH_DISGUISE_CLUBBA
Definition enums.h:2521

Referenced by action_update_idle_peach(), action_update_step_up_set_peach_anim(), action_update_talk(), action_update_walk_set_peach_anim(), get_overriding_player_anim(), and peach_make_disguise_npc().

◆ PeachDisguiseExtraAnims