Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
hammer_bro.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/HammerBros.h"
4
5#define NAMESPACE A(hammer_bro)
6
7extern EvtScript N(EVS_Init);
8extern EvtScript N(EVS_Idle);
9extern EvtScript N(EVS_TakeTurn);
11
12enum N(ActorPartIDs) {
13 PRT_MAIN = 1,
14 PRT_HAMMER_1 = 2,
15 PRT_HAMMER_2 = 3,
16 PRT_HAMMER_3 = 4,
17 PRT_HAMMER_4 = 5,
18 PRT_HAMMER_5 = 6,
19};
20
21enum N(ActorVars) {
22 AVAR_Unused = 8, // possibly a topple state that was never implemented
23};
24
25enum N(ActorParams) {
28};
29
30s32 N(DefaultAnims)[] = {
41};
42
43s32 N(HammerAnims)[] = {
46};
47
48s32 N(DefenseTable)[] = {
51};
52
53s32 N(StatusTable)[] = {
76};
77
79 {
81 .index = PRT_MAIN,
82 .posOffset = { 0, 0, 0 },
83 .targetOffset = { -3, 35 },
84 .opacity = 255,
85 .idleAnimations = N(DefaultAnims),
86 .defenseTable = N(DefenseTable),
87 .eventFlags = 0,
88 .elementImmunityFlags = 0,
89 .projectileTargetOffset = { -3, -10 },
90 },
91 {
93 .index = PRT_HAMMER_1,
94 .posOffset = { 0, 0, 0 },
95 .targetOffset = { 0, 0 },
96 .opacity = 255,
97 .idleAnimations = N(HammerAnims),
98 .defenseTable = N(DefenseTable),
99 .eventFlags = 0,
100 .elementImmunityFlags = 0,
101 .projectileTargetOffset = { 0, 0 },
102 },
103 {
105 .index = PRT_HAMMER_2,
106 .posOffset = { 0, 0, 0 },
107 .targetOffset = { 0, 0 },
108 .opacity = 255,
109 .idleAnimations = N(HammerAnims),
110 .defenseTable = N(DefenseTable),
111 .eventFlags = 0,
112 .elementImmunityFlags = 0,
113 .projectileTargetOffset = { 0, 0 },
114 },
115 {
117 .index = PRT_HAMMER_3,
118 .posOffset = { 0, 0, 0 },
119 .targetOffset = { 0, 0 },
120 .opacity = 255,
121 .idleAnimations = N(HammerAnims),
122 .defenseTable = N(DefenseTable),
123 .eventFlags = 0,
124 .elementImmunityFlags = 0,
125 .projectileTargetOffset = { 0, 0 },
126 },
127 {
129 .index = PRT_HAMMER_4,
130 .posOffset = { 0, 0, 0 },
131 .targetOffset = { 0, 0 },
132 .opacity = 255,
133 .idleAnimations = N(HammerAnims),
134 .defenseTable = N(DefenseTable),
135 .eventFlags = 0,
136 .elementImmunityFlags = 0,
137 .projectileTargetOffset = { 0, 0 },
138 },
139 {
141 .index = PRT_HAMMER_5,
142 .posOffset = { 0, 0, 0 },
143 .targetOffset = { 0, 0 },
144 .opacity = 255,
145 .idleAnimations = N(HammerAnims),
146 .defenseTable = N(DefenseTable),
147 .eventFlags = 0,
148 .elementImmunityFlags = 0,
149 .projectileTargetOffset = { 0, 0 },
150 },
151};
152
153ActorBlueprint NAMESPACE = {
154 .flags = 0,
157 .maxHP = 12,
158 .partCount = ARRAY_COUNT(N(ActorParts)),
159 .partsData = N(ActorParts),
160 .initScript = &N(EVS_Init),
161 .statusTable = N(StatusTable),
162 .escapeChance = 30,
163 .airLiftChance = 75,
164 .hurricaneChance = 60,
165 .spookChance = 40,
166 .upAndAwayChance = 95,
167 .spinSmashReq = 0,
168 .powerBounceChance = 80,
169 .coinReward = 2,
170 .size = { 28, 38 },
171 .healthBarOffset = { 0, 0 },
172 .statusIconOffset = { -10, 20 },
173 .statusTextOffset = { 10, 35 },
174};
175
176EvtScript N(EVS_Init) = {
181 Return
182 End
183};
184
185EvtScript N(EVS_Idle) = {
186 Label(0)
195 CaseEq(0)
198 CaseEq(1)
203 Wait(1)
204 Goto(0)
205 Return
206 End
207};
208
233 Return
245 Return
254 Wait(10)
255 EndIf
261 Wait(10)
265 Return
275 Return
285 Else
287 EndIf
288 EndIf
292 Return
301 Return
302 End
303};
304
313 EndIf
317 Set(LVar0, 0)
318 Label(0)
319 Add(LVar0, 20)
320 Mod(LVar0, 360)
322 Wait(1)
323 Goto(0)
328 Goto(100)
329 EndIf
331 Set(LVar0, 0)
332 Label(0)
333 Add(LVar0, 20)
334 Mod(LVar0, 360)
336 Wait(1)
337 Goto(0)
340 Sub(LVar0, 23)
341 Add(LVar1, 23)
342 Sub(LVar2, 2)
345 Wait(8)
347 Label(100)
348 Thread
349 Wait(15)
355 Else
357 EndIf
362 Set(LVarA, LVar0)
367 Sub(LVar0, 20)
368 Set(LVar1, 10)
373 EndIf
374 Sub(LVar0, 40)
376 Sub(LVar0, 30)
378 Sub(LVar0, 20)
381 Wait(15)
384 Wait(20)
388 Return
397 Wait(2)
403 Sub(LVar0, 50)
404 Set(LVar1, 10)
406 Sub(LVar0, 30)
408 Sub(LVar0, 20)
411 Wait(20)
417 Return
418 End
419};
420
425 Wait(4)
431 Set(LVar2, 10)
432 Call(RandInt, 60, LVar4)
433 Set(LVar5, 30)
434 Sub(LVar5, LVar4)
435 Add(LVar1, LVar5)
438 Sub(LVar1, 50)
439 Set(LVar2, 10)
441 Sub(LVar1, 30)
443 Sub(LVar1, 20)
446 Return
447 End
448};
449
454 Wait(4)
462 Sub(LVar1, 50)
463 Set(LVar2, 10)
465 Sub(LVar1, 30)
467 Sub(LVar1, 20)
470 Return
471 End
472};
473
478 Thread
479 Set(LVar0, 0)
480 Loop(100)
481 Add(LVar0, 20)
482 Mod(LVar0, 360)
488 Wait(1)
489 EndLoop
492 Sub(LVar0, 23)
493 Add(LVar1, 23)
494 Sub(LVar2, 2)
507 Else
513 EndIf
518 Set(LVarA, LVar0)
521 Wait(5)
524 Wait(5)
527 Wait(5)
530 Wait(5)
533 Wait(5)
534 Wait(20)
538 EndIf
539 Wait(15)
542 Wait(20)
546 Return
549 Thread
552 Wait(5)
555 Wait(5)
558 Wait(5)
561 Wait(5)
565 Wait(21)
566 Wait(2)
568 Wait(5)
569 Wait(2)
571 Wait(5)
572 Wait(2)
574 Wait(5)
576 Wait(2)
578 Wait(5)
579 Wait(2)
584 Wait(20)
590 Return
591 End
592};
593
597 MulF(LVar0, Float(100.0))
599 IfGt(LVar0, 34)
601 Else
603 EndIf
604 Return
605 End
606};
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ ACTOR_SOUND_JUMP
Definition enums.h:2036
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3575
@ 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
@ 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
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6407
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6406
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ STATUS_FLAG_SLEEP
Definition enums.h:2812
@ SOUND_HAMMER_BROS_THROW
Definition enums.h:1067
@ SOUND_NONE
Definition enums.h:547
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ 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_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_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_ScareAway
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
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 DivF(VAR, FLOAT_VALUE)
Definition macros.h:386
#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 Mod(VAR, INT_VALUE)
Definition macros.h:380
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
Definition macros.h:278
#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 LVar5
Definition macros.h:153
#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 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 CaseFlag(RVAR)
Marks the start of a switch case that executes only if the RVAR flag is set on LVAR,...
Definition macros.h:349
#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 MulF(VAR, FLOAT_VALUE)
Definition macros.h:385
#define DMG_STATUS_KEY(typeFlag, duration, chance)
Definition macros.h:228
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define IfNotFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is unset on LVAR,...
Definition macros.h:292
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#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 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 SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
Definition macros.h:370
#define Exec(EVT_SOURCE)
Launches a new thread.
Definition macros.h:455
#define Return
Kills the current EVT thread.
Definition macros.h:217