Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
sleep_stomp.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
4#include "sprite/player.h"
5
6#define NAMESPACE battle_move_sleep_stomp
7
9
10extern EvtScript N(EVS_UseMove_Basic);
11extern EvtScript N(EVS_UseMove_Super);
12extern EvtScript N(EVS_UseMove_Ultra);
13
14EvtScript N(EVS_UseMove) = {
15 Call(ShowActionHud, TRUE)
16 Call(GetMenuSelection, LVar0, LVar1, LVar2)
18 CaseEq(0)
19 ExecWait(N(EVS_UseMove_Basic))
20 CaseEq(1)
21 ExecWait(N(EVS_UseMove_Super))
22 CaseEq(2)
23 ExecWait(N(EVS_UseMove_Ultra))
25 Return
26 End
27};
28
29EvtScript N(EVS_UseMove_Basic) = {
30 ExecWait(N(EVS_JumpSupport_ApproachAndJump))
31 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_JUMP, 0, 0, 1, 0)
33 ExecWait(N(EVS_JumpSupport_Miss))
34 Return
35 EndIf
36 Wait(1)
37 Call(GetPlayerActionSuccess, LVar0)
39 CaseGt(FALSE)
49 ExecWait(N(EVS_JumpSupport_NoFollowUp))
50 Return
57 Call(UseBattleCamPreset, BTL_CAM_PLAYER_PRE_JUMP_FINISH)
58 Wait(5)
59 Call(SetGoalToTarget, ACTOR_PLAYER)
60 Call(UseBattleCamPreset, BTL_CAM_PLAYER_JUMP_FINISH)
62 Call(GetActionResult, LVarF)
63 Call(CloseActionCommandInfo)
64 Call(LoadActionCommand, ACTION_COMMAND_JUMP)
65 Call(action_command_jump_init)
66 Call(ShowActionHud, FALSE)
67 Call(action_command_jump_start, 24, 3)
68 Call(SetGoalToTarget, ACTOR_PLAYER)
69 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_SpinFall)
70 Call(PlayerBasicJumpToGoal, 24, PLAYER_BASIC_JUMP_3)
71 Wait(1)
74 Call(SetActionResult, LVarF)
75 ExecWait(N(EVS_JumpSupport_Rebound))
76 Return
77 End
78};
79
80EvtScript N(EVS_UseMove_Super) = {
81 ExecWait(N(EVS_JumpSupport_ApproachAndJump))
82 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_JUMP, 0, 0, 1, 0)
84 ExecWait(N(EVS_JumpSupport_Miss))
85 Return
86 EndIf
87 Wait(1)
88 Call(GetPlayerActionSuccess, LVar0)
90 CaseGt(FALSE)
100 ExecWait(N(EVS_JumpSupport_NoFollowUp))
101 Return
107 Call(GetActionResult, LVarF)
109 Call(UseBattleCamPreset, BTL_CAM_PLAYER_PRE_JUMP_FINISH)
110 Wait(5)
111 Call(SetGoalToTarget, ACTOR_PLAYER)
112 Call(UseBattleCamPreset, BTL_CAM_PLAYER_JUMP_FINISH)
114 Call(CloseActionCommandInfo)
115 Call(LoadActionCommand, ACTION_COMMAND_JUMP)
116 Call(action_command_jump_init)
117 Call(ShowActionHud, FALSE)
118 Call(action_command_jump_start, 37, 3)
119 Call(SetGoalToTarget, ACTOR_PLAYER)
120 Call(EnablePlayerBlur, ACTOR_BLUR_ENABLE)
121 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Sit, ANIM_Mario1_SpinJump)
122 Call(PlayerSuperJumpToGoal, 20, PLAYER_SUPER_JUMP_4)
123 Wait(7)
124 Call(PlayerSuperJumpToGoal, 3, PLAYER_SUPER_JUMP_5)
125 Call(EnablePlayerBlur, ACTOR_BLUR_DISABLE)
126 Wait(1)
129 Call(SetActionResult, LVarF)
130 ExecWait(N(EVS_JumpSupport_Rebound))
131 Return
132 End
133};
134
135EvtScript N(EVS_UseMove_Ultra) = {
136 ExecWait(N(EVS_JumpSupport_ApproachAndJump))
137 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_JUMP, 0, 0, 1, 0)
139 ExecWait(N(EVS_JumpSupport_Miss))
140 Return
141 EndIf
142 Wait(1)
143 Call(GetPlayerActionSuccess, LVar0)
145 CaseGt(FALSE)
155 ExecWait(N(EVS_JumpSupport_NoFollowUp))
156 Return
162 Call(GetActionResult, LVarF)
164 Call(UseBattleCamPreset, BTL_CAM_PLAYER_PRE_ULTRA_JUMP_FINISH)
165 Wait(5)
166 Call(SetGoalToTarget, ACTOR_PLAYER)
167 Call(UseBattleCamPreset, BTL_CAM_PLAYER_JUMP_FINISH)
169 Call(CloseActionCommandInfo)
170 Call(LoadActionCommand, ACTION_COMMAND_JUMP)
171 Call(action_command_jump_init)
172 Call(ShowActionHud, FALSE)
173 Call(action_command_jump_start, 25, 3)
174 Call(SetGoalToTarget, ACTOR_PLAYER)
175 Call(EnablePlayerBlur, ACTOR_BLUR_ENABLE)
176 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Jump, ANIM_Mario1_SpinFall)
177 Call(PlayerUltraJumpToGoal, 25, PLAYER_ULTRA_JUMP_4)
178 Call(EnablePlayerBlur, ACTOR_BLUR_DISABLE)
179 Wait(1)
182 Call(SetActionResult, LVarF)
183 ExecWait(N(EVS_JumpSupport_Rebound))
184 Return
185 End
186};
Bytecode EvtScript[]
@ ACTION_COMMAND_JUMP
Definition enums.h:3473
@ ACTOR_SOUND_HURT
Definition enums.h:2037
@ BS_FLAGS1_NO_RATING
Definition enums.h:3577
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3576
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3575
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3571
@ PLAYER_ULTRA_JUMP_4
Definition enums.h:4317
@ PLAYER_SUPER_JUMP_4
Definition enums.h:4307
@ PLAYER_SUPER_JUMP_5
Definition enums.h:4308
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1952
@ HIT_RESULT_HIT
Definition enums.h:1950
@ HIT_RESULT_NICE_NO_DAMAGE
Definition enums.h:1953
@ HIT_RESULT_NICE
Definition enums.h:1951
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_PLAYER_PRE_ULTRA_JUMP_FINISH
Definition enums.h:4850
@ BTL_CAM_PLAYER_PRE_JUMP_FINISH
Definition enums.h:4849
@ BTL_CAM_PLAYER_JUMP_FINISH
Definition enums.h:4857
@ PLAYER_BASIC_JUMP_3
Definition enums.h:4298
@ STATUS_FLAG_SLEEP
Definition enums.h:2812
@ SOUND_ACTOR_JUMPED_2
Definition enums.h:778
@ SOUND_ACTOR_JUMPED_1
Definition enums.h:777
@ SOUND_NONE
Definition enums.h:547
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_BLUR_ENABLE
Definition enums.h:6414
@ ACTOR_BLUR_DISABLE
Definition enums.h:6413
@ DAMAGE_TYPE_JUMP
Definition enums.h:2858
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:319
#define EndChildThread
Marks the end of a child thread block.
Definition macros.h:563
#define LVarF
Definition macros.h:163
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:341
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
Definition macros.h:337
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define LVar2
Definition macros.h:150
#define DMG_STATUS_KEY(typeFlag, duration, chance)
Definition macros.h:224
#define LVar1
Definition macros.h:149
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define ChildThread
Marks the start of a child thread block.
Definition macros.h:560
#define CaseGt(RVAR)
Marks the start of a switch case that executes only if LVAR <= RVAR. It also marks the end of any pre...
Definition macros.h:328
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217