Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
foliage.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3
5
6EvtScript N(EVS_SearchBush) = {
10 Thread
11 Set(LFlag0, FALSE)
12 IfNe(LVar1, 0)
13 Loop(5)
16 Loop(LVar2)
18 Call(N(TransformFoliage), LVar3, Float(0.1), 1, LVarF, 0)
19 IfEq(LFlag0, FALSE)
20 Set(LFlag0, TRUE)
22 EndIf
24 Wait(1)
27 Loop(LVar2)
29 Call(N(TransformFoliage), LVar3, Float(0.1), -1, LVarF, 0)
31 Wait(1)
35 Loop(LVar2)
37 Call(TranslateModel, LVar3, 0, 0, 0)
39 Wait(1)
40 EndIf
42 Thread
43 IfNe(LVar2, 0)
46 Loop(LVar3)
50 IfEq(LVarA, 0)
52 Else
54 IfEq(LVarB, 0)
57 EndIf
58 EndIf
60 EndIf
62 Wait(15)
63 IfNe(LVar4, 0)
65 EndIf
66 Return
67 End
68};
69
70EvtScript N(EVS_ShakeTree) = {
78 Thread
79 Set(LFlag0, FALSE)
80 IfNe(LVar1, 0)
81 Wait(1)
82 Loop(5)
85 Loop(LVar2)
87 Call(N(TransformFoliage), LVar3, Float(0.1), Float(0.2), LVarF, 0)
88 IfEq(LFlag0, FALSE)
89 Set(LFlag0, TRUE)
91 EndIf
93 Wait(1)
96 Loop(LVar2)
98 Call(N(TransformFoliage), LVar3, Float(0.1), Float(-0.2), LVarF, 0)
100 Wait(1)
101 EndLoop
104 Loop(LVar2)
106 Call(TranslateModel, LVar3, 0, 0, 0)
107 EndLoop
108 Wait(1)
109 EndIf
111 Thread
112 Set(LFlag0, FALSE)
113 IfNe(LVar2, 0)
114 Loop(5)
117 Loop(LVar3)
119 Call(N(TransformFoliage), LVar4, Float(0.1), Float(0.2), LVarF, 0)
120 IfEq(LFlag0, FALSE)
121 Set(LFlag0, TRUE)
123 EndIf
124 EndLoop
125 Wait(1)
128 Loop(LVar3)
130 Call(N(TransformFoliage), LVar4, Float(0.1), Float(-0.2), LVarF, 0)
131 EndLoop
132 Wait(1)
133 EndLoop
136 Loop(LVar3)
138 Call(TranslateModel, LVar4, 0, 0, 0)
139 EndLoop
140 Wait(1)
141 EndIf
143 Thread
144 IfNe(LVar3, 0)
147 Loop(LVar4)
151 IfEq(LVarB, 0)
153 Else
155 IfEq(LVarC, 0)
158 EndIf
159 EndIf
160 EndLoop
161 EndIf
163 Thread
164 IfNe(LVar4, 0)
167 Loop(LVar5)
169 PlayEffect(EFFECT_DROP_LEAVES, 0, LVar6, LVar7, LVar8, 100)
170 EndLoop
171 EndIf
173 IfNe(LVar5, 0)
175 EndIf
176 Wait(15)
177 Return
178 End
179};
Bytecode EvtScript[]
@ SOUND_SMACK_TREE
Definition enums.h:787
@ SOUND_SEARCH_BUSH
Definition enums.h:773
@ SOUND_SHAKE_TREE_LEAVES
Definition enums.h:788
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
ApiStatus PlaySound(Evt *script, b32 isInitialCall)
ApiStatus PlaySoundAtModel(Evt *script, b32 isInitialCall)
Plays the given sound at the given model.
ApiStatus TranslateModel(Evt *script, b32 isInitialCall)
Translates the given model's position.
ApiStatus DropItemEntity(Evt *script, b32 isInitialCall)
ApiStatus SetValueByRef(Evt *script, b32 isInitialCall)
ApiStatus GetValueByRef(Evt *script, b32 isInitialCall)
ApiStatus GetPlayerPos(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 LVar6
Definition macros.h:154
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#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 End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define UseBuf(INT_PTR)
Loads a s32 pointer for use with subsequent EVT_BUF_READ commands.
Definition macros.h:389
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define BufRead4(VAR1, VAR2, VAR3, VAR4)
Consumes the next four s32s from the buffer and stores them in the given variables.
Definition macros.h:401
#define LVarC
Definition macros.h:160
#define BufRead1(VAR)
Consumes the next s32 from the buffer and stores it in the given variable.
Definition macros.h:392
#define Float(DOUBLE)
Definition macros.h:51
#define BufRead3(VAR1, VAR2, VAR3)
Consumes the next three s32s from the buffer and stores them in the given variables.
Definition macros.h:398
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar5
Definition macros.h:153
#define SetTimescale(TIMESCALE)
Sets the current thread's timescale. This is a multiplier applied to Wait and Wait_SECONDS.
Definition macros.h:516
#define LVarB
Definition macros.h:159
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define LVar7
Definition macros.h:155
#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 LVar8
Definition macros.h:156
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define LFlag0
Definition macros.h:167
#define LVarA
Definition macros.h:158
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LVar9
Definition macros.h:157
#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 LVar4
Definition macros.h:152
#define LVar3
Definition macros.h:151
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217