Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
use_munchlesia.c
Go to the documentation of this file.
1#include "common.h"
2#include "sprite/player.h"
3
9
10enum {
16};
17
19 PlayerStatus* playerStatus = &gPlayerStatus;
20 s32 colliderID;
21 f32 hitPosY;
22
23 if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
24 playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
25 playerStatus->actionSubstate = SUBSTATE_INIT;
29 }
30
31 switch (playerStatus->actionSubstate) {
32 case SUBSTATE_INIT:
33 suggest_player_anim_allow_backward(ANIM_Mario1_FallBack);
34 D_802B62E0 = 32;
39 playerStatus->actionSubstate++; // SUBSTATE_EJECT
40 Munchlesia_LaunchYaw = playerStatus->targetYaw;
41 break;
42 case SUBSTATE_EJECT:
43 playerStatus->pos.y += Munchlesia_LaunchVelocity;
46 gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x;
47 gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y;
48 gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z;
49 if (Munchlesia_LaunchVelocity <= 0.0f) {
50 playerStatus->actionSubstate++; // SUBSTATE_FALL
51 }
52 break;
53 case SUBSTATE_FALL:
54 playerStatus->pos.y += Munchlesia_LaunchVelocity;
57 gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x;
58 gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y;
59 gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z;
61 if (colliderID > NO_COLLIDER) {
63 suggest_player_anim_always_forward(ANIM_MarioW2_Collapse);
64 playerStatus->pos.y = hitPosY;
65 D_802B62E0 = 10;
66 playerStatus->actionSubstate++; // SUBSTATE_CRASH
67 }
68 break;
69 case SUBSTATE_CRASH:
70 if (playerStatus->animNotifyValue != 0) {
71 suggest_player_anim_always_forward(ANIM_Mario1_GetUp);
72 playerStatus->actionSubstate = SUBSTATE_GET_UP;
73 playerStatus->curStateTime = 15;
74 break;
75 }
76 break;
77 case SUBSTATE_GET_UP:
78 if (playerStatus->curStateTime != 0) {
79 playerStatus->curStateTime--;
80 break;
81 }
85 gOverrideFlags &= ~GLOBAL_OVERRIDES_40;
86 break;
87 }
88}
@ PS_FLAG_ACTION_STATE_CHANGED
Definition enums.h:3084
@ SOUND_TRIP
Definition enums.h:784
@ ACTION_STATE_IDLE
Definition enums.h:2426
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
@ GLOBAL_OVERRIDES_40
Definition enums.h:4325
@ CAM_DEFAULT
Definition enums.h:1800
void suggest_player_anim_always_forward(AnimID anim)
Definition 77480.c:913
s32 disable_player_input(void)
Definition 77480.c:990
f32 player_check_collision_below(f32, s32 *colliderID)
Definition 7BB60.c:470
s32 disable_player_static_collisions(void)
Definition 77480.c:972
s32 enable_player_input(void)
Definition 77480.c:998
void set_action_state(s32 actionState)
Definition 7E9D0.c:209
void suggest_player_anim_allow_backward(AnimID anim)
Definition 77480.c:894
s32 enable_player_static_collisions(void)
Definition 77480.c:980
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
Definition 43F0.c:685
void sfx_play_sound_at_player(s32 soundID, s32 arg1)
Definition sfx.c:521
#define BSS
Definition macros.h:7
#define NO_COLLIDER
Definition macros.h:156
Vec3f targetPos
BSS f32 Munchlesia_LaunchAccel
@ SUBSTATE_FALL
@ SUBSTATE_EJECT
@ SUBSTATE_CRASH
@ SUBSTATE_INIT
@ SUBSTATE_GET_UP
BSS f32 Munchlesia_LaunchVelocity
BSS f32 Munchlesia_LateralVelocity
void action_update_use_munchlesia(void)
BSS f32 Munchlesia_LaunchYaw
BSS s32 D_802B62E0
s32 gOverrideFlags
Definition main_loop.c:11
Camera gCameras[4]
Definition cam_main.c:17
PlayerStatus gPlayerStatus
Definition 77480.c:39