Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
fx_api.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3
4void show_start_recovery_shimmer(f32 x, f32 y, f32 z, s32 amt) {
5 fx_stars_shimmer(1, x, y, z, amt + 30, amt + 30, (amt / 2) + 10, 30);
6}
7
8void show_recovery_shimmer(f32 x, f32 y, f32 z, s32 amt) {
9 fx_stars_shimmer(2, x, y, z, amt + 30, amt + 30, (amt / 2) + 10, 30);
10}
11
12API_CALLABLE(ShowStartRecoveryShimmer) {
13 Bytecode* args = script->ptrReadPos;
14 f32 x = evt_get_float_variable(script, *args++);
15 f32 y = evt_get_float_variable(script, *args++);
16 f32 z = evt_get_float_variable(script, *args++);
17
18 show_start_recovery_shimmer(x, y, z, evt_get_variable(script, *args++));
20 return ApiStatus_DONE2;
21}
22
23API_CALLABLE(ShowRecoveryShimmer) {
24 Bytecode* args = script->ptrReadPos;
25 f32 x = evt_get_float_variable(script, *args++);
26 f32 y = evt_get_float_variable(script, *args++);
27 f32 z = evt_get_float_variable(script, *args++);
28
29 show_recovery_shimmer(x, y, z, evt_get_variable(script, *args++));
31 return ApiStatus_DONE2;
32}
33
34API_CALLABLE(func_802D7690) {
35 Bytecode* args = script->ptrReadPos;
36 f32 posX = evt_get_float_variable(script, *args++);
37 f32 posY = evt_get_float_variable(script, *args++);
38 f32 posZ = evt_get_float_variable(script, *args++);
39 f32 angle = evt_get_float_variable(script, *args++);
40 f32 magnitude = evt_get_float_variable(script, *args++);
41 s32 duration = evt_get_variable(script, *args++);
42 f32 offsetX, offsetY, offsetZ;
43 f32 sinA, cosA;
44
45 if (isInitialCall) {
46 script->functionTemp[0] = 0;
47 }
48
49 offsetX = rand_int(10) - 5;
50 offsetZ = rand_int(10) - 5;
51 offsetY = -2.0f - ((SQ(offsetX) + SQ(offsetZ)) / 5.0f);
52 sinA = sin_rad(DEG_TO_RAD(angle));
53 cosA = cos_rad(DEG_TO_RAD(angle));
54 fx_cloud_trail(
55 posX + ((sinA * magnitude * script->functionTemp[0]) / duration) + offsetX,
56 posY + 15.5f + offsetY,
57 posZ + ((-cosA * magnitude * script->functionTemp[0]) / duration) + offsetZ,
58 0.0f
59 );
60
61 script->functionTemp[0]++;
62 if (script->functionTemp[0] < duration) {
63 return ApiStatus_BLOCK;
64 } else {
65 return ApiStatus_DONE2;
66 }
67}
68
69API_CALLABLE(ShowEmote) {
70 Bytecode* args = script->ptrReadPos;
71 s32 npcID = evt_get_variable(script, *args++);
72 s32 emoteType = evt_get_variable(script, *args++);
73 f32 pitch = evt_get_float_variable(script, *args++);
74 s32 duration = evt_get_variable(script, *args++);
75 s32 emoterType = evt_get_variable(script, *args++);
76 f32 dX = evt_get_float_variable(script, *args++);
77 f32 dY = evt_get_float_variable(script, *args++);
78 f32 dZ = evt_get_float_variable(script, *args++);
79 f32 radius = evt_get_float_variable(script, *args++);
80
81 Npc* npc;
82 EffectInstance* emoteHandle;
83 f32 x, y, z, r;
84
85 switch (emoterType) {
86 case EMOTER_PLAYER:
87 // show emote from player
88 npc = (Npc*)-1;
89 x = 0.0f;
90 y = (gPlayerStatus.colliderHeight * 2) / 3;
91 z = 0.0f;
93 break;
94 case EMOTER_NPC:
95 // show emote from NPC
96 npc = resolve_npc(script, npcID);
97 if (npc == NULL) {
98 return ApiStatus_DONE2;
99 }
100 x = 0.0f;
101 y = (npc->collisionHeight * 4) / 5;
102 z = 0.0f;
103 r = npc->collisionHeight / 3;
104 break;
105 default:
106 // show emote at arbitrary position
107 x = dX;
108 y = dY;
109 z = dZ;
110 r = radius;
111 npc = NULL;
112 break;
113 }
114
115 fx_emote(emoteType, npc, x, y, z, r, pitch, duration, &emoteHandle);
116 return ApiStatus_DONE2;
117}
118
119API_CALLABLE(RemoveEffect) {
120 Bytecode* args = script->ptrReadPos;
121
123 return ApiStatus_DONE2;
124}
125
126API_CALLABLE(DismissEffect) {
127 Bytecode* args = script->ptrReadPos;
128 EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
129
131 return ApiStatus_DONE2;
132}
133
134API_CALLABLE(DismissItemOutline) {
135 Bytecode* args = script->ptrReadPos;
136 EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
137
138 effect->data.gotItemOutline->timeLeft = 10;
139 return ApiStatus_DONE2;
140}
141
142API_CALLABLE(func_802D7B74) {
143 Bytecode* args = script->ptrReadPos;
144 EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
145
146 // function is never called, so the effect type can't be inferred
147 effect->data.any[12] = 5;
148 return ApiStatus_DONE2;
149}
150
151API_CALLABLE(InterpMotionBlurParams) {
152 s32 centerX0 = script->varTable[1];
153 s32 centerY0 = script->varTable[2];
154 s32 centerX1 = script->varTable[3];
155 s32 centerY1 = script->varTable[4];
156 s32 finalAmt = script->varTable[5];
157 s32 duration = script->varTable[6];
158 s32 delta;
159 u8 overlayType;
160 f32 initialAmt;
161
162 if (isInitialCall) {
163 script->functionTemp[0] = duration;
164 get_screen_overlay_params(SCREEN_LAYER_BACK, &overlayType, &initialAmt);
165 script->functionTemp[1] = initialAmt;
166 set_screen_overlay_center(SCREEN_LAYER_BACK, 0, centerX0, centerY0);
167 set_screen_overlay_center(SCREEN_LAYER_BACK, 1, centerX1, centerY1);
168 }
169
170 get_screen_overlay_params(SCREEN_LAYER_BACK, &overlayType, &initialAmt);
171 // lerp from initialAmt (stored in functionTemp[1]) to finalAmt (stored in varTable[5])
172 delta = (script->functionTemp[1] - finalAmt);
173 set_screen_overlay_params_back(OVERLAY_BLUR, (delta * script->functionTemp[0] / duration) + finalAmt);
174
175 script->functionTemp[0]--;
176 if (script->functionTemp[0] < 0) {
178 return ApiStatus_DONE2;
179 }
180 return ApiStatus_BLOCK;
181}
182
188
189API_CALLABLE(SetMotionBlurParams) {
190 Bytecode* args = script->ptrReadPos;
191 s32 var0 = evt_get_variable(script, *args++);
192 s32 centerX0 = evt_get_variable(script, *args++);
193 s32 centerY0 = evt_get_variable(script, *args++);
194 s32 centerX1 = evt_get_variable(script, *args++);
195 s32 centerY1 = evt_get_variable(script, *args++);
196 s32 finalAmt = evt_get_variable(script, *args++);
197 s32 duration = evt_get_variable(script, *args++);
198
200 blurEvt->varTable[0] = var0;
201 blurEvt->varTable[1] = centerX0;
202 blurEvt->varTable[2] = centerY0;
203 blurEvt->varTable[3] = centerX1;
204 blurEvt->varTable[4] = centerY1;
205 blurEvt->varTable[5] = finalAmt;
206 blurEvt->varTable[6] = duration;
207
208 return ApiStatus_DONE2;
209}
210
211API_CALLABLE(ShowSweat) {
212 Bytecode* args = script->ptrReadPos;
213 s32 npcID = evt_get_variable(script, *args++);
214 s32 type = evt_get_variable(script, *args++);
215 f32 pitch = evt_get_float_variable(script, *args++);
216 s32 emoterType = evt_get_variable(script, *args++);
217 f32 posX = evt_get_float_variable(script, *args++);
218 f32 posY = evt_get_float_variable(script, *args++);
219 f32 posZ = evt_get_float_variable(script, *args++);
220 f32 radius = evt_get_float_variable(script, *args++);
221 s32 duration = evt_get_variable(script, *args++);
222
223 Npc* npc;
224 f32 x, y, z, r;
225
226 switch (emoterType) {
227 case EMOTER_PLAYER:
228 x = gPlayerStatus.pos.x;
230 z = gPlayerStatus.pos.z;
232 break;
233 case EMOTER_NPC:
234 npc = resolve_npc(script, npcID);
235 if (npc == NULL) {
236 return ApiStatus_DONE2;
237 }
238 x = npc->pos.x;
239 y = npc->pos.y + (npc->collisionHeight * 2) / 3;
240 z = npc->pos.z;
241 r = npc->collisionHeight / 3;
242 break;
243 default:
244 x = posX;
245 y = posY;
246 z = posZ;
247 r = radius;
248 break;
249 }
250
251 fx_sweat(type, x, y, z, r, pitch, duration);
252 return ApiStatus_DONE2;
253}
254
255API_CALLABLE(ShowSleepBubble) {
256 Bytecode* args = script->ptrReadPos;
257 s32 npcID = evt_get_variable(script, *args++);
258 s32 type = evt_get_variable(script, *args++);
259 f32 pitch = evt_get_float_variable(script, *args++);
260 s32 emoterType = evt_get_variable(script, *args++);
261 f32 posX = evt_get_float_variable(script, *args++);
262 f32 posY = evt_get_float_variable(script, *args++);
263 f32 posZ = evt_get_float_variable(script, *args++);
264 f32 radius = evt_get_float_variable(script, *args++);
265 s32 outVar = *args++;
266
267 Npc* npc;
268 f32 x, y, z, r;
269 EffectInstance* effectHandle;
270
271 switch (emoterType) {
272 case EMOTER_PLAYER:
273 x = gPlayerStatus.pos.x;
275 z = gPlayerStatus.pos.z;
277 break;
278 case EMOTER_NPC:
279 npc = resolve_npc(script, npcID);
280 if (npc == NULL) {
281 return ApiStatus_DONE2;
282 }
283 x = npc->pos.x;
284 y = npc->pos.y + (npc->collisionHeight * 2) / 3;
285 z = npc->pos.z;
286 r = npc->collisionHeight / 3;
287 break;
288 default:
289 x = posX;
290 y = posY;
291 z = posZ;
292 r = radius;
293 break;
294 }
295
296 fx_sleep_bubble(type, x, y, z, r, pitch, &effectHandle);
297 evt_set_variable(script, outVar, (s32)effectHandle);
298 return ApiStatus_DONE2;
299}
300
301API_CALLABLE(SetSleepBubbleTimeLeft) {
302 Bytecode* args = script->ptrReadPos;
303 EffectInstance* effect = (EffectInstance*)evt_get_variable(script, *args++);
304 s32 value = evt_get_variable(script, *args++);
305
306 effect->data.sleepBubble->timeLeft = value;
307 return ApiStatus_DONE2;
308}
309
310API_CALLABLE(PlayEffect_impl) {
311 Bytecode* intArgs = script->ptrReadPos;
312 Bytecode* floatArgs = script->ptrReadPos;
313 Bytecode* args = script->ptrReadPos;
314
315 s32 effectID = evt_get_variable(script, *intArgs++);
316 EffectInstance* effectRet = NULL;
317 s32 new_var;
318
319 s32 iVar1, iVar2, iVar3, iVar4, iVar5;
320 s32 iVar6, iVar7, iVar8, iVar9, iVar10;
321
322 f32 fVar1, fVar2, fVar3, fVar4, fVar5, fVar6;
323 f32 fVar7, fVar8, fVar9, fVar10, fVar11;
324
325 EffectInstance* sp30;
326 EffectInstance* sp34;
327 EffectInstance* sp38;
328 EffectInstance* sp3C;
329
330 s32 a2, a6, a7, a8, a9;
331
332 evt_get_variable(script, *floatArgs++);
333 evt_get_variable(script, *args++);
334
335 new_var = evt_get_variable(script, *intArgs++);
336 iVar2 = evt_get_variable(script, *intArgs++);
337 iVar3 = evt_get_variable(script, *intArgs++);
338 iVar4 = evt_get_variable(script, *intArgs++);
339 iVar5 = evt_get_variable(script, *intArgs++);
340 iVar6 = evt_get_variable(script, *intArgs++);
341 iVar7 = evt_get_variable(script, *intArgs++);
342 iVar8 = evt_get_variable(script, *intArgs++);
343 iVar9 = evt_get_variable(script, *intArgs++);
344 iVar10 = evt_get_variable(script, *intArgs++);
345 evt_get_variable(script, *intArgs++);
346 evt_get_variable(script, *intArgs++);
347 evt_get_variable(script, *intArgs++);
348
349 fVar1 = evt_get_float_variable(script, *floatArgs++);
350 fVar2 = evt_get_float_variable(script, *floatArgs++);
351 fVar3 = evt_get_float_variable(script, *floatArgs++);
352 fVar4 = evt_get_float_variable(script, *floatArgs++);
353 fVar5 = evt_get_float_variable(script, *floatArgs++);
354 fVar6 = evt_get_float_variable(script, *floatArgs++);
355 fVar7 = evt_get_float_variable(script, *floatArgs++);
356 fVar8 = evt_get_float_variable(script, *floatArgs++);
357 fVar9 = evt_get_float_variable(script, *floatArgs++);
358 fVar10 = evt_get_float_variable(script, *floatArgs++);
359 fVar11 = evt_get_float_variable(script, *floatArgs++);
360 evt_get_float_variable(script, *floatArgs++);
361 evt_get_float_variable(script, *floatArgs++);
362
363 args++;
364 a2 = *args++;
365 args++;
366 args++;
367 args++;
368 a6 = *args++;
369 a7 = *args++;
370 a8 = *args++;
371 a9 = *args++;
372
373 iVar1 = new_var;
374
375 switch (effectID) {
376 case EFFECT_00:
377 fx_blast(0, fVar1, fVar2, fVar3, 3.0f, iVar5);
378 break;
379 case EFFECT_BIG_SMOKE_PUFF:
380 fx_big_smoke_puff(fVar1, fVar2, fVar3);
381 break;
382 case EFFECT_LANDING_DUST:
383 fx_landing_dust(iVar1, fVar2, fVar3, fVar4, fVar5);
384 break;
385 case EFFECT_WALKING_DUST:
386 fx_walking_dust(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6);
387 break;
388 case EFFECT_FLOWER_SPLASH:
389 fx_flower_splash(fVar1, fVar2, fVar3, fVar4);
390 break;
391 case EFFECT_FLOWER_TRAIL:
392 fx_flower_trail(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6);
393 break;
394 case EFFECT_CLOUD_PUFF:
395 fx_cloud_puff(fVar1, fVar2, fVar3, fVar4);
396 break;
397 case EFFECT_CLOUD_TRAIL:
398 fx_cloud_trail(iVar1, fVar2, fVar3, fVar4);
399 break;
400 case EFFECT_FOOTPRINT:
401 fx_footprint(fVar1, fVar2, fVar3, fVar4, fVar5);
402 break;
403 case EFFECT_FLOATING_FLOWER:
404 fx_floating_flower(0, fVar1, fVar2, fVar3, iVar4);
405 break;
406 case EFFECT_SNOWFLAKE:
407 fx_snowflake(fVar1, fVar2, fVar3, iVar4);
408 break;
409 case EFFECT_STAR:
410 fx_star(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, fVar8);
411 break;
412 case EFFECT_EMOTE:
413 fx_emote(iVar1, (Npc*) a2, fVar3, fVar4, fVar5, fVar6, fVar7, iVar8, &sp30);
414 evt_set_variable(script, a8, (s32) sp30);
415 break;
416 case EFFECT_SPARKLES:
417 fx_sparkles(iVar1, fVar2, fVar3, fVar4, fVar5);
418 break;
419 case EFFECT_SHAPE_SPELL:
420 fx_shape_spell(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, iVar8);
421 break;
422 case EFFECT_GATHER_ENERGY_PINK:
423 fx_gather_energy_pink(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
424 break;
425 case EFFECT_DROP_LEAVES:
426 fx_drop_leaves(iVar1, fVar2, fVar3, fVar4, iVar5);
427 break;
428 case EFFECT_DUST:
429 fx_dust(iVar1, fVar2, fVar3, fVar4, iVar5);
430 break;
431 case EFFECT_SHATTERING_STONES:
432 fx_shattering_stones(iVar1, fVar2, fVar3, fVar4, fVar5);
433 break;
434 case EFFECT_SMOKE_RING:
435 fx_smoke_ring(iVar1, fVar2, fVar3, fVar4);
436 break;
437 case EFFECT_DAMAGE_STARS:
438 fx_damage_stars(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, iVar8);
439 break;
440 case EFFECT_EXPLOSION:
441 fx_explosion(iVar1, fVar2, fVar3, fVar4);
442 break;
443 case EFFECT_LENS_FLARE:
444 fx_lens_flare(iVar1, fVar2, fVar3, fVar4, iVar5);
445 break;
446 case EFFECT_GOT_ITEM_OUTLINE:
447 fx_got_item_outline(iVar1, fVar2, fVar3, fVar4, fVar5, &sp34);
448 evt_set_variable(script, a6, (s32) sp34);
449 break;
450 case EFFECT_SPIKY_WHITE_AURA:
451 fx_spiky_white_aura(iVar1, fVar2, fVar3, fVar4, iVar5);
452 break;
453 case EFFECT_SMOKE_IMPACT:
454 fx_smoke_impact(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6, fVar7, iVar8);
455 break;
456 case EFFECT_DAMAGE_INDICATOR:
457 fx_damage_indicator(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, iVar7, &sp30);
458 evt_set_variable(script, a8, (s32) sp30);
459 break;
460 case EFFECT_PURPLE_RING:
461 fx_purple_ring(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, fVar8);
462 break;
463 case EFFECT_STARS_BURST:
464 fx_stars_burst(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, iVar7);
465 break;
466 case EFFECT_STARS_SHIMMER:
467 fx_stars_shimmer(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, iVar7, iVar8);
468 break;
469 case EFFECT_RISING_BUBBLE:
470 fx_rising_bubble(iVar1, fVar2, fVar3, fVar4, fVar5);
471 break;
472 case EFFECT_RING_BLAST:
473 fx_ring_blast(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
474 break;
475 case EFFECT_SHOCKWAVE:
476 fx_shockwave(iVar1, fVar2, fVar3, fVar4);
477 break;
478 case EFFECT_MUSIC_NOTE:
479 fx_music_note(iVar1, fVar2, fVar3, fVar4);
480 break;
481 case EFFECT_SMOKE_BURST:
482 fx_smoke_burst(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
483 break;
484 case EFFECT_SWEAT:
485 fx_sweat(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, iVar7);
486 break;
487 case EFFECT_SLEEP_BUBBLE:
488 fx_sleep_bubble(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, &sp38);
489 evt_set_variable(script, a7, (s32) sp38);
490 break;
491 case EFFECT_WINDY_LEAVES:
492 fx_windy_leaves(iVar1, fVar2, fVar3, fVar4);
493 break;
494 case EFFECT_FLAME:
495 fx_flame(iVar1, fVar2, fVar3, fVar4, fVar5, &sp34);
496 evt_set_variable(script, a6, (s32) sp34);
497 break;
498 case EFFECT_FALLING_LEAVES:
499 fx_falling_leaves(iVar1, fVar2, fVar3, fVar4);
500 break;
501 case EFFECT_STARS_SPREAD:
502 fx_stars_spread(iVar1, fVar2, fVar3, fVar4, iVar5, iVar6);
503 break;
504 case EFFECT_STEAM_BURST:
505 fx_steam_burst(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
506 break;
507 case EFFECT_STARS_ORBITING:
508 fx_stars_orbiting(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6, &sp38);
509 evt_set_variable(script, a7, (s32) sp38);
510 break;
511 case EFFECT_BIG_SNOWFLAKES:
512 fx_big_snowflakes(iVar1, fVar2, fVar3, fVar4);
513 break;
514 case EFFECT_DEBUFF:
515 fx_debuff(iVar1, fVar2, fVar3, fVar4);
516 break;
517 case EFFECT_GREEN_IMPACT:
518 fx_green_impact(iVar1, fVar2, fVar3, fVar4, fVar5);
519 break;
520 case EFFECT_RADIAL_SHIMMER:
521 fx_radial_shimmer(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
522 break;
523 case EFFECT_ENDING_DECALS:
524 fx_ending_decals(iVar1, fVar2, fVar3, fVar4, fVar5, &sp34);
525 evt_set_variable(script, a6, (s32) sp34);
526 break;
527 case EFFECT_LIGHT_RAYS:
528 fx_light_rays(iVar1, fVar2, fVar3, fVar4, fVar5, &sp34);
529 evt_set_variable(script, a6, (s32) sp34);
530 break;
531 case EFFECT_LIGHTNING:
532 effectRet = fx_lightning(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6);
533 break;
534 case EFFECT_FIRE_BREATH:
535 effectRet = fx_fire_breath(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, iVar8, iVar9, iVar10);
536 break;
537 case EFFECT_SHIMMER_BURST:
538 fx_shimmer_burst(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
539 break;
540 case EFFECT_ENERGY_SHOCKWAVE:
541 fx_energy_shockwave(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
542 break;
543 case EFFECT_SHIMMER_WAVE:
544 fx_shimmer_wave(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, iVar7, iVar8);
545 break;
546 case EFFECT_AURA:
547 fx_aura(iVar1, fVar2, fVar3, fVar4, fVar5, &sp34);
548 evt_set_variable(script, a6, (s32) sp34);
549 break;
550 case EFFECT_BULB_GLOW:
551 fx_bulb_glow(iVar1, fVar2, fVar3, fVar4, fVar5, &sp34);
552 evt_set_variable(script, a6, (s32) sp34);
553 break;
554 case EFFECT_3D:
555 fx_effect_3D(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, iVar8, &sp3C);
556 evt_set_variable(script, a9, (s32) sp3C);
557 break;
558 case EFFECT_BLAST:
559 fx_blast(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
560 break;
561 case EFFECT_FIRE_FLOWER:
562 effectRet = fx_fire_flower(iVar1, fVar2, fVar3, fVar4, iVar5);
563 break;
564 case EFFECT_RECOVER:
565 effectRet = fx_recover(iVar1, fVar2, fVar3, fVar4, iVar5);
566 break;
567 case EFFECT_DISABLE_X:
568 effectRet = fx_disable_x(iVar1, fVar2, fVar3, fVar4, iVar5);
569 break;
570 case EFFECT_BOMBETTE_BREAKING:
571 effectRet = fx_bombette_breaking(iVar1, iVar2, iVar3, fVar4, iVar5, iVar6);
572 break;
573 case EFFECT_FIREWORK:
574 effectRet = fx_firework(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
575 break;
576 case EFFECT_CONFETTI:
577 effectRet = fx_confetti(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
578 break;
579 case EFFECT_SNOWFALL:
580 effectRet = fx_snowfall(iVar1, iVar2);
581 break;
582 case EFFECT_46:
583 effectRet = fx_effect_46(iVar1, (PlayerStatus*) a2, fVar3, iVar4);
584 break;
585 case EFFECT_GATHER_MAGIC:
586 effectRet = fx_gather_magic(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
587 break;
588 case EFFECT_ATTACK_RESULT_TEXT:
589 effectRet = fx_attack_result_text(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
590 break;
591 case EFFECT_SMALL_GOLD_SPARKLE:
592 effectRet = fx_small_gold_sparkle(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
593 break;
594 case EFFECT_FLASHING_BOX_SHOCKWAVE:
595 effectRet = fx_flashing_box_shockwave(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6);
596 break;
597 case EFFECT_BALLOON:
598 effectRet = fx_balloon(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
599 break;
600 case EFFECT_FLOATING_ROCK:
601 effectRet = fx_floating_rock(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, fVar8, iVar9);
602 break;
603 case EFFECT_CHOMP_DROP:
604 effectRet = fx_chomp_drop(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, fVar8, fVar9, iVar10);
605 break;
606 case EFFECT_QUIZMO_STAGE:
607 effectRet = fx_quizmo_stage(iVar1, fVar2, fVar3, fVar4);
608 break;
609 case EFFECT_RADIATING_ENERGY_ORB:
610 effectRet = fx_radiating_energy_orb(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
611 break;
612 case EFFECT_ENERGY_ORB_WAVE:
613 effectRet = fx_energy_orb_wave(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
614 break;
615 case EFFECT_MERLIN_HOUSE_STARS:
616 effectRet = fx_merlin_house_stars(iVar1, fVar2, fVar3, fVar4);
617 break;
618 case EFFECT_MOTION_BLUR_FLAME:
619 effectRet = fx_motion_blur_flame(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
620 break;
621 case EFFECT_STAT_CHANGE:
622 effectRet = fx_stat_change(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
623 break;
624 case EFFECT_SNAKING_STATIC:
625 effectRet = fx_snaking_static(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
626 break;
627 case EFFECT_THUNDERBOLT_RING:
628 effectRet = fx_thunderbolt_ring(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
629 break;
630 case EFFECT_SQUIRT:
631 effectRet = fx_squirt(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, fVar8, iVar9);
632 break;
633 case EFFECT_WATER_BLOCK:
634 effectRet = fx_water_block(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
635 break;
636 case EFFECT_WATERFALL:
637 effectRet = fx_waterfall(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
638 break;
639 case EFFECT_WATER_FOUNTAIN:
640 effectRet = fx_water_fountain(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
641 break;
642 case EFFECT_UNDERWATER:
643 effectRet = fx_underwater(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
644 break;
645 case EFFECT_LIGHTNING_BOLT:
646 effectRet = fx_lightning_bolt(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, fVar8, iVar9);
647 break;
648 case EFFECT_WATER_SPLASH:
649 effectRet = fx_water_splash(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
650 break;
651 case EFFECT_SNOWMAN_DOLL:
652 effectRet = fx_snowman_doll(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
653 break;
654 case EFFECT_FRIGHT_JAR:
655 effectRet = fx_fright_jar(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
656 break;
657 case EFFECT_STOP_WATCH:
658 effectRet = fx_stop_watch(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
659 break;
660 case EFFECT_63:
661 effectRet = fx_effect_63(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, fVar8, iVar9, iVar10);
662 break;
663 case EFFECT_THROW_SPINY:
664 effectRet = fx_throw_spiny(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, fVar8, iVar9);
665 break;
666 case EFFECT_65:
667 effectRet = fx_effect_65(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
668 break;
669 case EFFECT_TUBBA_HEART_ATTACK:
670 effectRet = fx_tubba_heart_attack(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
671 break;
672 case EFFECT_WHIRLWIND:
673 effectRet = fx_whirlwind(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
674 break;
675 case EFFECT_RED_IMPACT:
676 effectRet = fx_red_impact(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
677 break;
678 case EFFECT_FLOATING_CLOUD_PUFF:
679 effectRet = fx_floating_cloud_puff(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
680 break;
681 case EFFECT_ENERGY_IN_OUT:
682 effectRet = fx_energy_in_out(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
683 break;
684 case EFFECT_TATTLE_WINDOW:
685 effectRet = fx_tattle_window(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
686 break;
687 case EFFECT_SHINY_FLARE:
688 effectRet = fx_shiny_flare(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
689 break;
690 case EFFECT_HUFF_PUFF_BREATH:
691 effectRet = fx_huff_puff_breath(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, iVar8);
692 break;
693 case EFFECT_COLD_BREATH:
694 effectRet = fx_cold_breath(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
695 break;
696 case EFFECT_EMBERS:
697 effectRet = fx_embers(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, iVar8, iVar9, fVar10, fVar11);
698 break;
699 case EFFECT_HIEROGLYPHS:
700 effectRet = fx_hieroglyphs(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
701 break;
702 case EFFECT_MISC_PARTICLES:
703 effectRet = fx_misc_particles(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, iVar8, iVar9);
704 break;
705 case EFFECT_STATIC_STATUS:
706 effectRet = fx_static_status(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6, iVar7);
707 break;
708 case EFFECT_MOVING_CLOUD:
709 effectRet = fx_moving_cloud(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, fVar8, fVar9);
710 break;
711 case EFFECT_75:
712 effectRet = fx_effect_75(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
713 break;
714 case EFFECT_FIREWORK_ROCKET:
715 effectRet = fx_firework_rocket(iVar1, fVar2, fVar3, fVar4, fVar5, fVar6, fVar7, fVar8, iVar9);
716 break;
717 case EFFECT_PEACH_STAR_BEAM:
718 effectRet = fx_peach_star_beam(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
719 break;
720 case EFFECT_BUTTERFLIES:
721 effectRet = fx_butterflies(iVar1, fVar2, fVar3, fVar4);
722 break;
723 case EFFECT_CHAPTER_CHANGE:
724 effectRet = fx_chapter_change(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
725 break;
726 case EFFECT_ICE_SHARD:
727 effectRet = fx_ice_shard(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
728 break;
729 case EFFECT_SPIRIT_CARD:
730 effectRet = fx_spirit_card(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
731 break;
732 case EFFECT_LIL_OINK:
733 effectRet = fx_lil_oink(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
734 break;
735 case EFFECT_SOMETHING_ROTATING:
736 effectRet = fx_something_rotating(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
737 break;
738 case EFFECT_BREAKING_JUNK:
739 effectRet = fx_breaking_junk(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
740 break;
741 case EFFECT_PARTNER_BUFF:
742 effectRet = fx_partner_buff(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
743 break;
744 case EFFECT_QUIZMO_ASSISTANT:
745 effectRet = fx_quizmo_assistant(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
746 break;
747 case EFFECT_ICE_PILLAR:
748 effectRet = fx_ice_pillar(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
749 break;
750 case EFFECT_SUN:
751 effectRet = fx_sun(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
752 break;
753 case EFFECT_STAR_SPIRITS_ENERGY:
754 effectRet = fx_star_spirits_energy(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
755 break;
756 case EFFECT_PINK_SPARKLES:
757 effectRet = fx_pink_sparkles(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
758 break;
759 case EFFECT_STAR_OUTLINE:
760 effectRet = fx_star_outline(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
761 break;
762 case EFFECT_86:
763 effectRet = fx_effect_86(iVar1, fVar2, fVar3, fVar4, fVar5, iVar6);
764 break;
765 default:
766 PANIC();
767 }
768
769 if (effectRet != NULL) {
770 evt_set_variable(script, LVarF, (s32) effectRet);
771 }
772
773 return ApiStatus_DONE2;
774}
Bytecode EvtScript[]
#define sfx_play_sound_at_position
#define remove_effect
#define rand_int
struct GotItemOutlineFXData * gotItemOutline
Definition effects.h:2491
struct SleepBubbleFXData * sleepBubble
Definition effects.h:2505
s32 * any
Definition effects.h:2463
EffectData data
Definition effects.h:2605
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517
@ OVERLAY_BLUR
Definition enums.h:2400
@ SCREEN_LAYER_BACK
Definition enums.h:2383
@ EMOTER_PLAYER
Definition enums.h:504
@ EMOTER_NPC
Definition enums.h:505
@ SOUND_START_RECOVERY
Definition enums.h:1385
@ SOUND_RECOVERY_SHMMER
Definition enums.h:1192
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
@ EVT_PRIORITY_1
Definition evt.h:152
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
#define ApiStatus_BLOCK
Definition evt.h:116
void set_screen_overlay_params_back(u8, f32)
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1847
f32 cos_rad(f32 x)
Definition 43F0.c:717
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
void set_screen_overlay_center(s32, s32, s32, s32)
Npc * resolve_npc(Evt *script, s32 npcIdOrPtr)
Definition npc_api.c:8
void get_screen_overlay_params(s32, u8 *type, f32 *zoom)
f32 evt_get_float_variable(Evt *script, Bytecode var)
Definition evt.c:1930
f32 sin_rad(f32 x)
Definition 43F0.c:713
void show_recovery_shimmer(f32 x, f32 y, f32 z, s32 amt)
Definition fx_api.c:8
void show_start_recovery_shimmer(f32 x, f32 y, f32 z, s32 amt)
Definition fx_api.c:4
EvtScript EVS_UpdateMotionBlurParams
Definition fx_api.c:183
ApiStatus SetSleepBubbleTimeLeft(Evt *script, b32 isInitialCall)
ApiStatus ShowRecoveryShimmer(Evt *script, b32 isInitialCall)
ApiStatus ShowSweat(Evt *script, b32 isInitialCall)
ApiStatus SetMotionBlurParams(Evt *script, b32 isInitialCall)
ApiStatus func_802D7B74(Evt *script, b32 isInitialCall)
ApiStatus RemoveEffect(Evt *script, b32 isInitialCall)
ApiStatus InterpMotionBlurParams(Evt *script, b32 isInitialCall)
ApiStatus func_802D7690(Evt *script, b32 isInitialCall)
ApiStatus ShowStartRecoveryShimmer(Evt *script, b32 isInitialCall)
ApiStatus PlayEffect_impl(Evt *script, b32 isInitialCall)
ApiStatus ShowEmote(Evt *script, b32 isInitialCall)
ApiStatus DismissItemOutline(Evt *script, b32 isInitialCall)
ApiStatus ShowSleepBubble(Evt *script, b32 isInitialCall)
ApiStatus DismissEffect(Evt *script, b32 isInitialCall)
#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 PANIC()
Definition macros.h:55
#define DEG_TO_RAD(deg)
Definition macros.h:134
#define SQ(x)
Definition macros.h:166
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Return
Kills the current EVT thread.
Definition macros.h:217
s16 collisionHeight
Vec3f pos
PlayerStatus gPlayerStatus
Definition 77480.c:39
void fx_damage_stars(s32, f32, f32, f32, f32, f32, f32, s32)