Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
flo_03.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
3
4#define NAMESPACE A(flo_03)
5
6EvtScript N(EVS_AnimateVines) = {
9 Loop(0)
11 IfEq(LVar0, 0)
13 EndIf
16 IfEq(LVar0, 0)
18 EndIf
21 Set(LVar0, 0)
22 Set(LVar1, 0)
23 Label(0)
24 Add(LVar0, -140)
25 IfLt(LVar0, 0)
26 Add(LVar0, 0x10000)
27 EndIf
29 Add(LVar1, -200)
30 IfLt(LVar1, 0)
31 Add(LVar1, 0x10000)
32 EndIf
34 Wait(1)
35 Goto(0)
36 Return
37 End
38};
39
40#include "common/MakeSun.inc.c"
42
43EvtScript N(EVS_AnimateSmokePuff) = {
44 Call(EnableModel, LVarF, TRUE)
45 Set(LVarE, 159)
46 Loop(LVarE)
47 AddF(LVar3, 0)
48 AddF(LVar4, Float(0.0))
49 SetF(LVar5, Float(0.01))
53 MulF(LVar6, Float(1.01))
54 AddF(LVar7, Float(0.01))
56 Call(N(CosInterpMinMax), LVarE, LVarA, Float(0.0), Float(0.203), 15, 0, 0)
59 Call(N(CosInterpMinMax), LVarE, LVarA, Float(0.0), Float(0.203), 20, 0, 90)
62 MulF(LVarA, Float(10.0))
65 Call(RotateModel, LVarF, LVarA, 0, 0, 1)
66 Wait(1)
68 Call(EnableModel, LVarF, FALSE)
69 Return
70 End
71};
72
73s32 N(VineModels)[] = {
78};
79
80EvtScript N(EVS_PreBattle) = {
81 Call(SetSpriteShading, SHADING_NONE)
83 Set(LVar0, N(VineModels))
84 Exec(N(EVS_AnimateVines))
92 Thread
93 Set(LVarE, 1)
94 Set(LVarF, 0)
95 Loop(0)
97 IfGe(LVarF, 1080)
98 Set(LVarF, 0)
99 EndIf
100 Set(LVar0, LVarF)
101 Div(LVar0, 9)
102 Mod(LVar0, 2)
103 Mul(LVar0, 0x4000)
104 Set(LVar1, LVarF)
105 Div(LVar1, 4)
106 Mod(LVar1, 2)
107 Mul(LVar1, 0x4000)
108 Set(LVar2, LVarF)
109 Div(LVar2, 5)
110 Mod(LVar2, 2)
111 Mul(LVar2, 0x4000)
112 Set(LVar3, LVarF)
113 Div(LVar3, 6)
114 Mod(LVar3, 2)
115 Mul(LVar3, 0x4000)
116 Set(LVar4, LVarF)
117 Div(LVar4, 2)
118 Mod(LVar4, 2)
119 Mul(LVar4, 0x4000)
120 Set(LVar5, LVarF)
121 Div(LVar5, 8)
122 Mod(LVar5, 2)
123 Mul(LVar5, 0x4000)
124 Set(LVar6, LVarF)
125 Div(LVar6, 8)
126 Mod(LVar6, 2)
127 Mul(LVar6, 0x8000)
135 Wait(1)
136 EndLoop
138 Thread
139 Set(LVar0, 0)
140 // create 16 smoke models
141 Loop(16)
142 Set(LVar1, LVar0)
144 Add(LVar0, 1)
146 Call(EnableModel, LVar1, FALSE)
147 EndLoop
148 // hide the original
150 // animate them
151 Set(LVarE, 0)
152 Loop(0)
153 SetF(LVar0, Float(106.0))
154 SetF(LVar1, Float(94.0))
155 SetF(LVar2, Float(-91.0))
156 Call(RandInt, 100, LVar3)
157 AddF(LVar3, -50)
158 DivF(LVar3, Float(200.0))
159 SetF(LVar4, Float(1.0))
160 SetF(LVar5, 0)
161 SetF(LVar6, Float(0.296))
162 SetF(LVar7, Float(0.296))
163 Set(LVarF, LVarE)
165 Exec(N(EVS_AnimateSmokePuff))
166 Add(LVarE, 1)
167 IfGe(LVarE, 16)
168 Set(LVarE, 0)
169 EndIf
170 Wait(10)
171 EndLoop
173 ExecWait(N(MakeSun))
174 Return
175 End
176};
177
178EvtScript N(EVS_PostBattle) = {
179 Return
180 End
181};
182
183s32 N(ForegroundVineModels)[] = {
184 -1,
188};
189
190Stage NAMESPACE = {
191 .texture = "flo_tex",
192 .shape = "flo_bt03_shape",
193 .hit = "flo_bt03_hit",
194 .bg = "fla_bg",
195 .preBattle = &N(EVS_PreBattle),
196 .postBattle = &N(EVS_PostBattle),
197 .foregroundModelList = N(ForegroundVineModels),
198};
Bytecode EvtScript[]
#define MODEL_o454
Definition dgb_01_shape.h:7
#define MODEL_o411
#define MODEL_o419
#define MODEL_o420
#define MODEL_o422
@ TEX_PANNER_MAIN
Definition enums.h:4415
@ TEX_PANNER_5
Definition enums.h:4403
@ TEX_PANNER_6
Definition enums.h:4404
@ TEX_PANNER_4
Definition enums.h:4402
@ TEX_PANNER_F
Definition enums.h:4413
@ TEX_PANNER_2
Definition enums.h:4400
@ TEX_PANNER_E
Definition enums.h:4412
@ TEX_PANNER_7
Definition enums.h:4405
@ TEX_PANNER_3
Definition enums.h:4401
@ TEX_PANNER_1
Definition enums.h:4399
@ CAM_BATTLE
Definition enums.h:1801
#define MODEL_piko6
#define MODEL_piko2
#define MODEL_piko5
#define MODEL_piko4
#define MODEL_piko7
#define MODEL_piko1
#define MODEL_piko3
#define MODEL_o415
ApiStatus SetSpriteShading(Evt *script, b32 isInitialCall)
ApiStatus EnableModel(Evt *script, b32 isInitialCall)
Enables or disables the given model.
ApiStatus TranslateModel(Evt *script, b32 isInitialCall)
Translates the given model's position.
ApiStatus RotateModel(Evt *script, b32 isInitialCall)
Rotates the model the given amount on the selected axis.
ApiStatus SetTexPanOffset(Evt *script, b32 isInitialCall)
Sets offsets for texture panners.
ApiStatus ScaleModel(Evt *script, b32 isInitialCall)
Scales the model the given amount along the selected axis.
ApiStatus SetCamBGColor(Evt *script, b32 isInitialCall)
ApiStatus RandInt(Evt *script, b32 isInitialCall)
ApiStatus CloneModel(Evt *script, b32 isInitialCall)
Clones the given model.
ApiStatus SetTexPanner(Evt *script, b32 isInitialCall)
Sets a model's pannerID and sets the texture pan flag.
#define LVar6
Definition macros.h:154
#define Mul(VAR, INT_VALUE)
Definition macros.h:378
#define DivF(VAR, FLOAT_VALUE)
Definition macros.h:386
#define IfGe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR >= RVAR.
Definition macros.h:284
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define AddF(VAR, FLOAT_VALUE)
Definition macros.h:383
#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 UseBuf(INT_PTR)
Loads a s32 pointer for use with subsequent EVT_BUF_READ commands.
Definition macros.h:389
#define Mod(VAR, INT_VALUE)
Definition macros.h:380
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define BufRead1(VAR)
Consumes the next s32 from the buffer and stores it in the given variable.
Definition macros.h:392
#define IfLt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR < RVAR.
Definition macros.h:275
#define Float(DOUBLE)
Definition macros.h:51
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar5
Definition macros.h:153
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define LVar7
Definition macros.h:155
#define BreakLoop
Breaks out of the innermost loop.
Definition macros.h:251
#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 SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
Definition macros.h:373
#define Div(VAR, INT_VALUE)
Definition macros.h:379
#define LVar8
Definition macros.h:156
#define LVar2
Definition macros.h:150
#define MulF(VAR, FLOAT_VALUE)
Definition macros.h:385
#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 LVar9
Definition macros.h:157
#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 LVarE
Definition macros.h:162
#define LVar0
Definition macros.h:148
#define Exec(EVT_SOURCE)
Launches a new thread.
Definition macros.h:455
#define Return
Kills the current EVT thread.
Definition macros.h:217
#define CLONED_MODEL(idx)
Definition map.h:18
#define STAGE_MODEL_LIST_END
Definition battle.h:8