Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
gulpit_rocks.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_rocks)
7
8extern EvtScript N(EVS_Init);
9extern EvtScript N(EVS_Idle);
10extern EvtScript N(EVS_TakeTurn);
11extern EvtScript N(EVS_HandleEvent);
12
13enum N(ActorPartIDs) {
14 PRT_MAIN = 1,
15};
16
17enum N(ActorVars) {
18 AVAR_RockType = 0,
19};
20
21s32 N(BigRockAnims)[] = {
22 STATUS_KEY_NORMAL, ANIM_Gulpit_Anim10,
24};
25
26s32 N(SmallRockAnims)[] = {
27 STATUS_KEY_NORMAL, ANIM_Gulpit_Anim12,
29};
30
31s32 N(DefenseTable)[] = {
34};
35
36s32 N(StatusTable)[] = {
59};
60
61ActorPartBlueprint N(ActorParts)[] = {
62 {
64 .index = PRT_MAIN,
65 .posOffset = { 0, 0, 0 },
66 .targetOffset = { 0, 14 },
67 .opacity = 255,
68 .idleAnimations = N(BigRockAnims),
69 .defenseTable = N(DefenseTable),
70 .eventFlags = 0,
71 .elementImmunityFlags = 0,
72 .projectileTargetOffset = { 0, -6 },
73 },
74};
75
76ActorBlueprint NAMESPACE = {
78 .type = ACTOR_TYPE_GULPIT_ROCKS,
79 .level = ACTOR_LEVEL_GULPIT_ROCKS,
80 .maxHP = 1,
81 .partCount = ARRAY_COUNT(N(ActorParts)),
82 .partsData = N(ActorParts),
83 .initScript = &N(EVS_Init),
84 .statusTable = N(StatusTable),
85 .escapeChance = 0,
86 .airLiftChance = 100,
87 .hurricaneChance = 0,
88 .spookChance = 0,
89 .upAndAwayChance = 95,
90 .spinSmashReq = 0,
91 .powerBounceChance = 100,
92 .coinReward = 0,
93 .size = { 32, 18 },
94 .healthBarOffset = { 0, 0 },
95 .statusIconOffset = { -10, 20 },
96 .statusTextOffset = { 10, 20 },
97};
98
99EvtScript N(EVS_Init) = {
100 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
101 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
102 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
103 Call(GetActorVar, ACTOR_SELF, AVAR_RockType, LVar0)
105 CaseEq(0)
106 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(BigRockAnims)))
107 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim10)
108 Call(GetActorVar, ACTOR_SELF, AVAR_RockType, 0)
109 Call(SetActorSize, ACTOR_SELF, 24, 15)
110 CaseEq(1)
111 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(SmallRockAnims)))
112 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim12)
113 Call(GetActorVar, ACTOR_SELF, AVAR_RockType, 1)
114 Call(SetActorSize, ACTOR_SELF, 10, 8)
116 Return
117 End
118};
119
120EvtScript N(EVS_Idle) = {
121 Return
122 End
123};
124
125EvtScript N(EVS_SelectRockAnim) = {
126 Call(GetActorVar, ACTOR_SELF, AVAR_RockType, LVarA)
128 CaseEq(0)
129 CaseEq(1)
132 Return
133 End
134};
135
136EvtScript N(EVS_HandleEvent) = {
137 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
138 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
139 Call(GetLastEvent, ACTOR_SELF, LVar0)
144 SetConst(LVar0, PRT_MAIN)
145 SetConst(LVar1, ANIM_Gulpit_Anim10)
146 SetConst(LVar2, ANIM_Gulpit_Anim12)
147 ExecWait(N(EVS_SelectRockAnim))
154 SetConst(LVar0, PRT_MAIN)
155 SetConst(LVar1, ANIM_Gulpit_Anim10)
156 SetConst(LVar2, ANIM_Gulpit_Anim12)
157 ExecWait(N(EVS_SelectRockAnim))
162 SetConst(LVar0, PRT_MAIN)
163 SetConst(LVar1, ANIM_Gulpit_Anim10)
164 SetConst(LVar2, ANIM_Gulpit_Anim12)
165 ExecWait(N(EVS_SelectRockAnim))
167 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_NO_SHADOW, TRUE)
168 Call(GetActorVar, ACTOR_SELF, AVAR_RockType, LVar0)
170 CaseEq(0)
171 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim11)
172 CaseEq(1)
173 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Gulpit_Anim13)
175 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
176 PlayEffect(EFFECT_LANDING_DUST, 1, LVar0, LVar1, LVar2, 0, 0)
177 Wait(30)
178 Call(RemoveActor, ACTOR_SELF)
179 Return
183 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
184 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
185 Return
186 End
187};
188
189EvtScript N(EVS_TakeTurn) = {
190 Return
191 End
192};
193
Bytecode EvtScript[]
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_NORMAL
Definition enums.h:2115
@ 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_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
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_NO_SHADOW
Hide shadow.
Definition enums.h:3325
@ ACTOR_FLAG_TARGET_ONLY
Battle ends even if undefeated. No turn.
Definition enums.h:3334
@ ACTOR_FLAG_NO_HEALTH_BAR
Definition enums.h:3337
@ ACTOR_FLAG_NO_ATTACK
Skip attack turn.
Definition enums.h:3339
@ EVENT_HIT
Definition enums.h:2132
@ 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_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
@ ACTOR_PART_FLAG_PRIMARY_TARGET
Definition enums.h:3362
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_NoDamageHit
#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 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 End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:341
#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 ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define PlayEffect(args...)
Definition macros.h:807
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#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