Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
bill_blaster.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3#include "battle/battle.h"
4#include "script_api/battle.h"
5#include "sprite/npc/BillBlaster.h"
6
7#define NAMESPACE A(bill_blaster)
8
9extern s32 N(DefaultAnims)[];
10extern EvtScript N(EVS_Init);
11extern EvtScript N(EVS_Idle);
12extern EvtScript N(EVS_TakeTurn);
13extern EvtScript N(EVS_HandleEvent);
16
19
20enum N(ActorPartIDs) {
21 PRT_MAIN = 1,
22 PRT_TARGET = 2,
23};
24
25enum N(ActorVars) {
26 AVAR_BulletID = 0,
28};
29
30s32 N(DefenseTable)[] = {
33};
34
35s32 N(StatusTable)[] = {
58};
59
60ActorPartBlueprint N(ActorParts)[] = {
61 {
63 .index = PRT_MAIN,
64 .posOffset = { 0, 0, 0 },
65 .targetOffset = { -6, 29 },
66 .opacity = 255,
67 .idleAnimations = N(DefaultAnims),
68 .defenseTable = N(DefenseTable),
69 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
70 .elementImmunityFlags = 0,
71 .projectileTargetOffset = { 0, -9 },
72 },
73 {
75 .index = PRT_TARGET,
76 .posOffset = { 100, 0, 0 },
77 .targetOffset = { -106, 29 },
78 .opacity = 255,
79 .idleAnimations = N(DefaultAnims),
80 .defenseTable = N(DefenseTable),
81 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
82 .elementImmunityFlags = 0,
83 .projectileTargetOffset = { 0, -9 },
84 },
85};
86
87ActorBlueprint NAMESPACE = {
88 .flags = 0,
91 .maxHP = 4,
92 .partCount = ARRAY_COUNT(N(ActorParts)),
93 .partsData = N(ActorParts),
94 .initScript = &N(EVS_Init),
95 .statusTable = N(StatusTable),
96 .escapeChance = 0,
97 .airLiftChance = 20,
98 .hurricaneChance = 15,
99 .spookChance = 0,
100 .upAndAwayChance = 95,
101 .spinSmashReq = 4,
102 .powerBounceChance = 100,
103 .coinReward = 1,
104 .size = { 55, 32 },
105 .healthBarOffset = { 8, 0 },
106 .statusIconOffset = { -24, 20 },
107 .statusTextOffset = { 5, 25 },
108};
109
110s32 N(DefaultAnims)[] = {
116};
117
118EvtScript N(EVS_Init) = {
119 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
120 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
121 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
123 Return
124 End
125};
126
127EvtScript N(EVS_Idle) = {
128 Return
129 End
130};
131
132EvtScript N(EVS_HandleEvent) = {
139 SetConst(LVar0, PRT_MAIN)
144 SetConst(LVar0, PRT_MAIN)
146 SetConst(LVar2, -1)
149 SetConst(LVar0, PRT_MAIN)
151 SetConst(LVar2, -1)
153 SetConst(LVar0, PRT_MAIN)
156 Return
160 SetConst(LVar0, PRT_MAIN)
165 SetConst(LVar0, PRT_MAIN)
168 Wait(10)
169 SetConst(LVar0, PRT_MAIN)
172 Return
174 SetConst(LVar0, PRT_MAIN)
178 SetConst(LVar0, PRT_MAIN)
182 SetConst(LVar0, PRT_MAIN)
185 Return
190 Return
191 End
192};
193
194EvtScript N(EVS_TakeTurn) = {
199 CaseEq(0)
201 CaseEq(1)
206 Return
207 End
208};
209
210API_CALLABLE(N(SetBulletInitVars)) {
211 N(BulletFormation)[0].var0 = TRUE;
212 N(BulletFormation)[0].var1 = script->owner1.actorID;
213
214 return ApiStatus_DONE2;
215}
216
219 Wait(13)
220 Thread
221 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(1.0))
226 Sub(LVar0, 33)
227 Add(LVar1, 19)
228 Add(LVar2, 3)
229 PlayEffect(EFFECT_00, LVar0, LVar1, LVar2, 2, 5, 0, 2, 0)
230 PlayEffect(EFFECT_00, LVar0, LVar1, LVar2, 2, 5, 2, 2, 0)
231 Wait(2)
236 Return
237 End
238};
239
245 EndIf
246 Return
247 End
248};
249
251
254};
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
@ ELEMENT_END
Definition enums.h:2147
@ ELEMENT_NORMAL
Definition enums.h:2148
@ ACTOR_EVENT_FLAGS_NONE
Definition enums.h:3404
@ STATUS_KEY_PARALYZE
Definition enums.h:2806
@ STATUS_TURN_MOD_DEFAULT
Definition enums.h:2832
@ STATUS_TURN_MOD_PARALYZE
Definition enums.h:2839
@ STATUS_KEY_FROZEN
Definition enums.h:2808
@ STATUS_TURN_MOD_SLEEP
Definition enums.h:2833
@ STATUS_TURN_MOD_DIZZY
Definition enums.h:2837
@ STATUS_TURN_MOD_UNUSED
Definition enums.h:2836
@ STATUS_KEY_STATIC
Definition enums.h:2812
@ STATUS_END
Definition enums.h:2801
@ STATUS_TURN_MOD_POISON
Definition enums.h:2838
@ STATUS_TURN_MOD_STOP
Definition enums.h:2842
@ STATUS_KEY_SLEEP
Definition enums.h:2807
@ STATUS_KEY_UNUSED
Definition enums.h:2804
@ STATUS_KEY_STONE
Definition enums.h:2813
@ STATUS_KEY_STOP
Definition enums.h:2809
@ STATUS_TURN_MOD_FROZEN
Definition enums.h:2835
@ STATUS_KEY_SHRINK
Definition enums.h:2811
@ STATUS_KEY_DIZZY
Definition enums.h:2805
@ STATUS_KEY_POISON
Definition enums.h:2810
@ STATUS_TURN_MOD_STATIC
Definition enums.h:2834
@ STATUS_KEY_NORMAL
Definition enums.h:2802
@ STATUS_TURN_MOD_SHRINK
Definition enums.h:2840
@ STATUS_KEY_DEFAULT
Definition enums.h:2803
@ IDLE_SCRIPT_ENABLE
Definition enums.h:5999
@ IDLE_SCRIPT_DISABLE
Definition enums.h:5998
@ SOUND_BULLET_BILL_FIRE
Definition enums.h:1037
@ BTL_RUMBLE_PLAYER_HEAVY
Definition enums.h:3860
@ ACTOR_SELF
Definition enums.h:2117
@ EVENT_HIT
Definition enums.h:2165
@ EVENT_BURN_HIT
Definition enums.h:2169
@ EVENT_IMMUNE
Definition enums.h:2179
@ EVENT_BURN_DEATH
Definition enums.h:2190
@ EVENT_ZERO_DAMAGE
Definition enums.h:2177
@ EVENT_HIT_COMBO
Definition enums.h:2164
@ EVENT_AIR_LIFT_FAILED
Definition enums.h:2185
@ EVENT_BEGIN_AIR_LIFT
Definition enums.h:2208
@ EVENT_DEATH
Definition enums.h:2186
@ EVENT_RECOVER_STATUS
Definition enums.h:2200
@ EVENT_BLOW_AWAY
Definition enums.h:2176
@ ACTOR_PART_FLAG_PRIMARY_TARGET
Definition enums.h:3396
@ ACTOR_PART_FLAG_SKIP_MOVEMENT_ALLOC
Definition enums.h:3400
@ ACTOR_PART_FLAG_NO_TARGET
Cannot be targeted.
Definition enums.h:3394
@ ACTOR_PART_FLAG_INVISIBLE
Definition enums.h:3384
@ CAM_BATTLE
Definition enums.h:1827
#define ApiStatus_DONE2
Definition evt.h:119
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_AirLift
EvtScript EVS_Enemy_BlowAway
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:312
#define Ref(sym)
Address/pointer constant.
Definition macros.h:61
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:320
#define Sub(VAR, INT_VALUE)
Definition macros.h:378
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:214
#define Add(VAR, INT_VALUE)
Definition macros.h:377
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:353
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define Float(DOUBLE)
Definition macros.h:52
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:342
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:299
#define CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
Definition macros.h:338
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:476
#define Thread
Marks the start of a thread block.
Definition macros.h:545
#define EndThread
Marks the end of a thread block.
Definition macros.h:548
#define LVar2
Definition macros.h:151
#define LVar1
Definition macros.h:150
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:255
#define NPC_DISPOSE_LOCATION
Definition macros.h:170
#define A(sym)
Definition macros.h:36
#define PlayEffect(args...)
Definition macros.h:811
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:363
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:270
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:577
#define LVar0
Definition macros.h:149
#define SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
Definition macros.h:371
#define Return
Kills the current EVT thread.
Definition macros.h:218
#define ACTOR_BY_POS(_name, _pos, _priority, args...)
Definition battle.h:230
FormationRow Formation[]
Definition battle.h:167