Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
world_use_item.c File Reference

Go to the source code of this file.

Variables

EvtScript EVS_WorldItem_ShowUsedItem
 
EvtScript EVS_WorldItem_PlayEatingSounds
 
EvtScript EVS_WorldItem_PlayDrinkingSounds
 
EvtScript EVS_World_UseItem
 

Variable Documentation

◆ EVS_WorldItem_ShowUsedItem

EvtScript EVS_WorldItem_ShowUsedItem
Initial value:
= {
Call(SetPlayerAnimation, ANIM_Mario1_UsePower)
Add(LVar1, 45)
Wait(15)
Add(LVar1, 20)
Call(WorldItem_ShowUseSparkles, LVar0, LVar1, LVar2)
}
@ EVT_GROUP_NEVER_PAUSE
Definition evt.h:142
ApiStatus RemoveItemEntity(Evt *script, b32 isInitialCall)
ApiStatus SetPlayerAnimation(Evt *script, b32 isInitialCall)
ApiStatus MakeItemEntity(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerPos(Evt *script, b32 isInitialCall)
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#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 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 SetGroup(GROUP)
Sets the current thread's group. Group value meanings are currently not known.
Definition macros.h:519
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217

Definition at line 112 of file world_use_item.c.

112 {
114 Call(SetPlayerAnimation, ANIM_Mario1_UsePower)
116 Add(LVar1, 45)
118 Set(LVarA, LVar0)
119 Wait(15)
121 Add(LVar1, 20)
122 Call(WorldItem_ShowUseSparkles, LVar0, LVar1, LVar2)
124 Return
125 End
126};

◆ EVS_WorldItem_PlayEatingSounds

EvtScript EVS_WorldItem_PlayEatingSounds
Initial value:
= {
Loop(4)
Wait(10)
Call(SetPlayerAnimation, ANIM_Mario1_Eat)
Wait(45)
}
@ SOUND_EAT_OR_DRINK
Definition enums.h:1441
ApiStatus PlaySound(Evt *script, b32 isInitialCall)
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#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 Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245

Definition at line 128 of file world_use_item.c.

128 {
129 Thread
130 Loop(4)
132 Wait(10)
133 EndLoop
135 Call(SetPlayerAnimation, ANIM_Mario1_Eat)
136 Wait(45)
137 Return
138 End
139};

◆ EVS_WorldItem_PlayDrinkingSounds

EvtScript EVS_WorldItem_PlayDrinkingSounds
Initial value:

Definition at line 141 of file world_use_item.c.

141 {
142 Thread
143 Loop(4)
145 Wait(10)
146 EndLoop
148 Call(SetPlayerAnimation, ANIM_Mario1_Drink)
149 Wait(45)
150 Return
151 End
152};

◆ EVS_World_UseItem

EvtScript EVS_World_UseItem

Definition at line 154 of file world_use_item.c.

154 {
158 IfNe(LVar0, 0)
160 Wait(20)
161 EndIf
162 Call(WorldItem_PauseTime)
163 Call(WorldItem_GetItemProperties, LVarA)
165 IfEq(LVarD, 0)
167 Else
169 EndIf
170 IfEq(LVarF, 1)
171 Call(SetPlayerAnimation, ANIM_Mario1_StickOutTongue)
172 EndIf
173 IfGt(LVarB, 0)
175 Add(LVar0, 0)
176 Add(LVar1, 35)
177 Call(WorldItem_ShowHPGain, LVar0, LVar1, LVar2, LVarB)
178 EndIf
179 IfGt(LVarC, 0)
181 Add(LVar0, 20)
182 Add(LVar1, 25)
183 Call(WorldItem_ShowFPGain, LVar0, LVar1, LVar2, LVarC)
184 EndIf
186 Add(LVar1, 25)
188 IfNe(LVarB, 0)
189 Call(WorldItem_RestoreHP, LVarB)
190 EndIf
191 IfNe(LVarC, 0)
192 Call(WorldItem_RestoreFP, LVarC)
193 EndIf
194 IfEq(LVarF, 0)
195 Wait(10)
196 Call(SetPlayerAnimation, ANIM_Mario1_ThumbsUp)
197 Wait(30)
198 Else
199 Wait(30)
200 EndIf
203 Call(SetPlayerAnimation, ANIM_Mario1_Idle)
204 Wait(20)
205 Call(WorldItem_ConsumeItem)
207 Call(WorldItem_UnpauseTime)
208 Return
209 End
210};
ApiStatus GetPartnerInUse(Evt *script, b32 isInitialCall)
ApiStatus ShowRecoveryShimmer(Evt *script, b32 isInitialCall)
ApiStatus DisablePlayerInput(Evt *script, b32 isInitialCall)
Disables player and partner input, and disables the status menu.
ApiStatus ShowStartRecoveryShimmer(Evt *script, b32 isInitialCall)
ApiStatus InterruptUsePartner(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 LVarF
Definition macros.h:163
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define LVarC
Definition macros.h:160
#define IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
Definition macros.h:278
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVarB
Definition macros.h:159
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define LVarD
Definition macros.h:161
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
EvtScript EVS_WorldItem_ShowUsedItem
EvtScript EVS_WorldItem_PlayEatingSounds
EvtScript EVS_WorldItem_PlayDrinkingSounds