Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
hammer_charge_0.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3#include "sprite/player.h"
4
5#define NAMESPACE battle_move_hammer_charge_0
6
8
10
11API_CALLABLE(func_802A10C8_74F1F8) {
12 Bytecode* args = script->ptrReadPos;
14 s32 var1 = evt_get_variable(script, *args++);
15 s32 var2 = evt_get_variable(script, *args++);
16 s32 var3 = evt_get_variable(script, *args++);
17
18 fx_stat_change(0, var1, var2, var3, 1.0f, 60);
19
20 battleStatus->hammerCharge++;
21 if (battleStatus->hammerCharge > 99) {
22 battleStatus->hammerCharge = 99;
23 }
24
25 battleStatus->jumpCharge = 0;
28
29 return ApiStatus_DONE2;
30}
31
32API_CALLABLE(func_802A11CC_74F2FC) {
33 Bytecode* args = script->ptrReadPos;
34 s32 var0 = evt_get_variable(script, *args++);
35 s32 var1 = evt_get_variable(script, *args++);
36 s32 var2 = evt_get_variable(script, *args++);
37 f32 var3 = evt_get_float_variable(script, *args++);
38
39 fx_energy_in_out(6, var0 + 10, var1 + 18, var2, var3, 45);
40
41 return ApiStatus_DONE2;
42}
43
45
49 CaseEq(0)
50 Set(LVarD, 65) // duration
54 CaseEq(1)
55 Set(LVarD, 65) // duration
59 CaseEq(2)
60 Set(LVarD, 65) // duration
65 Return
66 End
67};
68
72 CaseEq(0)
74 CaseEq(1)
76 CaseEq(2)
85 CaseEq(0)
87 Thread
88 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.3))
90 CaseEq(1)
92 Thread
93 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.6))
95 CaseEq(2)
97 Thread
98 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.9))
104 CaseEq(0)
106 Thread
107 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.3))
109 CaseEq(1)
111 Thread
112 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.6))
114 CaseEq(2)
116 Thread
117 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.9))
125 Return
126 EndIf
133 CaseEq(0)
135 CaseEq(1)
137 CaseEq(2)
141 Set(LFlag0, TRUE)
145 CaseEq(0)
147 CaseEq(1)
149 CaseEq(2)
165 Return
166 End
167};
168
172
176 CaseEq(0)
178 CaseEq(1)
180 CaseEq(2)
183 Return
184 End
185};
186
189 Wait(10)
190 Thread
192 Wait(8)
194 Wait(8)
199 Wait(3)
201 Wait(30)
205 IfEq(LVar0, 0)
207 Add(LVar0, 15)
208 Add(LVar1, 35)
211 Wait(4)
218 Call(PlayerHopToGoal, 20, 0, 0)
220 Wait(4)
224 Else
226 EndIf
227 Label(0)
228 Wait(1)
230 IfEq(LVar0, TRUE)
231 Goto(0)
232 EndIf
234 Return
235 End
236};
237
240 Wait(10)
241 Thread
243 Wait(8)
245 Wait(8)
250 Wait(3)
252 Wait(30)
256 IfEq(LVar0, 0)
258 Add(LVar0, 15)
259 Add(LVar1, 35)
262 Wait(4)
269 Call(PlayerHopToGoal, 20, 0, 0)
271 Wait(4)
275 Else
277 EndIf
278 Label(0)
279 Wait(1)
281 IfEq(LVar0, TRUE)
282 Goto(0)
283 EndIf
285 Return
286 End
287};
288
291 Wait(10)
292 Thread
294 Wait(8)
296 Wait(8)
301 Wait(3)
303 Wait(30)
307 IfEq(LVar0, 0)
309 Add(LVar0, 15)
310 Add(LVar1, 35)
313 Wait(4)
320 Call(PlayerHopToGoal, 20, 0, 0)
322 Wait(4)
326 Else
328 EndIf
329 Label(0)
330 Wait(1)
332 IfEq(LVar0, TRUE)
333 Goto(0)
334 EndIf
336 Return
337 End
338};
BSS s32 PopupMenu_SelectedIndex
#define BASIC_HAMMER_DMG_GOOD
#define SUPER_HAMMER_DMG_GOOD
#define BASIC_HAMMER_DMG_BAD
#define ULTRA_HAMMER_DMG_GOOD
#define SUPER_HAMMER_DMG_BAD
#define ULTRA_HAMMER_DMG_BAD
Bytecode EvtScript[]
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3574
@ BS_FLAGS1_HAMMER_CHARGED
Definition enums.h:3596
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3570
@ BTL_MSG_CANT_CHARGE
Definition enums.h:4065
@ BTL_MSG_CHARGE_HAMMER
Definition enums.h:4061
@ 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_DEFAULT
Definition enums.h:4823
@ BTL_CAM_PLAYER_HAMMER_STRIKE
Definition enums.h:4865
@ BTL_CAM_PLAYER_CHARGE_UP
Definition enums.h:4853
#define SUPPRESS_EVENTS_HAMMER
Definition enums.h:2912
@ SOUND_HIT_SILENT
Definition enums.h:747
@ SOUND_PLAYER_CHARGE
Definition enums.h:774
@ SOUND_HIT_NORMAL
Definition enums.h:724
@ SOUND_CHARGE_UP
Definition enums.h:1436
@ SOUND_LONG_PLAYER_JUMP
Definition enums.h:782
@ BTL_RUMBLE_PLAYER_MIN
Definition enums.h:4258
@ BTL_RUMBLE_PLAYER_HEAVY
Definition enums.h:4260
@ BTL_RUMBLE_PLAYER_LIGHT
Definition enums.h:4259
@ ACTOR_PLAYER
Definition enums.h:2085
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_SMASH
Definition enums.h:2857
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1689
f32 evt_get_float_variable(Evt *script, Bytecode var)
Definition evt.c:1929
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 Add(VAR, INT_VALUE)
Definition macros.h:376
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define Float(DOUBLE)
Definition macros.h:51
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#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 LFlag0
Definition macros.h:167
#define LVarD
Definition macros.h:161
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#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
BattleStatus gBattleStatus
Definition battle.c:11