Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
mega_jump.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
4
5#define NAMESPACE battle_move_mega_jump
6
8
9extern EvtScript N(EVS_UseMove_Basic);
10extern EvtScript N(EVS_UseMove_Super);
11extern EvtScript N(EVS_UseMove_Ultra);
12
13EvtScript N(EVS_UseMove) = {
14 Call(EnablePlayerBlur, ACTOR_BLUR_ENABLE)
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 Call(EnablePlayerBlur, ACTOR_BLUR_DISABLE)
26 Return
27 End
28};
29
30EvtScript N(EVS_PlayQuakeFX) = {
31 Call(StartRumble, BTL_RUMBLE_PLAYER_MAX)
32 Thread
33 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.0))
34 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(3.0))
35 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(6.0))
36 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(5.0))
37 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(4.0))
38 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(3.0))
39 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(2.0))
40 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.0))
41 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.5))
42 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.2))
44 Return
45 End
46};
47
48EvtScript N(EVS_UseMove_Basic) = {
49 ExecWait(N(EVS_JumpSupport_ApproachAndJump))
50 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_JUMP, 0, 0, 1, 0)
52 ExecWait(N(EVS_JumpSupport_Miss))
53 Return
54 EndIf
55 ExecWait(N(EVS_PlayQuakeFX))
56 Wait(1)
57 Call(GetPlayerActionSuccess, LVar0)
59 CaseGt(FALSE)
68 ExecWait(N(EVS_JumpSupport_Rebound))
70 ExecWait(N(EVS_JumpSupport_WeakRebound))
72 Return
73 End
74};
75
76EvtScript N(EVS_UseMove_Super) = {
77 ExecWait(N(EVS_JumpSupport_ApproachAndJump))
78 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_JUMP, 0, 0, 1, 0)
80 ExecWait(N(EVS_JumpSupport_Miss))
81 Return
82 EndIf
83 ExecWait(N(EVS_PlayQuakeFX))
84 Wait(1)
85 Call(GetPlayerActionSuccess, LVar0)
87 CaseGt(FALSE)
96 ExecWait(N(EVS_JumpSupport_Rebound))
98 ExecWait(N(EVS_JumpSupport_WeakRebound))
100 Return
101 End
102};
103
104EvtScript N(EVS_UseMove_Ultra) = {
105 ExecWait(N(EVS_JumpSupport_ApproachAndJump))
106 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_JUMP, 0, 0, 1, 0)
108 ExecWait(N(EVS_JumpSupport_Miss))
109 Return
110 EndIf
111 ExecWait(N(EVS_PlayQuakeFX))
112 Wait(1)
113 Call(GetPlayerActionSuccess, LVar0)
115 CaseGt(FALSE)
124 ExecWait(N(EVS_JumpSupport_Rebound))
126 ExecWait(N(EVS_JumpSupport_WeakRebound))
128 Return
129 End
130};
Bytecode EvtScript[]
@ ACTOR_SOUND_HURT
Definition enums.h:2037
@ 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
@ HIT_RESULT_HIT
Definition enums.h:1950
@ HIT_RESULT_MISS
Definition enums.h:1956
@ SOUND_ACTOR_JUMPED_2
Definition enums.h:778
@ SOUND_ACTOR_JUMPED_1
Definition enums.h:777
@ SOUND_NONE
Definition enums.h:547
@ SOUND_ACTOR_JUMPED_3
Definition enums.h:779
@ BTL_RUMBLE_PLAYER_MAX
Definition enums.h:4263
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_BLUR_ENABLE
Definition enums.h:6414
@ ACTOR_BLUR_DISABLE
Definition enums.h:6413
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_JUMP
Definition enums.h:2858
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
#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 End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Float(DOUBLE)
Definition macros.h:51
#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 Thread
Marks the start of a thread block.
Definition macros.h:544
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#define LVar2
Definition macros.h:150
#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 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