Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
hustle_drink.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
3#include "effects.h"
4#include "sprite/player.h"
5
6#define NAMESPACE battle_item_hustle_drink
7
9
10API_CALLABLE(N(func_802A123C_72619C)) {
11 BattleStatus* battleStatus = &gBattleStatus;
12 Actor* player = battleStatus->playerActor;
13
14 if (player->debuff != 0) {
15 player->debuffDuration = 0;
16 player->debuff = 0;
18 }
19 if (player->staticStatus != 0) {
20 player->staticDuration = 0;
21 player->staticStatus = 0;
23 }
24 if (player->stoneStatus != 0) {
25 player->stoneDuration = 0;
26 player->stoneStatus = 0;
27 }
28 if (player->transparentStatus != 0) {
29 player->transparentDuration = 0;
30 player->transparentStatus = 0;
31 }
32
33 return ApiStatus_DONE2;
34}
35
36API_CALLABLE(N(func_802A12C4_726224)) {
38
39 return ApiStatus_DONE2;
40}
41
43
44EvtScript N(EVS_UseItem) = {
45 SetConst(LVarA, ITEM_HUSTLE_DRINK)
46 ExecWait(N(UseItemWithEffect))
47 ExecWait(N(DrinkItem))
48 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Squish)
49 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
50 Add(LVar1, 25)
52 Call(N(func_802A12C4_726224))
53 Call(N(func_802A123C_72619C))
54 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
55 Add(LVar1, 20)
56 Call(UseBattleCamPreset, BTL_CAM_ACTOR_CLOSE)
57 Call(BattleCamTargetActor, ACTOR_SELF)
58 Call(MoveBattleCamOver, 20)
59 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HUSTLE_WHISTLE)
60 Thread
61 Loop(2)
62 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
63 Wait(1)
64 Call(SetActorScale, ACTOR_SELF, Float(1.1), Float(1.0), Float(1.0))
65 Wait(1)
66 Call(SetActorScale, ACTOR_SELF, Float(1.2), Float(0.95), Float(1.0))
67 Wait(1)
68 Call(SetActorScale, ACTOR_SELF, Float(1.3), Float(0.9), Float(1.0))
69 Wait(1)
70 Call(SetActorScale, ACTOR_SELF, Float(1.35), Float(0.85), Float(1.0))
71 Wait(1)
72 Call(SetActorScale, ACTOR_SELF, Float(1.38), Float(0.8), Float(1.0))
73 Wait(1)
74 Call(SetActorScale, ACTOR_SELF, Float(1.4), Float(0.8), Float(1.0))
75 Wait(1)
76 Call(SetActorScale, ACTOR_SELF, Float(1.3), Float(0.85), Float(1.0))
77 Wait(1)
78 Call(SetActorScale, ACTOR_SELF, Float(1.2), Float(0.9), Float(1.0))
79 Wait(1)
80 Call(SetActorScale, ACTOR_SELF, Float(1.1), Float(0.95), Float(1.0))
81 Wait(1)
83 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
84 Wait(1)
85 Call(SetActorScale, ACTOR_SELF, Float(1.1), Float(1.0), Float(1.0))
86 Wait(1)
87 Call(SetActorScale, ACTOR_SELF, Float(1.2), Float(0.95), Float(1.0))
88 Wait(1)
89 Call(SetActorScale, ACTOR_SELF, Float(1.3), Float(0.9), Float(1.0))
90 Wait(1)
91 Call(SetActorScale, ACTOR_SELF, Float(1.35), Float(0.85), Float(1.0))
92 Wait(1)
93 Call(SetActorScale, ACTOR_SELF, Float(1.38), Float(0.8), Float(1.0))
94 Wait(1)
95 Call(SetActorScale, ACTOR_SELF, Float(1.4), Float(0.8), Float(1.0))
96 Wait(1)
97 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_GROW)
98 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.3), Float(1.0))
99 Wait(1)
100 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
101 Wait(1)
102 Call(SetActorScale, ACTOR_SELF, Float(0.95), Float(1.1), Float(1.0))
103 Wait(1)
104 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
105 Wait(1)
106 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
108 Loop(10)
109 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HUSTLE_WHISTLE)
110 PlayEffect(EFFECT_LANDING_DUST, 0, LVar0, LVar1, LVar2, 0, 0)
111 PlayEffect(EFFECT_LANDING_DUST, 1, LVar0, LVar1, LVar2, 0, 0)
112 Wait(4)
113 EndLoop
114 Wait(10)
115 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
116 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
117 Call(MoveBattleCamOver, 20)
118 Wait(20)
119 ExecWait(N(PlayerGoHome))
120 Return
121 End
122};
s8 transparentStatus
s16 hudElementDataIndex
Bytecode EvtScript[]
s8 staticDuration
s8 debuffDuration
s8 transparentDuration
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_ACTOR_CLOSE
Definition enums.h:4835
@ SOUND_HUSTLE_WHISTLE
Definition enums.h:1177
@ SOUND_GROW
Definition enums.h:1435
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
#define ApiStatus_DONE2
Definition evt.h:118
void remove_status_debuff(s32)
void remove_status_static(s32)
ApiStatus ShowStartRecoveryShimmer(Evt *script, b32 isInitialCall)
#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 EndLoop
Marks the end of a loop.
Definition macros.h:248
#define Float(DOUBLE)
Definition macros.h:51
#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 LVarA
Definition macros.h:158
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define PlayEffect(args...)
Definition macros.h:807
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar0
Definition macros.h:148
#define SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
Definition macros.h:370
#define Return
Kills the current EVT thread.
Definition macros.h:217
struct Actor * playerActor
BattleStatus gBattleStatus
Definition battle.c:11