Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
UseItem.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "sprite/player.h"
3
6 IfEq(LVar1, 0)
8 Wait(10)
12 Add(LVar0, 18)
16 Add(LVar1, 45)
18 Add(LVar3, 10)
19 Add(LVar3, 2)
24 Wait(LVar0)
25 Wait(15)
28 Else
32 Wait(4)
33 Add(LVar1, 45)
35 Add(LVar3, 10)
36 Add(LVar3, 2)
40 Wait(15)
42 EndIf
43 Return
44 End
45};
46
47EvtScript N(UseItem) = {
49 Call(SetBattleCamTarget, -85, 1, 0)
53 Wait(10)
56 Add(LVar1, 45)
60 Wait(LVar0)
61 Wait(15)
64 Return
65 End
66};
67
76 Return
77 End
78};
79
80EvtScript N(EatItem) = {
81 Thread
82 Loop(4)
84 Wait(10)
88 Wait(45)
89 Return
90 End
91};
92
94 Thread
95 Loop(4)
97 Wait(10)
101 Wait(45)
102 Return
103 End
104};
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
@ ITEM_SPAWN_MODE_DECORATION
Definition enums.h:2292
@ BTL_CAM_REPOSITION
Definition enums.h:4840
@ BTL_CAM_PLAYER_WISH
Definition enums.h:4890
@ SOUND_EAT_OR_DRINK
Definition enums.h:1441
@ SOUND_USE_ITEM
Definition enums.h:1434
@ ACTOR_PLAYER
Definition enums.h:2085
ApiStatus RemoveItemEntity(Evt *script, b32 isInitialCall)
ApiStatus MakeItemEntity(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 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 EndLoop
Marks the end of a loop.
Definition macros.h:248
#define Float(DOUBLE)
Definition macros.h:51
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#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 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 Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar3
Definition macros.h:151
#define LVarE
Definition macros.h:162
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217