Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
power_quake.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_power_quake
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, 2)
18 Set(LVarF, 4)
19 ExecWait(N(EVS_UseMove_Impl))
20 CaseEq(1)
21 Set(LVarD, 80)
22 Set(LVarE, 2)
23 Set(LVarF, 4)
24 ExecWait(N(EVS_UseMove_Impl))
25 CaseEq(2)
26 Set(LVarD, 80)
27 Set(LVarE, 2)
28 Set(LVarF, 4)
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))
45 Thread
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)
60 Thread
61 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.24))
62 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.2))
63 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(2.4))
64 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.2))
65 Call(ShakeCam, CAM_BATTLE, 0, 3, Float(0.84))
66 Call(ShakeCam, CAM_BATTLE, 0, 4, Float(0.48))
67 Call(ShakeCam, CAM_BATTLE, 0, 6, Float(0.12))
68 Call(ShakeCam, CAM_BATTLE, 0, 4, Float(0.06))
70 Thread
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 Wait(5)
76 PlayEffect(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 72, 8, 24, 30, 0, 0, 0, 0, 0)
77 Wait(5)
78 PlayEffect(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 72, 8, 48, 30, 0, 0, 0, 0, 0)
79 Wait(5)
80 PlayEffect(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 72, 8, 72, 30, 0, 0, 0, 0, 0)
84 Thread
85 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.2))
86 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
87 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(2.0))
88 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
89 Call(ShakeCam, CAM_BATTLE, 0, 3, Float(0.7))
90 Call(ShakeCam, CAM_BATTLE, 0, 4, Float(0.4))
91 Call(ShakeCam, CAM_BATTLE, 0, 6, Float(0.1))
92 Call(ShakeCam, CAM_BATTLE, 0, 4, Float(0.05))
94 Thread
95 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
96 Add(LVar0, 24)
97 Add(LVar1, 10)
98 PlayEffect(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 72, 8, 0, 30, 0, 0, 0, 0, 0)
99 PlayEffect(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 72, 8, 24, 30, 0, 0, 0, 0, 0)
100 Wait(6)
101 PlayEffect(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 96, 8, 48, 30, 0, 0, 0, 0, 0)
102 PlayEffect(EFFECT_SMOKE_IMPACT, 0, LVar0, LVar1, LVar2, 96, 8, 72, 30, 0, 0, 0, 0, 0)
105 Call(GetPlayerActionSuccess, LVar0)
106 IfGt(LVar0, FALSE)
107 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HAMMER_QUAKE)
108 Call(MoveBattleCamOver, 5)
109 Else
110 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HAMMER_QUAKE)
111 Call(MoveBattleCamOver, 50)
112 EndIf
113 Call(GetMenuSelection, LVar0, LVar1, LVar2)
115 CaseEq(0)
116 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_QUAKE_1)
117 CaseEq(1)
118 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_QUAKE_2)
119 CaseEq(2)
120 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_QUAKE_3)
122 Wait(10)
123 Call(GetMenuSelection, LVar0, LVar1, LVar2)
125 CaseEq(0)
126 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_1)
127 CaseEq(1)
128 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_2)
129 CaseEq(2)
130 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_3)
132 Set(LVar9, 0)
133 Call(InitTargetIterator)
134 Label(10)
135 Call(SetGoalToTarget, ACTOR_PLAYER)
136 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_QUAKE_HAMMER, 29, 0, 0, 16)
138 Goto(11)
139 EndIf
140 Call(GetPlayerActionSuccess, LVar0)
142 CaseGt(FALSE)
147 Label(11)
148 Call(ChooseNextTarget, ITER_NEXT, LVar1)
149 Add(LVar9, 1)
150 Call(GetTargetListLength, LVar1)
152 Goto(10)
153 EndIf
154 Thread
155 Wait(10)
156 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
158 Wait(10)
159 ExecWait(N(EVS_Hammer_ReturnHome_B))
160 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
161 Return
162 End
163};
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_EXTREME
Definition enums.h:4262
@ 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 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 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