Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
RandomFlowers.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3
4EvtScript N(EVS_RandomFlowers_Background) = {
5 Label(0)
6 // posX range: 125 to 375
7 Call(RandInt, 250, LVar0)
8 Sub(LVar0, 125)
9 // posY: 0
10 Set(LVar1, 0)
11 // posZ range: -100 to -60
12 Call(RandInt, 40, LVar2)
13 Sub(LVar2, 100)
14 Call(RandInt, 30, LVar3)
15 Add(LVar3, 90)
16 PlayEffect(EFFECT_FLOATING_FLOWER, LVar0, LVar1, LVar2, LVar3, 0, 0)
17 Call(RandInt, 20, LVar0)
18 Add(LVar0, 20)
19 Wait(LVar0)
20 Goto(0)
21 Return
22 End
23};
24
25EvtScript N(EVS_RandomFlowers_Foreground) = {
26 Label(0)
27 // posX range: 125 to 375
28 Call(RandInt, 250, LVar0)
29 Sub(LVar0, 125)
30 // posY: 0
31 Set(LVar1, 0)
32 // posZ range: 71 to 121
33 Call(RandInt, 50, LVar2)
34 Add(LVar2, 71)
35 Call(RandInt, 30, LVar3)
36 Add(LVar3, 90)
37 PlayEffect(EFFECT_FLOATING_FLOWER, LVar0, LVar1, LVar2, LVar3, 0, 0)
38 Call(RandInt, 30, LVar0)
39 Add(LVar0, 20)
40 Wait(LVar0)
41 Goto(0)
42 Return
43 End
44};
45
46EvtScript N(EVS_RandomFlowers_FarBack) = {
47 Label(0)
48 // posX range: 125 to 375
49 Call(RandInt, 250, LVar0)
50 Sub(LVar0, 125)
51 // posY: 50
52 Set(LVar1, 50)
53 // posZ range: -124 to -84
54 Call(RandInt, 40, LVar2)
55 Add(LVar2, -124)
56 Call(RandInt, 30, LVar3)
57 Add(LVar3, 90)
58 PlayEffect(EFFECT_FLOATING_FLOWER, LVar0, LVar1, LVar2, LVar3, 0, 0)
59 Call(RandInt, 30, LVar0)
60 Add(LVar0, 20)
61 Wait(LVar0)
62 Goto(0)
63 Return
64 End
65};
Bytecode EvtScript[]
ApiStatus RandInt(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 Sub(VAR, INT_VALUE)
Definition macros.h:377
#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 Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#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 LVar3
Definition macros.h:151
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217