Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
quake_hammer.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_quake_hammer
6
8
9extern EvtScript N(EVS_UseMove_Impl);
10
11EvtScript N(EVS_UseMove) = {
12 Call(ShowActionHud, TRUE)
13 Call(GetMenuSelection, LVar0, LVar1, LVar2)
15 CaseEq(0)
16 Set(LVarD, 80)
17 Set(LVarE, 1)
18 Set(LVarF, 2)
19 ExecWait(N(EVS_UseMove_Impl))
20 CaseEq(1)
21 Set(LVarD, 80)
22 Set(LVarE, 1)
23 Set(LVarF, 2)
24 ExecWait(N(EVS_UseMove_Impl))
25 CaseEq(2)
26 Set(LVarD, 80)
27 Set(LVarE, 1)
28 Set(LVarF, 2)
29 ExecWait(N(EVS_UseMove_Impl))
31 Return
32 End
33};
34
35EvtScript N(EVS_UseMove_Impl) = {
36 Call(GetMenuSelection, LVar0, LVar1, LVar2)
38 CaseEq(0)
39 ExecWait(N(EVS_Hammer_UseBasicQuake))
40 CaseEq(1)
41 ExecWait(N(EVS_Hammer_UseSuperQuake))
42 CaseEq(2)
43 ExecWait(N(EVS_Hammer_UseUltraQuake))
46 Wait(8)
47 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
48 Add(LVar0, 24)
49 Add(LVar1, 10)
50 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 60, 8, 0, 30, 0, 0, 0, 0, 0)
51 Wait(2)
52 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 60, 8, 33, 30, 0, 0, 0, 0, 0)
53 Wait(2)
54 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 60, 8, 66, 30, 0, 0, 0, 0, 0)
56 Call(GetPlayerActionSuccess, LVar0)
58 CaseGt(FALSE)
59 Call(StartRumble, BTL_RUMBLE_PLAYER_HEAVY)
61 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.2))
62 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
63 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(2.0))
64 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
65 Call(ShakeCam, CAM_BATTLE, 0, 3, Float(0.7))
66 Call(ShakeCam, CAM_BATTLE, 0, 4, Float(0.4))
67 Call(ShakeCam, CAM_BATTLE, 0, 6, Float(0.1))
68 Call(ShakeCam, CAM_BATTLE, 0, 4, Float(0.05))
71 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
72 Add(LVar0, 24)
73 Add(LVar1, 10)
74 PlayEffect(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 72, 8, 0, 30, 0, 0, 0, 0, 0)
75 PlayEffect(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 72, 8, 24, 30, 0, 0, 0, 0, 0)
78 Call(StartRumble, BTL_RUMBLE_PLAYER_HEAVY)
80 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.1))
81 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(0.5))
82 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.0))
83 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(0.5))
84 Call(ShakeCam, CAM_BATTLE, 0, 3, Float(0.35))
85 Call(ShakeCam, CAM_BATTLE, 0, 4, Float(0.2))
86 Call(ShakeCam, CAM_BATTLE, 0, 6, Float(0.05))
87 Call(ShakeCam, CAM_BATTLE, 0, 4, Float(0.025390625))
90 Call(GetPlayerActionSuccess, LVar0)
91 IfGt(LVar0, FALSE)
92 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HAMMER_QUAKE)
93 Call(MoveBattleCamOver, 5)
94 Else
95 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HAMMER_QUAKE)
96 Call(MoveBattleCamOver, 50)
97 EndIf
98 Call(GetMenuSelection, LVar0, LVar1, LVar2)
100 CaseEq(0)
101 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_QUAKE_1)
102 CaseEq(1)
103 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_QUAKE_2)
104 CaseEq(2)
105 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_QUAKE_3)
107 Wait(10)
108 Call(GetMenuSelection, LVar0, LVar1, LVar2)
110 CaseEq(0)
111 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_1)
112 CaseEq(1)
113 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_2)
114 CaseEq(2)
115 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_3)
117 Set(LVar9, 0)
118 Call(InitTargetIterator)
119 Label(10)
120 Call(SetGoalToTarget, ACTOR_PLAYER)
121 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_QUAKE_HAMMER, 29, 0, 0, 16)
123 Goto(11)
124 EndIf
125 Call(GetPlayerActionSuccess, LVar0)
127 CaseGt(FALSE)
132 Label(11)
133 Call(ChooseNextTarget, ITER_NEXT, LVar1)
134 Add(LVar9, 1)
135 Call(GetTargetListLength, LVar1)
137 Goto(10)
138 EndIf
139 Thread
140 Wait(10)
141 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
143 Wait(10)
144 ExecWait(N(EVS_Hammer_ReturnHome_B))
145 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
146 Return
147 End
148};
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
@ ITER_NEXT
Definition enums.h:2025
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_PLAYER_HAMMER_QUAKE
Definition enums.h:4868
@ BTL_CAM_DEFAULT
Definition enums.h:4824
#define SUPPRESS_EVENTS_HAMMER
Definition enums.h:2912
@ SOUND_HAMMER_STRIKE_3
Definition enums.h:1559
@ SOUND_HAMMER_QUAKE_2
Definition enums.h:1561
@ SOUND_HAMMER_QUAKE_1
Definition enums.h:1560
@ SOUND_HAMMER_STRIKE_1
Definition enums.h:1557
@ SOUND_HAMMER_QUAKE_3
Definition enums.h:1562
@ SOUND_HAMMER_STRIKE_2
Definition enums.h:1558
@ BTL_RUMBLE_PLAYER_HEAVY
Definition enums.h:4261
@ ACTOR_PLAYER
Definition enums.h:2085
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_IGNORE_DEFENSE
Definition enums.h:2877
@ DAMAGE_TYPE_QUAKE_HAMMER
Definition enums.h:2871
@ DAMAGE_TYPE_QUAKE
Definition enums.h:2862
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
@ DAMAGE_TYPE_MULTIPLE_POPUPS
Definition enums.h:2879
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 EndChildThread
Marks the end of a child thread block.
Definition macros.h:563
#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 Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
Definition macros.h:278
#define IfLt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR < RVAR.
Definition macros.h:275
#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 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 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 PlayEffect(args...)
Definition macros.h:807
#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 ChildThread
Marks the start of a child thread block.
Definition macros.h:560
#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