Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
monty_mole.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/MontyMole.h"
4
5#define NAMESPACE A(monty_mole)
6
7extern s32 N(DefaultAnims)[];
8extern s32 N(RockAnims)[];
9extern EvtScript N(EVS_Init);
10extern EvtScript N(EVS_Idle);
11extern EvtScript N(EVS_TakeTurn);
13
14enum N(ActorPartIDs) {
15 PRT_MAIN = 1,
16 PRT_TARGET = 2,
17 PRT_ROCK = 3,
18};
19
20enum N(ActorVars) {
22};
23
24enum N(ActorParams) {
25 DMG_TOSS = 2,
26};
27
28s32 N(DefenseTable)[] = {
31};
32
33s32 N(StatusTable)[] = {
44 STATUS_KEY_STOP, 100,
56};
57
59 {
61 .index = PRT_MAIN,
62 .posOffset = { 0, 0, 0 },
63 .targetOffset = { -2, 16 },
64 .opacity = 255,
65 .idleAnimations = N(DefaultAnims),
66 .defenseTable = N(DefenseTable),
67 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
68 .elementImmunityFlags = 0,
69 .projectileTargetOffset = { 0, -7 },
70 },
71 {
73 .index = PRT_TARGET,
74 .posOffset = { 0, 0, -15 },
75 .targetOffset = { -2, 12 },
76 .opacity = 255,
77 .idleAnimations = N(DefaultAnims),
78 .defenseTable = N(DefenseTable),
79 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
80 .elementImmunityFlags = 0,
81 .projectileTargetOffset = { 0, -7 },
82 },
83 {
85 .index = PRT_ROCK,
86 .posOffset = { 0, 0, 0 },
87 .targetOffset = { 0, 0 },
88 .opacity = 255,
89 .idleAnimations = N(RockAnims),
90 .defenseTable = N(DefenseTable),
91 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
92 .elementImmunityFlags = 0,
93 .projectileTargetOffset = { 0, 0 },
94 },
95};
96
97ActorBlueprint NAMESPACE = {
98 .flags = 0,
100 .level = ACTOR_LEVEL_MONTY_MOLE,
101 .maxHP = 3,
102 .partCount = ARRAY_COUNT(N(ActorParts)),
103 .partsData = N(ActorParts),
104 .initScript = &N(EVS_Init),
105 .statusTable = N(StatusTable),
106 .escapeChance = 80,
107 .airLiftChance = 70,
108 .hurricaneChance = 50,
109 .spookChance = 85,
110 .upAndAwayChance = 95,
111 .spinSmashReq = 4,
112 .powerBounceChance = 100,
113 .coinReward = 1,
114 .size = { 34, 18 },
115 .healthBarOffset = { 0, 0 },
116 .statusIconOffset = { -10, 20 },
117 .statusTextOffset = { 10, 20 },
118};
119
120s32 N(DefaultAnims)[] = {
131};
132
133s32 N(RockAnims)[] = {
136};
137
138s32 N(EmptyHoleAnims)[] = {
141};
142
143// unused
144s32 N(LeapAnims)[] = {
147};
148
150 {
152 .index = PRT_MAIN,
153 .posOffset = { 0, 0, 0 },
154 .targetOffset = { 0, 0 },
155 .opacity = 255,
156 .idleAnimations = N(EmptyHoleAnims),
157 .defenseTable = NULL,
158 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
159 .elementImmunityFlags = 0,
160 .projectileTargetOffset = { 0, 0 },
161 },
162};
163
166 IfEq(LVar0, TRUE)
168 EndIf
169 Return
170 End
171};
172
173ActorBlueprint N(hole) = {
175 .type = ACTOR_TYPE_MONTY_HOLE,
176 .level = ACTOR_LEVEL_MONTY_HOLE,
177 .maxHP = 5,
178 .partCount = ARRAY_COUNT(N(HoleParts)),
179 .partsData = N(HoleParts),
180 .initScript = &N(EVS_Hole_Init),
181 .statusTable = NULL,
182 .escapeChance = 80,
183 .airLiftChance = 0,
184 .hurricaneChance = 80,
185 .spookChance = 80,
186 .upAndAwayChance = 90,
187 .spinSmashReq = 4,
188 .powerBounceChance = 90,
189 .coinReward = 2,
190 .size = { 32, 18 },
191 .healthBarOffset = { 0, 0 },
192 .statusIconOffset = { -10, 20 },
193 .statusTextOffset = { 10, 20 },
194};
195
197
199 ACTOR_BY_POS(N(hole), N(SummonPos), 0, FALSE),
200};
201
203 ACTOR_BY_POS(N(hole), N(SummonPos), 0, TRUE),
204};
205
210 Else
212 EndIf
214 Sub(LVar3, 1)
216 Return
217 End
218};
219
220EvtScript N(EVS_Init) = {
225 Return
226 End
227};
228
229EvtScript N(EVS_Idle) = {
230 Return
231 End
232};
233
244 Wait(8)
251 Wait(10)
252 Else
256 EndIf
272 Return
280 Wait(80)
284 Wait(20)
286 Wait(20)
287 Else
291 EndIf
298 Wait(10)
303 Return
306 Wait(8)
308 Wait(5)
310 Wait(8)
313 Wait(15)
315 Wait(15)
317 Wait(15)
320 Return
331 Else
334 Else
336 EndIf
338 EndIf
339 Wait(1000)
340 Return
345 Wait(40)
349 Wait(20)
351 Wait(20)
358 Return
359 End
360};
361
371 EndIf
374 Wait(20)
378 Wait(37)
380 Add(LVar1, 20)
382 Wait(1)
387 Else
389 EndIf
396 Set(LVarA, LVar0)
400 Sub(LVar0, 100)
401 Set(LVar1, -5)
409 EndIf
413 Return
423 Wait(2)
429 Sub(LVar0, 55)
430 Set(LVar1, 0)
435 Sub(LVar0, 20)
442 Return
443 End
444};
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ ACTOR_SOUND_FLY
Definition enums.h:2035
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3574
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ACTOR_EVENT_FLAGS_NONE
Definition enums.h:3370
@ 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
@ EASING_LINEAR
Definition enums.h:510
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6407
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6406
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ SOUND_BURROW_SURFACE
Definition enums.h:1117
@ SOUND_NONE
Definition enums.h:547
@ SOUND_BURROW_DIG
Definition enums.h:1118
@ SOUND_MOLE_THROW
Definition enums.h:1296
@ ACTOR_PLAYER
Definition enums.h:2085
@ 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_DMG_APPLY
Damage is not applied to actor HP.
Definition enums.h:3340
@ ACTOR_FLAG_NO_ATTACK
Skip attack turn.
Definition enums.h:3339
@ EVENT_HIT
Definition enums.h:2132
@ EVENT_UP_AND_AWAY
Definition enums.h:2176
@ 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_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_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_SKIP_MOVEMENT_ALLOC
Definition enums.h:3366
@ 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_DAMAGE_IMMUNE
electrified Plays extra hurt SFX?
Definition enums.h:3358
@ ACTOR_PART_FLAG_INVISIBLE
Definition enums.h:3350
@ DAMAGE_TYPE_SMASH
Definition enums.h:2857
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_AirLift
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
#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 EndChildThread
Marks the end of a child thread block.
Definition macros.h:563
#define Sub(VAR, INT_VALUE)
Definition macros.h:377
#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 ARRAY_COUNT(arr)
Definition macros.h:40
#define Float(DOUBLE)
Definition macros.h:51
#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 ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#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 Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define NPC_DISPOSE_LOCATION
Definition macros.h:162
#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 ChildThread
Marks the start of a child thread block.
Definition macros.h:560
#define LVar3
Definition macros.h:151
#define LVarE
Definition macros.h:162
#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
#define ACTOR_BY_POS(_name, _pos, _priority, args...)
Definition battle.h:230
FormationRow Formation[]
Definition battle.h:167