Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
kkj_02.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
3
4#define NAMESPACE A(kkj_02)
5
7
8s32 N(RandomBoltPositions)[][7] = {
9 { -22, 190, -91, -88, 21, -91, 60 },
10 { -1, 190, -91, 88, 24, -91, 10 },
11 { -67, 190, -91, -122, 10, -91, 90 },
12 { 57, 190, -91, -4, 17, -91, 60 },
13};
14
15EvtScript N(EVS_RandomBolts) = {
16 Label(0)
17 UseBuf(N(RandomBoltPositions))
18 Loop(ARRAY_COUNT(N(RandomBoltPositions)))
21 PlayEffect(EFFECT_LIGHTNING_BOLT, 0, LVar0, LVar1, LVar2, LVar3, LVar4, LVar5, 1, 8, 0)
22 Call(N(SetLightningBoltPurple))
24 Wait(LVar0)
26 Goto(0)
27 Return
28 End
29};
30
31s32 N(CirculatingBoltPositions)[][7] = {
32 { -121, 33, -104, -24, 41, -104, 5 },
33 { 36, 41, -104, 128, 34, -104, 30 },
34 { 146, 1, 113, 38, -15, 121, 5 },
35 { -66, -10, 115, -155, 1, 97, 90 },
36};
37
38EvtScript N(EVS_CirculatingBolts) = {
39 Label(0)
40 UseBuf(N(CirculatingBoltPositions))
41 Loop(ARRAY_COUNT(N(CirculatingBoltPositions)))
44 PlayEffect(EFFECT_LIGHTNING_BOLT, 0, LVar0, LVar1, LVar2, LVar3, LVar4, LVar5, 1, 5, 0)
45 Call(N(SetLightningBoltPurple))
47 Wait(LVar0)
49 Goto(0)
50 Return
51 End
52};
53
54EvtScript N(EVS_PreBattle) = {
55 Call(SetSpriteShading, SHADING_NONE)
56 Exec(N(EVS_RandomBolts))
57 Exec(N(EVS_CirculatingBolts))
58 Return
59 End
60};
61
62EvtScript N(EVS_PostBattle) = {
63 Return
64 End
65};
66
67Stage NAMESPACE = {
68 .texture = "kkj_tex",
69 .shape = "kkj_bt02_shape",
70 .hit = "kkj_bt02_hit",
71 .bg = "kpa_bg",
72 .preBattle = &N(EVS_PreBattle),
73 .postBattle = &N(EVS_PostBattle),
74};
Bytecode EvtScript[]
ApiStatus SetSpriteShading(Evt *script, b32 isInitialCall)
#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 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 ARRAY_COUNT(arr)
Definition macros.h:40
#define BufRead1(VAR)
Consumes the next s32 from the buffer and stores it in the given variable.
Definition macros.h:392
#define BufRead3(VAR1, VAR2, VAR3)
Consumes the next three s32s from the buffer and stores them in the given variables.
Definition macros.h:398
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define LVar5
Definition macros.h:153
#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 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 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