Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
shrink_smash.c
Go to the documentation of this file.
1#include "common.h"
2
3#define NAMESPACE battle_move_shrink_smash
4
6
7extern EvtScript N(EVS_UseMove_Impl);
8
9EvtScript N(EVS_UseMove) = {
10 Call(ShowActionHud, TRUE)
11 Call(GetMenuSelection, LVar0, LVar1, LVar2)
13 CaseEq(0)
14 Set(LVarD, 45)
15 Set(LVarE, 1)
16 Set(LVarF, 2)
17 ExecWait(N(EVS_UseMove_Impl))
18 CaseEq(1)
19 Set(LVarD, 45)
20 Set(LVarE, 2)
21 Set(LVarF, 4)
22 ExecWait(N(EVS_UseMove_Impl))
23 CaseEq(2)
24 Set(LVarD, 45)
25 Set(LVarE, 3)
26 Set(LVarF, 6)
27 ExecWait(N(EVS_UseMove_Impl))
29 Return
30 End
31};
32
33EvtScript N(EVS_UseMove_Impl) = {
34 Call(GetMenuSelection, LVar0, LVar1, LVar2)
36 CaseEq(0)
37 ExecWait(N(EVS_UseBasicHammer))
38 CaseEq(1)
39 ExecWait(N(EVS_UseSuperHammer))
40 CaseEq(2)
41 ExecWait(N(EVS_UseUltraHammer))
43 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_SMASH, 25, 0, 0, 16)
44 Call(GetActionSuccessCopy, LVar0)
46 CaseGt(0)
47 Call(GetMenuSelection, LVar0, LVar1, LVar2)
49 CaseEq(0)
50 Call(StartRumble, BTL_RUMBLE_PLAYER_MIN)
51 Thread
52 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.3))
54 CaseEq(1)
55 Call(StartRumble, BTL_RUMBLE_PLAYER_LIGHT)
56 Thread
57 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.6))
59 CaseEq(2)
60 Call(StartRumble, BTL_RUMBLE_PLAYER_HEAVY)
61 Thread
62 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.9))
66 Call(GetMenuSelection, LVar0, LVar1, LVar2)
68 CaseEq(0)
69 Call(StartRumble, BTL_RUMBLE_PLAYER_MIN)
70 Thread
71 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.3))
73 CaseEq(1)
74 Call(StartRumble, BTL_RUMBLE_PLAYER_LIGHT)
75 Thread
76 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.6))
78 CaseEq(2)
79 Call(StartRumble, BTL_RUMBLE_PLAYER_HEAVY)
80 Thread
81 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.9))
85 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HAMMER_STRIKE)
86 Wait(1)
87 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_SMASH, 25, 0, 0, 16)
89 ExecWait(N(EVS_HammerSupport_ReturnHome_Miss))
90 Return
91 EndIf
92 Call(GetPlayerActionSuccess, LVar0)
94 CaseGt(FALSE)
95 Call(GetMenuSelection, LVar0, LVar1, LVar2)
97 CaseEq(0)
98 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_NORMAL)
99 CaseEq(1)
100 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_SILENT)
101 CaseEq(2)
102 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_SILENT)
106 Call(GetMenuSelection, LVar0, LVar1, LVar2)
108 CaseEq(0)
109 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_NORMAL)
110 CaseEq(1)
111 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_SILENT)
112 CaseEq(2)
113 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_SILENT)
120 ExecWait(N(EVS_HammerSupport_ReturnHome_Success))
124 ExecWait(N(EVS_HammerSupport_ReturnHome_Miss))
127 Return
128 End
129};
130
131
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
@ 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:4866
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
#define SUPPRESS_EVENTS_HAMMER
Definition enums.h:2912
@ SOUND_HIT_SILENT
Definition enums.h:747
@ SOUND_HIT_NORMAL
Definition enums.h:724
@ BTL_RUMBLE_PLAYER_MIN
Definition enums.h:4259
@ BTL_RUMBLE_PLAYER_HEAVY
Definition enums.h:4261
@ BTL_RUMBLE_PLAYER_LIGHT
Definition enums.h:4260
@ ACTOR_PLAYER
Definition enums.h:2085
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_SMASH
Definition enums.h:2857
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
#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 EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#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 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 DMG_STATUS_KEY(typeFlag, duration, chance)
Definition macros.h:224
#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 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