Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
d_down_pound.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
3#include "effects.h"
4
5#define NAMESPACE battle_move_d_down_pound
6
8
9API_CALLABLE(func_802A10A4_74AE34) {
10 Bytecode* args = script->ptrReadPos;
11 s32 var0 = evt_get_variable(script, *args++);
12 s32 var1 = evt_get_variable(script, *args++);
13 s32 var2 = evt_get_variable(script, *args++);
14
15 if (script->varTable[10] == 0) {
16 fx_green_impact(TRUE, var0 + 30, var1 + 25, var2, 45.0f);
17 } else {
18 fx_green_impact(FALSE, var0 + 30, var1 + 25, var2, 45.0f);
19 }
20
21 return ApiStatus_DONE2;
22}
23
24extern EvtScript N(UseMove_Impl);
25
26EvtScript N(EVS_UseMove) = {
27 Call(ShowActionHud, TRUE)
28 Call(SetDamageSource, DMG_SRC_D_DOWN_POUND)
29 Call(GetMenuSelection, LVar0, LVar1, LVar2)
31 CaseEq(0)
32 Set(LVarD, 50)
33 Set(LVarE, 1)
34 Set(LVarF, 2)
35 ExecWait(N(UseMove_Impl))
36 CaseEq(1)
37 Set(LVarD, 50)
38 Set(LVarE, 2)
39 Set(LVarF, 4)
40 ExecWait(N(UseMove_Impl))
41 CaseEq(2)
42 Set(LVarD, 50)
43 Set(LVarE, 3)
44 Set(LVarF, 6)
45 ExecWait(N(UseMove_Impl))
47 Return
48 End
49};
50
51EvtScript N(UseMove_Impl) = {
52 Call(GetMenuSelection, LVar0, LVar1, LVar2)
54 CaseEq(0)
55 ExecWait(N(EVS_UseBasicHammer))
56 CaseEq(1)
57 ExecWait(N(EVS_UseSuperHammer))
58 CaseEq(2)
59 ExecWait(N(EVS_UseUltraHammer))
61 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_SMASH | DAMAGE_TYPE_IGNORE_DEFENSE, 25, 0, LVar9, 16)
62 Call(GetPlayerActionSuccess, LVar0)
64 CaseGt(FALSE)
65 Call(GetMenuSelection, LVar0, LVar1, LVar2)
67 CaseEq(0)
68 Call(StartRumble, BTL_RUMBLE_PLAYER_LIGHT)
69 Thread
70 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.3))
72 CaseEq(1)
73 Call(StartRumble, BTL_RUMBLE_PLAYER_HEAVY)
74 Thread
75 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.6))
77 CaseEq(2)
79 Thread
80 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.9))
84 Call(GetMenuSelection, LVar0, LVar1, LVar2)
86 CaseEq(0)
87 Call(StartRumble, BTL_RUMBLE_PLAYER_LIGHT)
88 Thread
89 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.3))
91 CaseEq(1)
92 Call(StartRumble, BTL_RUMBLE_PLAYER_HEAVY)
93 Thread
94 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.6))
96 CaseEq(2)
98 Thread
99 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.9))
103 Call(GetPlayerActionSuccess, LVar0)
104 IfGt(LVar0, FALSE)
105 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HAMMER_STRIKE)
106 Call(MoveBattleCamOver, 5)
107 Else
108 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HAMMER_STRIKE)
109 Call(MoveBattleCamOver, 50)
110 EndIf
111 Call(GetMenuSelection, LVar0, LVar1, LVar2)
113 CaseEq(0)
114 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_D_DOWN_HIT_1)
115 CaseEq(1)
116 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_D_DOWN_HIT_2)
117 CaseEq(2)
118 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_D_DOWN_HIT_3)
120 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_SMASH, 25, 0, 0, 16)
122 ExecWait(N(EVS_HammerSupport_ReturnHome_Miss))
123 Return
124 EndIf
125 Call(GetPlayerActionSuccess, LVarA)
126 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
127 Call(func_802A10A4_74AE34, LVar0, LVar1, LVar2)
128 Call(GetPlayerActionSuccess, LVar0)
130 CaseGt(FALSE)
138 ExecWait(N(EVS_HammerSupport_ReturnHome_Success))
142 ExecWait(N(EVS_HammerSupport_ReturnHome_Miss))
145 Return
146 End
147};
Bytecode EvtScript[]
@ 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_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_HAMMER_STRIKE
Definition enums.h:4866
#define SUPPRESS_EVENTS_HAMMER
Definition enums.h:2912
@ DMG_SRC_D_DOWN_POUND
Definition enums.h:1991
@ SOUND_D_DOWN_HIT_1
Definition enums.h:1547
@ SOUND_D_DOWN_HIT_3
Definition enums.h:1549
@ SOUND_D_DOWN_HIT_2
Definition enums.h:1548
@ BTL_RUMBLE_PLAYER_HEAVY
Definition enums.h:4261
@ BTL_RUMBLE_PLAYER_EXTREME
Definition enums.h:4262
@ BTL_RUMBLE_PLAYER_LIGHT
Definition enums.h:4260
@ ACTOR_PLAYER
Definition enums.h:2085
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_SMASH
Definition enums.h:2857
@ DAMAGE_TYPE_IGNORE_DEFENSE
Definition enums.h:2877
#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
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#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 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 IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
Definition macros.h:278
#define Float(DOUBLE)
Definition macros.h:51
#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 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 LVarA
Definition macros.h:158
#define LVarD
Definition macros.h:161
#define LVar9
Definition macros.h:157
#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 LVarE
Definition macros.h:162
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217