Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
step_up.c
Go to the documentation of this file.
1#include "common.h"
2#include "world/disguise.h"
3#include "sprite/player.h"
4
6 [PEACH_BAKING_NONE] ANIM_Peach1_Walk,
7 [PEACH_BAKING_CREAM] ANIM_Peach1_CarryCream,
8 [PEACH_BAKING_STRAWBERRY] ANIM_Peach1_CarryStrawberry,
9 [PEACH_BAKING_BUTTER] ANIM_Peach1_CarryButter,
10 [PEACH_BAKING_CLEANSER] ANIM_Peach1_CarryCleanser,
11 [PEACH_BAKING_WATER] ANIM_Peach1_CarryWater,
12 [PEACH_BAKING_MILK] ANIM_Peach1_CarryMilk,
13 [PEACH_BAKING_FLOUR] ANIM_Peach1_CarryFlour,
14 [PEACH_BAKING_EGG] ANIM_Peach1_CarryEgg,
15 [PEACH_BAKING_COMPLETE_CAKE] ANIM_Peach1_CarryCompleteCake,
16 [PEACH_BAKING_CAKE_BOWL] ANIM_Peach1_CarryCakeBowl,
17 [PEACH_BAKING_CAKE_MIXED] ANIM_Peach1_CarryCakeMixed,
18 [PEACH_BAKING_CAKE_PAN] ANIM_Peach1_CarryCakePan,
19 [PEACH_BAKING_CAKE_BATTER] ANIM_Peach1_CarryCakeBatter,
20 [PEACH_BAKING_CAKE_BARE] ANIM_Peach1_CarryBareCake,
21 [PEACH_BAKING_SALT] ANIM_Peach1_CarrySalt,
22 [PEACH_BAKING_SUGAR] ANIM_Peach1_CarrySugar,
23 [PEACH_BAKING_CAKE_WITH_ICING] ANIM_Peach1_CarryIcingCake,
24 [PEACH_BAKING_CAKE_WITH_BERRIES] ANIM_Peach1_CarryBerryCake,
25};
26
28
30 PlayerStatus* playerStatus = &gPlayerStatus;
31 HitID colliderID;
32 f32 cosTheta;
33 f32 sinTheta;
34
35 if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
36 playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
38 if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) {
40 } else if (playerStatus->animFlags & PA_FLAG_USING_WATT) {
41 suggest_player_anim_allow_backward(ANIM_MarioW1_CarryWalk);
42 } else {
43 suggest_player_anim_allow_backward(ANIM_Mario1_Walk);
44 }
45 playerStatus->actionSubstate = 0;
46 playerStatus->timeInAir = 0;
47 playerStatus->peakJumpTime = 0;
48 playerStatus->gravityIntegrator[0] = 17.7566f;
49 playerStatus->gravityIntegrator[1] = -11.3862f;
50 playerStatus->gravityIntegrator[2] = 3.5f;
51 playerStatus->gravityIntegrator[3] = -0.75f;
52 }
53
55 sin_cos_rad(DEG_TO_RAD(playerStatus->targetYaw), &sinTheta, &cosTheta);
56 colliderID = NO_COLLIDER;
57 playerStatus->pos.x += sinTheta * 3.0f;
58 playerStatus->pos.z -= cosTheta * 3.0f;
59
60 if (playerStatus->gravityIntegrator[0] < 0.0f) {
61 playerStatus->pos.y = player_check_collision_below(playerStatus->gravityIntegrator[0], &colliderID);
62 } else {
63 playerStatus->pos.y += playerStatus->gravityIntegrator[0];
64 }
65
66 if (colliderID > NO_COLLIDER) {
67 if (playerStatus->prevActionState != ACTION_STATE_SPIN) {
68 set_action_state(playerStatus->prevActionState);
69 } else {
71 }
72 }
73}
74
84
86 PlayerStatus* playerStatus = &gPlayerStatus;
87
88 if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
89 playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
90 suggest_player_anim_allow_backward(ANIM_Peach1_StepUp);
91 playerStatus->curStateTime = 8;
92 }
93
94 if (playerStatus->curStateTime != 0) {
95 playerStatus->curStateTime--;
96#if !VERSION_JP
97 if (playerStatus->curStateTime == 4) {
99 }
100#endif
101 } else {
102 if (!(playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT)) {
104 } else if (playerStatus->curSpeed >= playerStatus->runSpeed) {
106 } else {
108 }
109 }
110}
DisguiseAnims BasicPeachDisguiseAnims[]
Definition 7E9D0.c:464
s32 HitID
f32 gravityIntegrator[4]
u32 AnimID
@ PEACH_FLAG_DEPRESSED
Definition enums.h:2492
@ PS_FLAG_ACTION_STATE_CHANGED
Definition enums.h:3084
@ PS_FLAG_CUTSCENE_MOVEMENT
Definition enums.h:3054
@ PA_FLAG_INVISIBLE
Definition enums.h:3104
@ PA_FLAG_USING_PEACH_PHYSICS
Definition enums.h:3103
@ PA_FLAG_USING_WATT
Definition enums.h:3090
@ PEACH_BAKING_CAKE_MIXED
Definition enums.h:2507
@ PEACH_BAKING_CAKE_BOWL
Definition enums.h:2506
@ PEACH_BAKING_BUTTER
Definition enums.h:2499
@ PEACH_BAKING_CAKE_WITH_ICING
Definition enums.h:2513
@ PEACH_BAKING_NONE
Definition enums.h:2496
@ PEACH_BAKING_WATER
Definition enums.h:2501
@ PEACH_BAKING_COMPLETE_CAKE
Definition enums.h:2505
@ PEACH_BAKING_FLOUR
Definition enums.h:2503
@ PEACH_BAKING_SUGAR
Definition enums.h:2512
@ PEACH_BAKING_CAKE_PAN
Definition enums.h:2508
@ PEACH_BAKING_STRAWBERRY
Definition enums.h:2498
@ PEACH_BAKING_CAKE_WITH_BERRIES
Definition enums.h:2514
@ PEACH_BAKING_EGG
Definition enums.h:2504
@ PEACH_BAKING_CAKE_BATTER
Definition enums.h:2509
@ PEACH_BAKING_MILK
Definition enums.h:2502
@ PEACH_BAKING_CLEANSER
Definition enums.h:2500
@ PEACH_BAKING_SALT
Definition enums.h:2511
@ PEACH_BAKING_CAKE_BARE
Definition enums.h:2510
@ PEACH_BAKING_CREAM
Definition enums.h:2497
@ ACTION_STATE_IDLE
Definition enums.h:2426
@ ACTION_STATE_WALK
Definition enums.h:2427
@ ACTION_STATE_SPIN
Definition enums.h:2454
@ ACTION_STATE_RUN
Definition enums.h:2428
void peach_set_disguise_anim(AnimID)
Definition 7E9D0.c:506
void update_locomotion_state(void)
Definition 7E9D0.c:281
f32 integrate_gravity(void)
Definition 7BB60.c:436
f32 player_check_collision_below(f32, s32 *colliderID)
Definition 7BB60.c:470
s32 phys_adjust_cam_on_landing(void)
Definition 7E9D0.c:46
void set_action_state(s32 actionState)
Definition 7E9D0.c:209
void suggest_player_anim_allow_backward(AnimID anim)
Definition 77480.c:894
void try_player_footstep_sounds(s32 arg0)
Definition 7BB60.c:1105
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
void action_update_step_up_peach(void)
Definition step_up.c:85
void action_update_step_up_set_peach_anim(void)
Definition step_up.c:75
void action_update_step_up(void)
Definition step_up.c:29
AnimID StepUpPeachAnims[]
Definition step_up.c:5
GameStatus gGameStatus
Definition main_loop.c:21
PlayerStatus gPlayerStatus
Definition 77480.c:39