Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
d_down_jump.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
4#include "effects.h"
5#include "sprite/player.h"
6
7#define NAMESPACE battle_move_d_down_jump
8
10
11API_CALLABLE(N(func_802A10E4_781A04)) {
12 Bytecode* args = script->ptrReadPos;
13 s32 var0 = evt_get_variable(script, *args++);
14 s32 var1 = evt_get_variable(script, *args++);
15 s32 var2 = evt_get_variable(script, *args++);
16
17 if (script->varTable[10] == 0) {
18 fx_green_impact(TRUE, var0, var1, var2, 0.0f);
19 } else {
20 fx_green_impact(FALSE, var0, var1, var2, 0.0f);
21 }
22
23 return ApiStatus_DONE2;
24}
25
26extern EvtScript N(EVS_UseMove_Normal);
27extern EvtScript N(EVS_UseMove_Super);
28extern EvtScript N(EVS_UseMove_Ultra);
29
30EvtScript N(EVS_UseMove) = {
31 Call(ShowActionHud, TRUE)
32 Call(SetDamageSource, DMG_SRC_D_DOWN_JUMP)
33 Call(GetMenuSelection, LVar0, LVar1, LVar2)
35 CaseEq(0)
36 ExecWait(N(EVS_UseMove_Normal))
37 CaseEq(1)
38 ExecWait(N(EVS_UseMove_Super))
39 CaseEq(2)
40 ExecWait(N(EVS_UseMove_Ultra))
42 Return
43 End
44};
45
46EvtScript N(EVS_UseMove_Normal) = {
47 ExecWait(N(EVS_JumpSupport_ApproachAndJump))
48 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_JUMP, 0, 0, 1, 0)
50 ExecWait(N(EVS_JumpSupport_Miss))
51 Return
52 EndIf
53 Call(GetPlayerActionSuccess, LVarA)
54 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
55 Call(N(func_802A10E4_781A04), LVar0, LVar1, LVar2)
56 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_D_DOWN_HIT_1)
57 Wait(1)
58 Call(GetPlayerActionSuccess, LVar0)
60 CaseGt(FALSE)
62 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_ACTOR_JUMPED_1)
71 ExecWait(N(EVS_JumpSupport_NoFollowUp))
72 Return
79 Call(UseBattleCamPreset, BTL_CAM_PLAYER_PRE_JUMP_FINISH)
80 Wait(5)
81 Call(SetGoalToTarget, ACTOR_PLAYER)
82 Call(UseBattleCamPreset, BTL_CAM_PLAYER_JUMP_FINISH)
84 Call(GetActionResult, LVarF)
85 Call(CloseActionCommandInfo)
86 Call(LoadActionCommand, ACTION_COMMAND_JUMP)
87 Call(action_command_jump_init)
88 Call(ShowActionHud, FALSE)
89 Call(action_command_jump_start, 24, 3)
90 Call(SetGoalToTarget, ACTOR_PLAYER)
91 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_SpinFall)
92 Call(PlayerBasicJumpToGoal, 24, PLAYER_BASIC_JUMP_3)
93 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
94 Call(N(func_802A10E4_781A04), LVar0, LVar1, LVar2)
95 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_D_DOWN_HIT_1)
96 Wait(1)
99 Call(SetActionResult, LVarF)
100 ExecWait(N(EVS_JumpSupport_Rebound))
101 Return
102 End
103};
104
105EvtScript N(EVS_UseMove_Super) = {
106 ExecWait(N(EVS_JumpSupport_ApproachAndJump))
107 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_JUMP, 0, 0, 1, 0)
109 ExecWait(N(EVS_JumpSupport_Miss))
110 Return
111 EndIf
112 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
113 Call(N(func_802A10E4_781A04), LVar0, LVar1, LVar2)
114 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_D_DOWN_HIT_2)
115 Wait(1)
116 Call(GetPlayerActionSuccess, LVar0)
118 CaseGt(FALSE)
128 ExecWait(N(EVS_JumpSupport_NoFollowUp))
129 Return
135 Call(GetActionResult, LVarF)
137 Call(UseBattleCamPreset, BTL_CAM_PLAYER_PRE_JUMP_FINISH)
138 Wait(5)
139 Call(SetGoalToTarget, ACTOR_PLAYER)
140 Call(UseBattleCamPreset, BTL_CAM_PLAYER_JUMP_FINISH)
142 Call(CloseActionCommandInfo)
143 Call(LoadActionCommand, ACTION_COMMAND_JUMP)
144 Call(action_command_jump_init)
145 Call(ShowActionHud, FALSE)
146 Call(action_command_jump_start, 37, 3)
147 Call(SetGoalToTarget, ACTOR_PLAYER)
148 Call(EnablePlayerBlur, ACTOR_BLUR_ENABLE)
149 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Sit, ANIM_Mario1_SpinJump)
150 Call(PlayerSuperJumpToGoal, 20, PLAYER_SUPER_JUMP_4)
151 Wait(7)
152 Call(PlayerSuperJumpToGoal, 3, PLAYER_SUPER_JUMP_5)
153 Call(EnablePlayerBlur, ACTOR_BLUR_DISABLE)
154 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
155 Call(N(func_802A10E4_781A04), LVar0, LVar1, LVar2)
156 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_D_DOWN_HIT_2)
157 Wait(1)
160 Call(SetActionResult, LVarF)
161 ExecWait(N(EVS_JumpSupport_Rebound))
162 Return
163 End
164};
165
166EvtScript N(EVS_UseMove_Ultra) = {
167 ExecWait(N(EVS_JumpSupport_ApproachAndJump))
168 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_JUMP, 0, 0, 1, 0)
170 ExecWait(N(EVS_JumpSupport_Miss))
171 Return
172 EndIf
173 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
174 Call(N(func_802A10E4_781A04), LVar0, LVar1, LVar2)
175 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_D_DOWN_HIT_3)
176 Wait(1)
177 Call(GetPlayerActionSuccess, LVar0)
179 CaseGt(FALSE)
189 ExecWait(N(EVS_JumpSupport_NoFollowUp))
190 Return
196 Call(GetActionResult, LVarF)
198 Call(UseBattleCamPreset, BTL_CAM_PLAYER_PRE_ULTRA_JUMP_FINISH)
199 Wait(5)
200 Call(SetGoalToTarget, ACTOR_PLAYER)
201 Call(UseBattleCamPreset, BTL_CAM_PLAYER_JUMP_FINISH)
203 Call(CloseActionCommandInfo)
204 Call(LoadActionCommand, ACTION_COMMAND_JUMP)
205 Call(action_command_jump_init)
206 Call(ShowActionHud, FALSE)
207 Call(action_command_jump_start, 25, 3)
208 Call(SetGoalToTarget, ACTOR_PLAYER)
209 Call(EnablePlayerBlur, ACTOR_BLUR_ENABLE)
210 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Jump, ANIM_Mario1_SpinFall)
211 Call(PlayerUltraJumpToGoal, 25, PLAYER_ULTRA_JUMP_4)
212 Call(EnablePlayerBlur, ACTOR_BLUR_DISABLE)
213 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
214 Call(N(func_802A10E4_781A04), LVar0, LVar1, LVar2)
215 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_D_DOWN_HIT_3)
216 Wait(1)
219 Call(SetActionResult, LVarF)
220 ExecWait(N(EVS_JumpSupport_Rebound))
221 Return
222 End
223};
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
@ DMG_SRC_D_DOWN_JUMP
Definition enums.h:1992
@ SOUND_ACTOR_JUMPED_2
Definition enums.h:778
@ SOUND_D_DOWN_HIT_1
Definition enums.h:1547
@ SOUND_ACTOR_JUMPED_1
Definition enums.h:777
@ SOUND_NONE
Definition enums.h:547
@ SOUND_D_DOWN_HIT_3
Definition enums.h:1549
@ SOUND_ACTOR_JUMPED_3
Definition enums.h:779
@ SOUND_D_DOWN_HIT_2
Definition enums.h:1548
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_BLUR_ENABLE
Definition enums.h:6414
@ ACTOR_BLUR_DISABLE
Definition enums.h:6413
@ DAMAGE_TYPE_IGNORE_DEFENSE
Definition enums.h:2877
@ DAMAGE_TYPE_JUMP
Definition enums.h:2858
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
#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 LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#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