Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
shell_crack.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
3#include "effects.h"
4
5#define NAMESPACE battle_move_shell_crack
6
8
9API_CALLABLE(func_802A10A4_77F2E4) {
10 ActorState* playerActorState = &gBattleStatus.playerActor->state;
11 s32 i;
12
13 for (i = 0; i < 20; i++) {
14 fx_floating_cloud_puff(0,
15 (playerActorState->goalPos.x + (f32) rand_int(30)) - 15.0f,
16 (playerActorState->goalPos.y + (f32) rand_int(20)) - 15.0f,
17 playerActorState->goalPos.z + 5.0f, 1.0f, 25);
18 }
19
20 return ApiStatus_DONE2;
21}
22
23extern EvtScript N(UseMove_Impl);
24
25EvtScript N(EVS_UseMove) = {
26 Call(ShowActionHud, TRUE)
27 Call(GetMenuSelection, LVar0, LVar1, LVar2)
29 CaseEq(0)
30 Set(LVarD, 60)
31 Set(LVarE, 1)
32 Set(LVarF, 2)
33 ExecWait(N(UseMove_Impl))
34 CaseEq(1)
35 Set(LVarD, 60)
36 Set(LVarE, 2)
37 Set(LVarF, 4)
38 ExecWait(N(UseMove_Impl))
39 CaseEq(2)
40 Set(LVarD, 60)
41 Set(LVarE, 3)
42 Set(LVarF, 6)
43 ExecWait(N(UseMove_Impl))
45 Return
46 End
47};
48
49EvtScript N(EVS_802A3248) = {
51 Thread
52 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.0))
53 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(3.0))
54 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(6.0))
55 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(5.0))
56 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(4.0))
57 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(3.0))
58 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(2.0))
59 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.0))
60 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.5))
61 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.2))
63 Return
64 End
65};
66
67EvtScript N(UseMove_Impl) = {
68 Call(GetMenuSelection, LVar0, LVar1, LVar2)
70 CaseEq(0)
71 ExecWait(N(EVS_UseBasicHammer))
72 CaseEq(1)
73 ExecWait(N(EVS_UseSuperHammer))
74 CaseEq(2)
75 ExecWait(N(EVS_UseUltraHammer))
77 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_SMASH, 25, 0, 0, 16)
78 ExecWait(N(EVS_802A3248))
79 Call(InitTargetIterator)
80 Call(SetGoalToTarget, ACTOR_PLAYER)
81 Call(func_802A10A4_77F2E4)
82 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HAMMER_STRIKE)
83 Wait(1)
84 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_SMASH, 25, 0, 0, 16)
86 ExecWait(N(EVS_HammerSupport_ReturnHome_Miss))
87 Return
88 EndIf
89 Call(GetPlayerActionSuccess, LVar0)
91 CaseGt(FALSE)
92 Call(GetMenuSelection, LVar0, LVar1, LVar2)
94 CaseEq(0)
95 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_NORMAL)
96 CaseEq(1)
97 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_SILENT)
98 CaseEq(2)
99 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_SILENT)
103 Call(GetMenuSelection, LVar0, LVar1, LVar2)
105 CaseEq(0)
106 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_NORMAL)
107 CaseEq(1)
108 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_SILENT)
109 CaseEq(2)
110 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HIT_SILENT)
117 ExecWait(N(EVS_HammerSupport_ReturnHome_Success))
121 ExecWait(N(EVS_HammerSupport_ReturnHome_Miss))
124 Return
125 End
126};
ActorState state
Bytecode EvtScript[]
#define rand_int
@ 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
#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_EXTREME
Definition enums.h:4262
@ ACTOR_PLAYER
Definition enums.h:2085
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_SHELL_CRACK
Definition enums.h:2868
@ DAMAGE_TYPE_SMASH
Definition enums.h:2857
#define ApiStatus_DONE2
Definition evt.h:118
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 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
struct Actor * playerActor
BattleStatus gBattleStatus
Definition battle.c:11