Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
hammer_charge_2.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_2
6
8
10
12
13API_CALLABLE(func_802A10C8_75E698) {
14 Bytecode* args = script->ptrReadPos;
16 s32 var1 = evt_get_variable(script, *args++);
17 s32 var2 = evt_get_variable(script, *args++);
18 s32 var3 = evt_get_variable(script, *args++);
19 s32* var4;
20
21 fx_stat_change(2, var1, var2, var3, 1.0f, 60);
23 *var4 = 0;
24 if (battleStatus->hammerCharge > 0) {
25 *var4 = 1;
26 }
27
28 battleStatus->hammerCharge += 3;
29
30 if (battleStatus->hammerCharge > 99) {
31 battleStatus->hammerCharge = 99;
32 }
33
34 battleStatus->jumpCharge = 0;
37
38 return ApiStatus_DONE2;
39}
40
42
43API_CALLABLE(func_802A12FC_75E8CC) {
44 if (D_802A4350 == 0) {
45 script->varTable[0] = 4;
46 } else {
47 script->varTable[0] = 5;
48 }
49
50 return ApiStatus_DONE2;
51}
52
54
58 CaseEq(0)
59 Set(LVarD, 65) // duration
63 CaseEq(1)
64 Set(LVarD, 65) // duration
68 CaseEq(2)
69 Set(LVarD, 65) // duration
74 Return
75 End
76};
77
81 CaseEq(0)
83 CaseEq(1)
85 CaseEq(2)
94 CaseEq(0)
96 Thread
97 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.3))
99 CaseEq(1)
101 Thread
102 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.6))
104 CaseEq(2)
106 Thread
107 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.9))
113 CaseEq(0)
115 Thread
116 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.3))
118 CaseEq(1)
120 Thread
121 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.6))
123 CaseEq(2)
125 Thread
126 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.9))
134 Return
135 EndIf
142 CaseEq(0)
144 CaseEq(1)
146 CaseEq(2)
150 Set(LFlag0, TRUE)
154 CaseEq(0)
156 CaseEq(1)
158 CaseEq(2)
174 Return
175 End
176};
177
181
185 CaseEq(0)
187 CaseEq(1)
189 CaseEq(2)
192 Return
193 End
194};
195
198 Wait(10)
199 Thread
201 Wait(8)
203 Wait(8)
208 Wait(3)
210 Wait(30)
214 IfEq(LVar0, 0)
216 Add(LVar0, 15)
217 Add(LVar1, 35)
220 Wait(4)
227 Call(PlayerHopToGoal, 20, 0, 0)
229 Wait(4)
233 Else
235 EndIf
236 Label(0)
237 Wait(1)
239 IfEq(LVar0, TRUE)
240 Goto(0)
241 EndIf
242 Return
243 End
244};
245
248 Wait(10)
249 Thread
251 Wait(8)
253 Wait(8)
258 Wait(3)
260 Wait(30)
264 IfEq(LVar0, 0)
266 Add(LVar0, 15)
267 Add(LVar1, 35)
270 Wait(4)
277 Call(PlayerHopToGoal, 20, 0, 0)
279 Wait(4)
283 Else
285 EndIf
286 Label(0)
287 Wait(1)
289 IfEq(LVar0, TRUE)
290 Goto(0)
291 EndIf
292 Return
293 End
294};
295
298 Wait(10)
299 Thread
301 Wait(8)
303 Wait(8)
308 Wait(3)
310 Wait(30)
314 IfEq(LVar0, 0)
316 Add(LVar0, 15)
317 Add(LVar1, 35)
320 Wait(4)
327 Call(PlayerHopToGoal, 20, 0, 0)
329 Wait(4)
333 Else
335 EndIf
336 Label(0)
337 Wait(1)
339 IfEq(LVar0, TRUE)
340 Goto(0)
341 EndIf
342 Return
343 End
344};
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
@ 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
BSS s32 D_802A4350
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 BSS
Definition macros.h:7
#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