Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
StarPowerSupport.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
3#include "model.h"
4#include "effects.h"
5#include "sprite/player.h"
6
7API_CALLABLE(N(SpawnStarSparkleFX)) {
8 Bytecode* args = script->ptrReadPos;
9 s32 x = evt_get_variable(script, *args++);
10 s32 y = evt_get_variable(script, *args++);
11 s32 z = evt_get_variable(script, *args++);
12
13 fx_sparkles(FX_SPARKLES_0, x, y, z, 40.0f);
14 return ApiStatus_DONE2;
15}
16
17API_CALLABLE(N(SpawnWishSparkleFX)) {
18 Bytecode* args = script->ptrReadPos;
19 s32 x = evt_get_variable(script, *args++);
20 s32 y = evt_get_variable(script, *args++);
21 s32 z = evt_get_variable(script, *args++);
22
23 fx_stars_shimmer(5, x, y, z, 50.0f, 50.0f, 40, 30);
24 return ApiStatus_DONE2;
25}
26
27API_CALLABLE(N(SpawnStarSpiritArriveFX)) {
28 Bytecode* args = script->ptrReadPos;
29 s32 x = evt_get_variable(script, *args++);
30 s32 y = evt_get_variable(script, *args++);
31 s32 z = evt_get_variable(script, *args++);
32
33 fx_sparkles(FX_SPARKLES_0, x, y, z, 30.0f);
34 return ApiStatus_DONE2;
35}
36
37API_CALLABLE(N(SpawnStarSpiritDepartFX)) {
38 Bytecode* args = script->ptrReadPos;
39 s32 x = evt_get_variable(script, *args++);
40 s32 y = evt_get_variable(script, *args++);
41 s32 z = evt_get_variable(script, *args++);
42
43 fx_misc_particles(4, x, y, z, 20.0f, 20.0f, 1.0f, 10, 15);
44 return ApiStatus_DONE2;
45}
46
48
49API_CALLABLE(N(FadeBackgroundDarkenForBeam)) {
50 if (isInitialCall) {
54 script->functionTemp[0] = 0;
55 }
56
57 mdl_set_shroud_tint_params(0, 0, 0, script->functionTemp[0]);
58 script->functionTemp[0] += 10;
59
60 if (script->functionTemp[0] >= 230) {
61 mdl_set_shroud_tint_params(0, 0, 0, 230);
62 return ApiStatus_DONE2;
63 }
64
65 return ApiStatus_BLOCK;
66}
67
69
70API_CALLABLE(N(SetPartnerWishAnim)) {
72 Bytecode* args = script->ptrReadPos;
73 s32 wishAnimIdx = evt_get_variable(script, *args++);
74 AnimID anim = PartnerWishAnims[playerData->curPartner][wishAnimIdx];
75
77
78 return ApiStatus_DONE2;
79}
80
81API_CALLABLE(N(SetStarSpiritSize)) {
83
84 npc->collisionHeight = 32;
85 npc->collisionDiameter = 32;
86 return ApiStatus_DONE2;
87}
88
93 Wait(10)
96 Add(LVar0, 16)
100 Wait(8)
103 Add(LVar1, 15)
106 Wait(20)
108 Wait(10)
112 Wait(30)
114 Else
116 Wait(10)
119 Add(LVar0, 16)
124 Wait(8)
128 Add(LVar1, 15)
131 Wait(20)
134 Wait(10)
137 Wait(30)
139 EndIf
140 Return
141 End
142};
143
148 Wait(10)
151 Add(LVar0, 16)
155 Wait(8)
158 Add(LVar1, 15)
161 Wait(20)
163 Wait(10)
167 Wait(30)
169 Else
171 Wait(10)
174 Add(LVar0, 16)
179 Wait(8)
183 Add(LVar1, 15)
186 Wait(20)
189 Wait(10)
192 Wait(30)
194 EndIf
195 Return
196 End
197};
198
200 Wait(8)
208 Call(SetNpcPos, NPC_BTL_SPIRIT, -75, 150, 0)
210 Call(N(SpawnStarSpiritArriveFX), -75, 167, 0)
211 Wait(10)
213 Set(LVar0, 0)
214 Loop(8)
215 Add(LVar0, 67)
217 Wait(1)
218 EndLoop
219 Wait(10)
221 Thread
222 Wait(10)
226 Add(LVar1, 50)
229 Return
230 End
231};
232
238 Thread
239 Loop(5)
240 Wait(6)
243 EndLoop
246 Thread
247 Set(LVar2, 0)
248 Set(LVar3, 720)
250 Loop(0)
253 Wait(1)
254 IfEq(LVar1, 0)
256 EndIf
257 EndLoop
260 Add(LVar1, 60)
262 Add(LVar1, 140)
264 Wait(10)
267 Else
270 Thread
271 Loop(5)
272 Wait(6)
275 EndLoop
278 Thread
279 Set(LVar2, 0)
280 Set(LVar3, 720)
282 Loop(0)
285 Wait(1)
286 IfEq(LVar1, 0)
288 EndIf
289 EndLoop
292 Add(LVar1, 60)
294 Add(LVar1, 140)
296 Wait(10)
299 EndIf
300 Return
301 End
302};
303
308 Wait(15)
314 Else
316 Wait(15)
322 EndIf
323 Return
324 End
325};
326
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
u32 AnimID
@ FX_SPARKLES_0
Definition effects.h:234
@ ENV_TINT_SHROUD
Definition enums.h:4386
@ NPC_DECORATION_WHITE_GLOW_BEHIND
Definition enums.h:1923
PartnerWishAnims
Definition enums.h:3393
@ PARTNER_WISH_ANIM_IDLE
Definition enums.h:3398
@ PARTNER_WISH_ANIM_PRAY
Definition enums.h:3395
@ PARTNER_WISH_ANIM_WALK
Definition enums.h:3394
@ PARTNER_WISH_ANIM_RETURN
Definition enums.h:3397
@ BTL_CAM_DEFAULT
Definition enums.h:4823
@ BTL_CAM_PLAYER_WISH
Definition enums.h:4890
@ BTL_CAM_STAR_SPIRIT
Definition enums.h:4894
@ NPC_BTL_SPIRIT
Definition enums.h:2531
@ EASING_CUBIC_IN
Definition enums.h:512
@ EASING_COS_IN_OUT
Definition enums.h:520
@ SOUND_STAR_SPIRIT_APPEAR_A
Definition enums.h:1370
@ SOUND_BEGIN_WISH
Definition enums.h:963
@ SOUND_WISH_ASCENDING
Definition enums.h:1382
@ SOUND_STAR_SPIRIT_DEPART_3
Definition enums.h:1376
@ SOUND_STAR_SPIRIT_DEPART_1
Definition enums.h:1374
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_PARTNER
Definition enums.h:2086
@ NPC_FLAG_IGNORE_CAMERA_FOR_YAW
Definition enums.h:3016
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
#define ApiStatus_BLOCK
Definition evt.h:116
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1689
void mdl_set_all_tint_type(s32)
Definition model.c:4519
void set_actor_anim(s32 actorID, s32 partID, AnimID animID)
Definition 190B20.c:1005
void mdl_set_shroud_tint_params(u8 r, u8 g, u8 b, u8 a)
Definition model.c:3905
Npc * get_npc_unsafe(s32 npcID)
Definition npc.c:994
ApiStatus PlaySound(Evt *script, b32 isInitialCall)
ApiStatus FadeBackgroundLighten(Evt *script, b32 isInitialCall)
ApiStatus DeleteNpc(Evt *script, b32 isInitialCall)
ApiStatus UpdateLerp(Evt *script, b32 isInitialCall)
ApiStatus GetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus SetNpcDecoration(Evt *script, b32 isInitialCall)
ApiStatus SetNpcRotation(Evt *script, b32 isInitialCall)
ApiStatus FadeBackgroundDarken(Evt *script, b32 isInitialCall)
ApiStatus CreateNpc(Evt *script, b32 isInitialCall)
ApiStatus SetNpcPos(Evt *script, b32 isInitialCall)
ApiStatus MakeLerp(Evt *script, b32 isInitialCall)
ApiStatus SetNpcFlagBits(Evt *script, b32 isInitialCall)
ApiStatus EnableNpcBlur(Evt *script, b32 isInitialCall)
ApiStatus NpcFlyTo(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 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 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 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 LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217
s16 collisionDiameter
s16 collisionHeight
PlayerData gPlayerData
Definition 77480.c:40
u8 * gBackgroundTintModePtr
Definition model.c:105