Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
hammer_throw.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3#include "entity.h"
4#include "sprite/player.h"
5#include "include_asset.h"
6
7#define NAMESPACE battle_move_hammer_throw
8
10
11static s32 pad_images = 0;
12
13INCLUDE_IMG("battle/move/hammer/dusty_hammer.png", battle_move_hammer_throw_dusty_hammer_png);
14INCLUDE_PAL("battle/move/hammer/dusty_hammer.pal", battle_move_hammer_throw_dusty_hammer_pal);
15
16INCLUDE_IMG("battle/move/hammer/basic_hammer.png", battle_move_hammer_throw_basic_hammer_png);
17INCLUDE_PAL("battle/move/hammer/basic_hammer.pal", battle_move_hammer_throw_basic_hammer_pal);
18
19INCLUDE_IMG("battle/move/hammer/super_hammer.png", battle_move_hammer_throw_super_hammer_png);
20INCLUDE_PAL("battle/move/hammer/super_hammer.pal", battle_move_hammer_throw_super_hammer_pal);
21
22INCLUDE_IMG("battle/move/hammer/ultra_hammer.png", battle_move_hammer_throw_ultra_hammer_png);
23INCLUDE_PAL("battle/move/hammer/ultra_hammer.pal", battle_move_hammer_throw_ultra_hammer_pal);
24
25#include "battle/move/hammer/hammer_throw.vtx.inc.c"
26
27#include "battle/move/hammer/dusty_hammer.gfx.inc.c"
28#include "battle/move/hammer/basic_hammer.gfx.inc.c"
29#include "battle/move/hammer/super_hammer.gfx.inc.c"
30#include "battle/move/hammer/ultra_hammer.gfx.inc.c"
31
36
38
43 CaseEq(0)
44 Set(LVarD, 50) // duration
48 CaseEq(1)
49 Set(LVarD, 50) // duration
53 CaseEq(2)
54 Set(LVarD, 50) // duration
59 Return
60 End
61};
62
66 Set(LVar1, 0)
67 Loop(10)
72 EndIf
73 Wait(1)
74 Add(LVar1, 1)
79 CaseLt(3)
80 Wait(4)
81 CaseLt(5)
82 Wait(3)
83 CaseLt(7)
84 Wait(2)
85 CaseLt(9)
86 Wait(1)
87 CaseLt(11)
88 Wait(0)
90 Return
91 End
92};
93
97 Set(LVar1, 0)
98 Loop(10)
100 IfEq(LVar0, TRUE)
103 EndIf
104 Wait(1)
105 Add(LVar1, 1)
107 EndLoop
110 CaseLt(3)
111 Wait(4)
112 CaseLt(5)
113 Wait(3)
114 CaseLt(7)
115 Wait(2)
116 CaseLt(9)
117 Wait(1)
118 CaseLt(11)
119 Wait(0)
121 Return
122 End
123};
124
127 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
128 Set(LVar1, 0)
129 Loop(10)
131 IfEq(LVar0, TRUE)
134 EndIf
135 Wait(1)
136 Add(LVar1, 1)
138 EndLoop
141 CaseLt(3)
142 Wait(4)
143 CaseLt(5)
144 Wait(3)
145 CaseLt(7)
146 Wait(2)
147 CaseLt(9)
148 Wait(1)
149 CaseLt(11)
150 Wait(0)
152 Return
153 End
154};
155
161 Add(LVar0, 16)
166 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
169 CaseEq(0)
171 CaseEq(1)
173 CaseEq(2)
183 CaseEq(0)
185 Wait(4)
187 CaseEq(1)
189 Wait(4)
191 CaseEq(2)
193 Wait(4)
199 IfEq(LVar0, 0)
200 Loop(45)
201 Wait(1)
205 EndIf
206 EndLoop
207 EndIf
208 Add(LVarD, 6)
211 Set(LVar1, 0)
212 Loop(30)
213 Wait(1)
215 IfNe(LVar0, 0)
216 IfNe(LVar1, 1)
219 CaseEq(0)
221 CaseEq(1)
223 CaseEq(2)
226 Set(LVar1, 1)
227 EndIf
228 EndIf
232 EndIf
233 EndLoop
234 Else
235 Wait(10)
238 CaseEq(0)
240 CaseEq(1)
242 CaseEq(2)
245 Wait(30)
246 EndIf
249 Loop(0)
250 Wait(1)
252 IfNe(LVar0, 0)
254 EndIf
255 EndLoop
256 EndIf
259 CaseEq(0)
262 CaseEq(1)
265 CaseEq(2)
269 Wait(3)
272 CaseEq(0)
274 CaseEq(1)
276 CaseEq(2)
280 Add(LVar0, 20)
281 Add(LVar1, 42)
282 Add(LVar2, 5)
284 Call(SetVirtualEntityScale, LVarA, Float(0.6), Float(0.6), Float(0.6))
291 Thread
292 Set(LVar0, 0)
293 Loop(9)
294 Add(LVar0, 60)
296 Wait(1)
297 EndLoop
300 Add(LVar2, 5)
303 Thread
304 Set(LVar0, 0)
305 Loop(18)
306 Add(LVar0, 60)
308 Wait(1)
309 EndLoop
312 Add(LVar2, 5)
321 Return
322 EndIf
323 Thread
328 Add(LVar0, 60)
329 Add(LVar1, 0)
334 Add(LVar0, 40)
335 Add(LVar1, 0)
345 CaseEq(0)
347 Thread
348 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.3))
350 CaseEq(1)
352 Thread
353 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.6))
355 CaseEq(2)
357 Thread
358 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.9))
364 CaseEq(0)
366 Thread
367 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.3))
369 CaseEq(1)
371 Thread
372 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.6))
374 CaseEq(2)
376 Thread
377 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.9))
385 CaseEq(0)
387 CaseEq(1)
389 CaseEq(2)
397 CaseEq(0)
399 CaseEq(1)
401 CaseEq(2)
408 CaseEq(0)
410 CaseEq(1)
412 CaseEq(2)
427 Return
428 End
429};
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
@ AC_DIFFICULTY_3
Definition action_cmd.h:45
@ AC_MODE_NOT_LEARNED
Definition action_cmd.h:60
Bytecode EvtScript[]
s32 EntityModelScript[]
Definition entity.h:7
#define STANDARD_ENTITY_MODEL_SCRIPT(gfx, renderMode)
Definition entity.h:56
@ ACTION_COMMAND_SMASH
Definition enums.h:3474
@ BUTTON_STICK_LEFT
Definition enums.h:2793
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3575
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3574
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3570
@ 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:4865
@ BTL_CAM_PLAYER_ATTACK_APPROACH
Definition enums.h:4847
#define SUPPRESS_EVENTS_HAMMER
Definition enums.h:2912
@ SOUND_HIT_SILENT
Definition enums.h:747
@ SOUND_HAMMER_SWING_3
Definition enums.h:1556
@ SOUND_D_DOWN_HIT_1
Definition enums.h:1547
@ SOUND_D_DOWN_HIT_3
Definition enums.h:1549
@ SOUND_HAMMER_SWING_1
Definition enums.h:1554
@ SOUND_HIT_NORMAL
Definition enums.h:724
@ SOUND_HAMMER_SWING_2
Definition enums.h:1555
@ SOUND_HAMMER_WINDUP
Definition enums.h:744
@ SOUND_D_DOWN_HIT_2
Definition enums.h:1548
@ RENDER_MODE_ALPHATEST
Definition enums.h:3276
@ 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
@ ACTOR_SELF
Definition enums.h:2084
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_THROW
Definition enums.h:2869
@ DAMAGE_TYPE_SMASH
Definition enums.h:2857
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
#define INCLUDE_PAL(FILENAME, SYMBOLNAME)
#define INCLUDE_IMG(FILENAME, SYMBOLNAME)
ApiStatus CreateVirtualEntity(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityPosition(Evt *script, b32 isInitialCall)
ApiStatus VirtualEntityLandJump(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityJumpGravity(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityScale(Evt *script, b32 isInitialCall)
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
ApiStatus DeleteVirtualEntity(Evt *script, b32 isInitialCall)
ApiStatus VirtualEntityJumpTo(Evt *script, b32 isInitialCall)
ApiStatus SetVirtualEntityRotation(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 Ref(sym)
Address/pointer constant.
Definition macros.h:60
#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 IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#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 EndLoop
Marks the end of a loop.
Definition macros.h:248
#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 LVar5
Definition macros.h:153
#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 BreakLoop
Breaks out of the innermost loop.
Definition macros.h:251
#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 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 CaseLt(RVAR)
Marks the start of a switch case that executes only if LVAR < RVAR. It also marks the end of any prev...
Definition macros.h:325
#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 Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar4
Definition macros.h:152
#define LVar3
Definition macros.h:151
#define LVarE
Definition macros.h:162
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217