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
11
12INCLUDE_IMG("battle/move/hammer/dusty_hammer.png", battle_move_hammer_throw_dusty_hammer_png);
13INCLUDE_PAL("battle/move/hammer/dusty_hammer.pal", battle_move_hammer_throw_dusty_hammer_pal);
14
15INCLUDE_IMG("battle/move/hammer/basic_hammer.png", battle_move_hammer_throw_basic_hammer_png);
16INCLUDE_PAL("battle/move/hammer/basic_hammer.pal", battle_move_hammer_throw_basic_hammer_pal);
17
18INCLUDE_IMG("battle/move/hammer/super_hammer.png", battle_move_hammer_throw_super_hammer_png);
19INCLUDE_PAL("battle/move/hammer/super_hammer.pal", battle_move_hammer_throw_super_hammer_pal);
20
21INCLUDE_IMG("battle/move/hammer/ultra_hammer.png", battle_move_hammer_throw_ultra_hammer_png);
22INCLUDE_PAL("battle/move/hammer/ultra_hammer.pal", battle_move_hammer_throw_ultra_hammer_pal);
23
24#include "battle/move/hammer/hammer_throw.vtx.inc.c"
25
26#include "battle/move/hammer/dusty_hammer.gfx.inc.c"
27#include "battle/move/hammer/basic_hammer.gfx.inc.c"
28#include "battle/move/hammer/super_hammer.gfx.inc.c"
29#include "battle/move/hammer/ultra_hammer.gfx.inc.c"
30
35
37
39 Call(ShowActionHud, true)
42 CaseEq(0)
43 Set(LVarD, 50) // duration
47 CaseEq(1)
48 Set(LVarD, 50) // duration
52 CaseEq(2)
53 Set(LVarD, 50) // duration
58 Return
59 End
60};
61
65 Set(LVar1, 0)
66 Loop(10)
71 EndIf
72 Wait(1)
73 Add(LVar1, 1)
78 CaseLt(3)
79 Wait(4)
80 CaseLt(5)
81 Wait(3)
82 CaseLt(7)
83 Wait(2)
84 CaseLt(9)
85 Wait(1)
86 CaseLt(11)
87 Wait(0)
89 Return
90 End
91};
92
96 Set(LVar1, 0)
97 Loop(10)
102 EndIf
103 Wait(1)
104 Add(LVar1, 1)
106 EndLoop
109 CaseLt(3)
110 Wait(4)
111 CaseLt(5)
112 Wait(3)
113 CaseLt(7)
114 Wait(2)
115 CaseLt(9)
116 Wait(1)
117 CaseLt(11)
118 Wait(0)
120 Return
121 End
122};
123
126 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
127 Set(LVar1, 0)
128 Loop(10)
130 IfEq(LVar0, true)
133 EndIf
134 Wait(1)
135 Add(LVar1, 1)
137 EndLoop
140 CaseLt(3)
141 Wait(4)
142 CaseLt(5)
143 Wait(3)
144 CaseLt(7)
145 Wait(2)
146 CaseLt(9)
147 Wait(1)
148 CaseLt(11)
149 Wait(0)
151 Return
152 End
153};
154
160 Add(LVar0, 16)
165 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
168 CaseEq(0)
170 CaseEq(1)
172 CaseEq(2)
182 CaseEq(0)
184 Wait(4)
186 CaseEq(1)
188 Wait(4)
190 CaseEq(2)
192 Wait(4)
198 IfEq(LVar0, 0)
199 Loop(45)
200 Wait(1)
204 EndIf
205 EndLoop
206 EndIf
207 Add(LVarD, 6)
210 Set(LVar1, 0)
211 Loop(30)
212 Wait(1)
214 IfNe(LVar0, 0)
215 IfNe(LVar1, 1)
218 CaseEq(0)
220 CaseEq(1)
222 CaseEq(2)
225 Set(LVar1, 1)
226 EndIf
227 EndIf
231 EndIf
232 EndLoop
233 Else
234 Wait(10)
237 CaseEq(0)
239 CaseEq(1)
241 CaseEq(2)
244 Wait(30)
245 EndIf
248 Loop(0)
249 Wait(1)
251 IfNe(LVar0, 0)
253 EndIf
254 EndLoop
255 EndIf
258 CaseEq(0)
261 CaseEq(1)
264 CaseEq(2)
268 Wait(3)
271 CaseEq(0)
273 CaseEq(1)
275 CaseEq(2)
279 Add(LVar0, 20)
280 Add(LVar1, 42)
281 Add(LVar2, 5)
283 Call(SetVirtualEntityScale, LVarA, Float(0.6), Float(0.6), Float(0.6))
290 Thread
291 Set(LVar0, 0)
292 Loop(9)
293 Add(LVar0, 60)
295 Wait(1)
296 EndLoop
299 Add(LVar2, 5)
302 Thread
303 Set(LVar0, 0)
304 Loop(18)
305 Add(LVar0, 60)
307 Wait(1)
308 EndLoop
311 Add(LVar2, 5)
320 Return
321 EndIf
322 Thread
327 Add(LVar0, 60)
328 Add(LVar1, 0)
333 Add(LVar0, 40)
334 Add(LVar1, 0)
344 CaseEq(0)
346 Thread
347 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.3))
349 CaseEq(1)
351 Thread
352 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.6))
354 CaseEq(2)
356 Thread
357 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.9))
363 CaseEq(0)
365 Thread
366 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.3))
368 CaseEq(1)
370 Thread
371 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.6))
373 CaseEq(2)
375 Thread
376 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.9))
384 CaseEq(0)
386 CaseEq(1)
388 CaseEq(2)
396 CaseEq(0)
398 CaseEq(1)
400 CaseEq(2)
407 CaseEq(0)
409 CaseEq(1)
411 CaseEq(2)
426 Return
427 End
428};
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:3508
@ BUTTON_STICK_LEFT
Definition enums.h:2779
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3609
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3608
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3604
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1978
@ HIT_RESULT_HIT
Definition enums.h:1976
@ HIT_RESULT_NICE_NO_DAMAGE
Definition enums.h:1979
@ HIT_RESULT_NICE
Definition enums.h:1977
@ HIT_RESULT_MISS
Definition enums.h:1982
@ BTL_CAM_PLAYER_HAMMER_STRIKE
Definition enums.h:4451
@ BTL_CAM_PLAYER_ATTACK_APPROACH
Definition enums.h:4433
#define SUPPRESS_EVENTS_HAMMER
Definition enums.h:2946
@ SOUND_HIT_SILENT
Definition enums.h:750
@ SOUND_HAMMER_SWING_3
Definition enums.h:1559
@ SOUND_D_DOWN_HIT_1
Definition enums.h:1550
@ SOUND_D_DOWN_HIT_3
Definition enums.h:1552
@ SOUND_HAMMER_SWING_1
Definition enums.h:1557
@ SOUND_HIT_NORMAL
Definition enums.h:727
@ SOUND_HAMMER_SWING_2
Definition enums.h:1558
@ SOUND_HAMMER_WINDUP
Definition enums.h:747
@ SOUND_D_DOWN_HIT_2
Definition enums.h:1551
@ RENDER_MODE_ALPHATEST
Definition enums.h:3310
@ BTL_RUMBLE_PLAYER_MIN
Definition enums.h:3858
@ BTL_RUMBLE_PLAYER_HEAVY
Definition enums.h:3860
@ BTL_RUMBLE_PLAYER_LIGHT
Definition enums.h:3859
@ ACTOR_PLAYER
Definition enums.h:2118
@ ACTOR_SELF
Definition enums.h:2117
@ CAM_BATTLE
Definition enums.h:1827
@ DAMAGE_TYPE_THROW
Definition enums.h:2903
@ DAMAGE_TYPE_SMASH
Definition enums.h:2891
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2912
#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:296
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:312
#define Ref(sym)
Address/pointer constant.
Definition macros.h:61
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:366
#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:320
#define LVarF
Definition macros.h:164
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:273
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:214
#define Add(VAR, INT_VALUE)
Definition macros.h:377
#define EndLoop
Marks the end of a loop.
Definition macros.h:249
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:353
#define IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
Definition macros.h:279
#define Float(DOUBLE)
Definition macros.h:52
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:342
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:299
#define LVar5
Definition macros.h:154
#define CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
Definition macros.h:338
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:476
#define BreakLoop
Breaks out of the innermost loop.
Definition macros.h:252
#define Thread
Marks the start of a thread block.
Definition macros.h:545
#define EndThread
Marks the end of a thread block.
Definition macros.h:548
#define LVar2
Definition macros.h:151
#define LVar1
Definition macros.h:150
#define LVarA
Definition macros.h:159
#define LVarD
Definition macros.h:162
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:255
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:363
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:270
#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:326
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:577
#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:329
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:246
#define LVar4
Definition macros.h:153
#define LVar3
Definition macros.h:152
#define LVarE
Definition macros.h:163
#define LVar0
Definition macros.h:149
#define Return
Kills the current EVT thread.
Definition macros.h:218