Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
MakeSun.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3#include "gcc/string.h"
4
5char* N(RightSunMaps)[] = {
6 "flo_03",
7 "flo_08",
8 "flo_09",
9 "flo_10",
10 "flo_16",
11 "flo_17",
12 "flo_18",
13 "flo_19",
14 "flo_21",
15 "flo_22",
16 "flo_24",
17};
18
19API_CALLABLE(N(SpawnSunEffect)) {
20 s32 direction = FX_SUN_FROM_LEFT;
21 u32 i;
22
23 for (i = 0; i < ARRAY_COUNT(N(RightSunMaps)); i++) {
24 if (strcmp(gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID].id, N(RightSunMaps)[i]) == 0) {
25 direction = FX_SUN_FROM_RIGHT;
26 break;
27 }
28 }
29
30 fx_sun(direction, 0, 0, 0, 0, 0);
31 return ApiStatus_DONE2;
32}
33
34EvtScript N(MakeSun) = {
36 Call(N(SpawnSunEffect))
37 EndIf
38 Return
39 End
40};
Bytecode EvtScript[]
@ FX_SUN_FROM_LEFT
Definition effects.h:2364
@ FX_SUN_FROM_RIGHT
Definition effects.h:2365
@ STORY_CH6_DESTROYED_PUFF_PUFF_MACHINE
Definition enums.h:191
#define ApiStatus_DONE2
Definition evt.h:118
@ GB_StoryProgress
#define IfGe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR >= RVAR.
Definition macros.h:284
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#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
char * id
Definition map.h:50
AreaConfig gAreas[29]
Zero-terminated.
Definition world.c:868
MapConfig * maps
Definition map.h:64
GameStatus * gGameStatusPtr
Definition main_loop.c:32