Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
gulpit.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "effects.h"
4#include "sprite/npc/Gulpit.h"
5
6#define NAMESPACE A(gulpit)
7
8extern EvtScript N(EVS_Init);
9extern EvtScript N(EVS_TakeTurn);
10extern EvtScript N(EVS_Idle);
12
13enum N(ActorPartIDs) {
14 PRT_MAIN = 1,
15 PRT_BIG_ROCK = 2,
17};
18
19enum N(ActorVars) {
20 AVAR_Rock_Type = 0, // from gulpit rock
21};
22
23enum N(ActorParams) {
24 DMG_LICK = 2,
26 DMG_BIG_ROCK = 7,
27};
28
29s32 N(DefaultAnims)[] = {
40};
41
42s32 N(BigRockAnims)[] = {
45};
46
47s32 N(SmallRockAnims)[] = {
50};
51
52s32 N(DefenseTable)[] = {
55};
56
57s32 N(StatusTable)[] = {
80};
81
83 {
85 .index = PRT_MAIN,
86 .posOffset = { 0, 0, 0 },
87 .targetOffset = { -7, 48 },
88 .opacity = 255,
89 .idleAnimations = N(DefaultAnims),
90 .defenseTable = N(DefenseTable),
91 .eventFlags = 0,
92 .elementImmunityFlags = 0,
93 .projectileTargetOffset = { -3, -23 },
94 },
95 {
97 .index = PRT_BIG_ROCK,
98 .posOffset = { 0, 0, 0 },
99 .targetOffset = { 0, 0 },
100 .opacity = 255,
101 .idleAnimations = N(BigRockAnims),
102 .defenseTable = N(DefenseTable),
103 .eventFlags = 0,
104 .elementImmunityFlags = 0,
105 .projectileTargetOffset = { 0, 0 },
106 },
107 {
109 .index = PRT_SMALL_ROCK,
110 .posOffset = { 0, 0, 0 },
111 .targetOffset = { 0, 0 },
112 .opacity = 255,
113 .idleAnimations = N(SmallRockAnims),
114 .defenseTable = N(DefenseTable),
115 .eventFlags = 0,
116 .elementImmunityFlags = 0,
117 .projectileTargetOffset = { 0, 0 },
118 },
119};
120
121ActorBlueprint NAMESPACE = {
122 .flags = 0,
123 .type = ACTOR_TYPE_GULPIT,
124 .level = ACTOR_LEVEL_GULPIT,
125 .maxHP = 12,
126 .partCount = ARRAY_COUNT(N(ActorParts)),
127 .partsData = N(ActorParts),
128 .initScript = &N(EVS_Init),
129 .statusTable = N(StatusTable),
130 .escapeChance = 60,
131 .airLiftChance = 50,
132 .hurricaneChance = 50,
133 .spookChance = 70,
134 .upAndAwayChance = 95,
135 .spinSmashReq = 0,
136 .powerBounceChance = 100,
137 .coinReward = 1,
138 .size = { 53, 50 },
139 .healthBarOffset = { 0, 0 },
140 .statusIconOffset = { -3, 37 },
141 .statusTextOffset = { 10, 45 },
142};
143
144EvtScript N(EVS_Init) = {
148 Return
149 End
150};
151
152EvtScript N(EVS_Idle) = {
153 Return
154 End
155};
156
162 Return
163 End
164};
165
190 Return
202 Return
218 Return
230 Wait(10)
234 Return
244 Return
257 Return
258 End
259};
260
272 Add(LVar0, 80)
273 Set(LVar1, 0)
275 EndIf
280 Call(AddGoalPos, ACTOR_SELF, 10, 0, 0)
281 Else
282 Call(AddGoalPos, ACTOR_SELF, 20, 0, 0)
283 EndIf
287 Wait(10)
288 Thread
289 Wait(3)
293 Wait(9)
298 Set(LVarA, LVar0)
301 EndIf
302 Wait(15)
312 Return
315 Wait(2)
321 Wait(10)
328 Return
329 End
330};
331
333 Set(LVarA, LVar0)
341 Add(LVar0, 20)
342 Sub(LVar2, 1)
348 Wait(10)
351 Set(LVarB, LVar0)
353 CaseEq(0)
355 Wait(3)
357 Wait(20)
359 Wait(15)
361 Set(LVarA, 2)
362 CaseEq(1)
364 Wait(3)
366 Wait(20)
368 Wait(15)
370 Set(LVarA, 3)
377 Set(LVar9, LVar0)
381 Add(LVar1, 20)
382 Add(LVar2, 2)
385 Call(AddGoalPos, ACTOR_SELF, -100, 0, 5)
393 EndIf
394 Wait(15)
401 Return
406 Add(LVar1, 20)
407 Add(LVar2, 2)
416 Wait(2)
419 Wait(2)
428 Add(LVar0, -100)
432 Wait(10)
439 Return
440 End
441};
442
447 Return
448 EndIf
452 Return
453 EndIf
454 Set(LVarA, 0)
455 // search for rock actors to pick up
458 Label(0)
462 Add(LVarA, 1)
464 CaseEq(1)
465 Set(LVarB, LVar0)
466 CaseEq(2)
467 Set(LVarC, LVar0)
468 CaseEq(3)
469 Set(LVarD, LVar0)
471 EndIf
474 Goto(0)
475 EndIf
477 CaseEq(0)
479 CaseEq(1)
480 Set(LVar0, LVarB)
482 CaseEq(2)
483 Call(RandInt, 1, LVar0)
485 CaseEq(0)
486 Set(LVar0, LVarB)
487 CaseEq(1)
488 Set(LVar0, LVarC)
491 CaseGe(3)
492 Call(RandInt, 2, LVar0)
494 CaseEq(0)
495 Set(LVar0, LVarB)
496 CaseEq(1)
497 Set(LVar0, LVarC)
498 CaseEq(2)
499 Set(LVar0, LVarD)
503 Return
504 End
505};
506
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
@ BTL_CAM_XADJ_AVG
Definition enums.h:4899
@ ACTOR_SOUND_JUMP
Definition enums.h:2036
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3574
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3570
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ITER_NO_MORE
Definition enums.h:2030
@ ITER_NEXT
Definition enums.h:2025
@ ACTOR_DECORATION_SWEAT
Definition enums.h:2045
@ PHASE_FIRST_STRIKE
Definition enums.h:2059
@ STATUS_KEY_PARALYZE
Definition enums.h:2201
@ STATUS_TURN_MOD_DEFAULT
Definition enums.h:2227
@ STATUS_TURN_MOD_PARALYZE
Definition enums.h:2234
@ STATUS_KEY_FROZEN
Definition enums.h:2203
@ STATUS_TURN_MOD_SLEEP
Definition enums.h:2228
@ STATUS_TURN_MOD_DIZZY
Definition enums.h:2232
@ STATUS_KEY_STATIC
Definition enums.h:2207
@ STATUS_END
Definition enums.h:2196
@ STATUS_TURN_MOD_POISON
Definition enums.h:2233
@ STATUS_KEY_FEAR
Definition enums.h:2199
@ STATUS_TURN_MOD_STOP
Definition enums.h:2237
@ STATUS_KEY_SLEEP
Definition enums.h:2202
@ STATUS_KEY_STONE
Definition enums.h:2208
@ STATUS_KEY_STOP
Definition enums.h:2204
@ STATUS_TURN_MOD_FROZEN
Definition enums.h:2230
@ STATUS_KEY_SHRINK
Definition enums.h:2206
@ STATUS_KEY_DIZZY
Definition enums.h:2200
@ STATUS_KEY_POISON
Definition enums.h:2205
@ STATUS_TURN_MOD_STATIC
Definition enums.h:2229
@ STATUS_TURN_MOD_FEAR
Definition enums.h:2231
@ STATUS_KEY_NORMAL
Definition enums.h:2197
@ STATUS_TURN_MOD_SHRINK
Definition enums.h:2235
@ STATUS_KEY_DEFAULT
Definition enums.h:2198
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1952
@ HIT_RESULT_HIT
Definition enums.h:1950
@ HIT_RESULT_LUCKY
Definition enums.h:1955
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_DEFAULT
Definition enums.h:4823
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4884
@ TARGET_FLAG_ALLOW_TARGET_ONLY
Definition enums.h:1864
@ TARGET_FLAG_2
Definition enums.h:1850
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6407
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6406
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ SOUND_GULPIT_LICK
Definition enums.h:1524
@ SOUND_NONE
Definition enums.h:547
@ SOUND_LIGHT_THROW
Definition enums.h:1283
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ BTL_CAM_YADJ_TARGET
Definition enums.h:4904
@ EVENT_HIT
Definition enums.h:2132
@ EVENT_SCARE_AWAY
Definition enums.h:2174
@ EVENT_BURN_HIT
Definition enums.h:2136
@ EVENT_IMMUNE
Definition enums.h:2146
@ EVENT_BURN_DEATH
Definition enums.h:2157
@ EVENT_ZERO_DAMAGE
Definition enums.h:2144
@ EVENT_SHOCK_DEATH
Definition enums.h:2159
@ EVENT_SPIN_SMASH_HIT
Definition enums.h:2133
@ EVENT_SPIN_SMASH_DEATH
Definition enums.h:2154
@ EVENT_HIT_COMBO
Definition enums.h:2131
@ EVENT_AIR_LIFT_FAILED
Definition enums.h:2152
@ EVENT_BEGIN_AIR_LIFT
Definition enums.h:2175
@ EVENT_DEATH
Definition enums.h:2153
@ EVENT_SHOCK_HIT
Definition enums.h:2165
@ EVENT_RECOVER_STATUS
Definition enums.h:2167
@ EVENT_BLOW_AWAY
Definition enums.h:2143
@ ACTOR_PART_FLAG_PRIMARY_TARGET
Definition enums.h:3362
@ ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION
Definition enums.h:3361
@ ACTOR_PART_FLAG_NO_TARGET
Cannot be targeted.
Definition enums.h:3360
@ ACTOR_PART_FLAG_INVISIBLE
Definition enums.h:3350
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
EvtScript EVS_Enemy_ReturnHome
EvtScript EVS_Enemy_Knockback
EvtScript EVS_Enemy_ScareAway
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_ShockHit
EvtScript EVS_Enemy_AirLift
EvtScript EVS_Enemy_BlowAway
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
ApiStatus RandInt(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 Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#define Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#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:319
#define Sub(VAR, INT_VALUE)
Definition macros.h:377
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#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 EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define CaseGe(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:334
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define LVarC
Definition macros.h:160
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define Float(DOUBLE)
Definition macros.h:51
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:341
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
Definition macros.h:337
#define LVarB
Definition macros.h:159
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#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 IfFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is set on LVAR,...
Definition macros.h:288
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define LVarD
Definition macros.h:161
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LVar9
Definition macros.h:157
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#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 LVar0
Definition macros.h:148
#define SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
Definition macros.h:370
#define Return
Kills the current EVT thread.
Definition macros.h:217