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);
10extern EvtScript N(EVS_HandleEvent);
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) {
26 DMG_HAMMER_THROW = 5,
27 DMG_HAMMER_SURGE = 2,
28};
29
30s32 N(DefaultAnims)[] = {
31 STATUS_KEY_NORMAL, ANIM_HammerBros_Anim02,
32 STATUS_KEY_STONE, ANIM_HammerBros_Anim00,
33 STATUS_KEY_SLEEP, ANIM_HammerBros_Anim11,
34 STATUS_KEY_POISON, ANIM_HammerBros_Anim02,
35 STATUS_KEY_STOP, ANIM_HammerBros_Anim00,
36 STATUS_KEY_STATIC, ANIM_HammerBros_Anim02,
37 STATUS_KEY_PARALYZE, ANIM_HammerBros_Anim00,
38 STATUS_KEY_DIZZY, ANIM_HammerBros_Anim12,
39 STATUS_KEY_FEAR, ANIM_HammerBros_Anim12,
41};
42
43s32 N(HammerAnims)[] = {
44 STATUS_KEY_NORMAL, ANIM_HammerBros_Anim0D,
46};
47
48s32 N(DefenseTable)[] = {
51};
52
53s32 N(StatusTable)[] = {
76};
77
78ActorPartBlueprint N(ActorParts)[] = {
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,
155 .type = ACTOR_TYPE_HAMMER_BROS,
156 .level = ACTOR_LEVEL_HAMMER_BROS,
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) = {
177 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
178 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
179 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
180 Call(SetActorVar, ACTOR_SELF, AVAR_Unused, 0)
181 Return
182 End
183};
184
185EvtScript N(EVS_Idle) = {
186 Label(0)
187 Call(GetStatusFlags, ACTOR_SELF, LVar0)
190 Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15)
191 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0)
193 Call(GetActorVar, ACTOR_SELF, AVAR_Unused, LVar0)
195 CaseEq(0)
196 Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -3, 35)
197 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -3, -10)
198 CaseEq(1)
199 Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15)
200 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0)
203 Wait(1)
204 Goto(0)
205 Return
206 End
207};
208
209EvtScript N(EVS_HandleEvent) = {
210 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
211 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
212 Call(GetLastEvent, ACTOR_SELF, LVar0)
216 SetConst(LVar0, PRT_MAIN)
217 SetConst(LVar1, ANIM_HammerBros_Anim0E)
221 SetConst(LVar0, PRT_MAIN)
222 SetConst(LVar1, ANIM_HammerBros_Anim0F)
223 SetConst(LVar2, ANIM_HammerBros_Anim10)
226 SetConst(LVar0, PRT_MAIN)
227 SetConst(LVar1, ANIM_HammerBros_Anim0F)
228 SetConst(LVar2, ANIM_HammerBros_Anim10)
230 SetConst(LVar0, PRT_MAIN)
231 SetConst(LVar1, ANIM_HammerBros_Anim10)
233 Return
235 SetConst(LVar0, PRT_MAIN)
236 SetConst(LVar1, ANIM_HammerBros_Anim0E)
239 SetConst(LVar0, PRT_MAIN)
240 SetConst(LVar1, ANIM_HammerBros_Anim0E)
242 SetConst(LVar0, PRT_MAIN)
243 SetConst(LVar1, ANIM_HammerBros_Anim0E)
245 Return
248 SetConst(LVar0, PRT_MAIN)
249 SetConst(LVar1, ANIM_HammerBros_Anim15)
251 Call(GetStatusFlags, ACTOR_SELF, LVar0)
253 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HammerBros_Anim17)
254 Wait(10)
255 EndIf
258 SetConst(LVar0, PRT_MAIN)
259 SetConst(LVar1, ANIM_HammerBros_Anim0E)
261 Wait(10)
262 SetConst(LVar0, PRT_MAIN)
263 SetConst(LVar1, ANIM_HammerBros_Anim0E)
265 Return
267 SetConst(LVar0, PRT_MAIN)
268 SetConst(LVar1, ANIM_HammerBros_Anim02)
271 SetConst(LVar0, PRT_MAIN)
272 SetConst(LVar1, ANIM_HammerBros_Anim07)
273 SetConst(LVar2, ANIM_HammerBros_Anim0E)
275 Return
277 SetConst(LVar0, PRT_MAIN)
278 SetConst(LVar1, ANIM_HammerBros_Anim07)
281 Call(GetStatusFlags, ACTOR_SELF, LVar0)
284 Call(SetActorDispOffset, ACTOR_SELF, -2, 1, 0)
285 Else
286 Call(SetActorDispOffset, ACTOR_SELF, -5, 3, 0)
287 EndIf
288 EndIf
289 SetConst(LVar0, PRT_MAIN)
290 SetConst(LVar1, ANIM_HammerBros_Anim0E)
292 Return
294 SetConst(LVar0, PRT_MAIN)
295 SetConst(LVar1, ANIM_HammerBros_Anim02)
299 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
300 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
301 Return
302 End
303};
304
305EvtScript N(EVS_Attack_HammerThrow) = {
306 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
307 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
308 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
309 Call(GetBattlePhase, LVar0)
311 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
312 Call(MoveBattleCamOver, 1)
313 EndIf
314 Call(GetBattlePhase, LVar0)
317 Set(LVar0, 0)
318 Label(0)
319 Add(LVar0, 20)
320 Mod(LVar0, 360)
321 Call(SetPartRotation, ACTOR_SELF, PRT_HAMMER_1, 0, 0, LVar0)
322 Wait(1)
323 Goto(0)
325 Call(SetPartPos, ACTOR_SELF, PRT_HAMMER_1, 0, 50, 0)
326 Call(SetPartFlagBits, ACTOR_SELF, PRT_HAMMER_1, ACTOR_PART_FLAG_INVISIBLE, FALSE)
327 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HammerBros_Anim0C)
328 Goto(100)
329 EndIf
331 Set(LVar0, 0)
332 Label(0)
333 Add(LVar0, 20)
334 Mod(LVar0, 360)
335 Call(SetPartRotation, ACTOR_SELF, PRT_HAMMER_1, 0, 0, LVar0)
336 Wait(1)
337 Goto(0)
339 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
340 Sub(LVar0, 23)
341 Add(LVar1, 23)
342 Sub(LVar2, 2)
343 Call(SetPartPos, ACTOR_SELF, PRT_HAMMER_1, LVar0, LVar1, LVar2)
344 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HammerBros_Anim0C)
345 Wait(8)
346 Call(SetPartFlagBits, ACTOR_SELF, PRT_HAMMER_1, ACTOR_PART_FLAG_INVISIBLE, FALSE)
347 Label(100)
348 Thread
349 Wait(15)
350 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HammerBros_Anim02)
352 Call(GetStatusFlags, ACTOR_SELF, LVar0)
354 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_1, Float(0.4), Float(0.4), Float(0.4))
355 Else
356 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_1, Float(1.0), Float(1.0), Float(1.0))
357 EndIf
358 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
362 Set(LVarA, LVar0)
363 Call(SetPartSounds, ACTOR_SELF, PRT_HAMMER_1, ACTOR_SOUND_JUMP, SOUND_NONE, SOUND_NONE)
364 Call(PlaySoundAtPart, ACTOR_SELF, PRT_HAMMER_1, SOUND_HAMMER_BROS_THROW)
365 Call(SetGoalToTarget, ACTOR_SELF)
366 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
367 Sub(LVar0, 20)
368 Set(LVar1, 10)
369 Call(SetPartJumpGravity, ACTOR_SELF, PRT_HAMMER_1, Float(1.3))
370 Call(JumpPartTo, ACTOR_SELF, PRT_HAMMER_1, LVar0, LVar1, LVar2, 15, TRUE)
372 Call(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
373 EndIf
374 Sub(LVar0, 40)
375 Call(JumpPartTo, ACTOR_SELF, PRT_HAMMER_1, LVar0, LVar1, LVar2, 15, TRUE)
376 Sub(LVar0, 30)
377 Call(JumpPartTo, ACTOR_SELF, PRT_HAMMER_1, LVar0, LVar1, LVar2, 10, TRUE)
378 Sub(LVar0, 20)
379 Call(JumpPartTo, ACTOR_SELF, PRT_HAMMER_1, LVar0, LVar1, LVar2, 5, TRUE)
380 Call(SetPartFlagBits, ACTOR_SELF, PRT_HAMMER_1, ACTOR_PART_FLAG_INVISIBLE, TRUE)
381 Wait(15)
382 Call(YieldTurn)
383 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
384 Wait(20)
385 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
386 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
387 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
388 Return
391 Call(SetPartSounds, ACTOR_SELF, PRT_HAMMER_1, ACTOR_SOUND_JUMP, SOUND_NONE, SOUND_NONE)
392 Call(PlaySoundAtPart, ACTOR_SELF, PRT_HAMMER_1, SOUND_HAMMER_BROS_THROW)
393 Call(SetGoalToTarget, ACTOR_SELF)
394 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
395 Call(SetPartJumpGravity, ACTOR_SELF, PRT_HAMMER_1, Float(1.3))
396 Call(JumpPartTo, ACTOR_SELF, PRT_HAMMER_1, LVar0, LVar1, LVar2, 15, TRUE)
397 Wait(2)
402 Call(GetPartOffset, ACTOR_SELF, PRT_HAMMER_1, LVar0, LVar1, LVar2)
403 Sub(LVar0, 50)
404 Set(LVar1, 10)
405 Call(JumpPartTo, ACTOR_SELF, PRT_HAMMER_1, LVar0, LVar1, LVar2, 20, TRUE)
406 Sub(LVar0, 30)
407 Call(JumpPartTo, ACTOR_SELF, PRT_HAMMER_1, LVar0, LVar1, LVar2, 10, TRUE)
408 Sub(LVar0, 20)
409 Call(JumpPartTo, ACTOR_SELF, PRT_HAMMER_1, LVar0, LVar1, LVar2, 5, TRUE)
410 Call(SetPartFlagBits, ACTOR_SELF, PRT_HAMMER_1, ACTOR_PART_FLAG_INVISIBLE, TRUE)
411 Wait(20)
412 Call(YieldTurn)
415 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
416 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
417 Return
418 End
419};
420
421EvtScript N(EVS_HammerSurge_Miss) = {
422 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0))
423 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HammerBros_Anim02)
424 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HammerBros_Anim0C)
425 Wait(4)
426 Call(SetPartFlagBits, ACTOR_SELF, LVar0, ACTOR_PART_FLAG_INVISIBLE, FALSE)
428 Call(PlaySoundAtPart, ACTOR_SELF, LVar0, SOUND_HAMMER_BROS_THROW)
429 Call(SetGoalToTarget, ACTOR_SELF)
430 Call(GetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3)
431 Set(LVar2, 10)
432 Call(RandInt, 60, LVar4)
433 Set(LVar5, 30)
434 Sub(LVar5, LVar4)
435 Add(LVar1, LVar5)
436 Call(SetPartJumpGravity, ACTOR_SELF, LVar0, Float(1.3))
437 Call(JumpPartTo, ACTOR_SELF, LVar0, LVar1, LVar2, LVar3, 15, TRUE)
438 Sub(LVar1, 50)
439 Set(LVar2, 10)
440 Call(JumpPartTo, ACTOR_SELF, LVar0, LVar1, LVar2, LVar3, 20, TRUE)
441 Sub(LVar1, 30)
442 Call(JumpPartTo, ACTOR_SELF, LVar0, LVar1, LVar2, LVar3, 10, TRUE)
443 Sub(LVar1, 20)
444 Call(JumpPartTo, ACTOR_SELF, LVar0, LVar1, LVar2, LVar3, 5, TRUE)
445 Call(SetPartFlagBits, ACTOR_SELF, LVar0, ACTOR_PART_FLAG_INVISIBLE, TRUE)
446 Return
447 End
448};
449
450EvtScript N(EVS_HammerSurge_Hit) = {
451 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0))
452 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HammerBros_Anim02)
453 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HammerBros_Anim0C)
454 Wait(4)
455 Call(SetPartFlagBits, ACTOR_SELF, LVar0, ACTOR_PART_FLAG_INVISIBLE, FALSE)
457 Call(PlaySoundAtPart, ACTOR_SELF, LVar0, SOUND_HAMMER_BROS_THROW)
458 Call(SetGoalToTarget, ACTOR_SELF)
459 Call(GetGoalPos, ACTOR_SELF, LVar1, LVar2, LVar3)
460 Call(SetPartJumpGravity, ACTOR_SELF, LVar0, Float(1.3))
461 Call(JumpPartTo, ACTOR_SELF, LVar0, LVar1, LVar2, LVar3, 15, TRUE)
462 Sub(LVar1, 50)
463 Set(LVar2, 10)
464 Call(JumpPartTo, ACTOR_SELF, LVar0, LVar1, LVar2, LVar3, 20, TRUE)
465 Sub(LVar1, 30)
466 Call(JumpPartTo, ACTOR_SELF, LVar0, LVar1, LVar2, LVar3, 10, TRUE)
467 Sub(LVar1, 20)
468 Call(JumpPartTo, ACTOR_SELF, LVar0, LVar1, LVar2, LVar3, 5, TRUE)
469 Call(SetPartFlagBits, ACTOR_SELF, LVar0, ACTOR_PART_FLAG_INVISIBLE, TRUE)
470 Return
471 End
472};
473
474EvtScript N(EVS_Attack_HammerSurge) = {
475 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
476 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
477 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
478 Thread
479 Set(LVar0, 0)
480 Loop(100)
481 Add(LVar0, 20)
482 Mod(LVar0, 360)
483 Call(SetPartRotation, ACTOR_SELF, PRT_HAMMER_1, 0, 0, LVar0)
484 Call(SetPartRotation, ACTOR_SELF, PRT_HAMMER_2, 0, 0, LVar0)
485 Call(SetPartRotation, ACTOR_SELF, PRT_HAMMER_3, 0, 0, LVar0)
486 Call(SetPartRotation, ACTOR_SELF, PRT_HAMMER_4, 0, 0, LVar0)
487 Call(SetPartRotation, ACTOR_SELF, PRT_HAMMER_5, 0, 0, LVar0)
488 Wait(1)
489 EndLoop
491 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
492 Sub(LVar0, 23)
493 Add(LVar1, 23)
494 Sub(LVar2, 2)
495 Call(SetPartPos, ACTOR_SELF, PRT_HAMMER_1, LVar0, LVar1, LVar2)
496 Call(SetPartPos, ACTOR_SELF, PRT_HAMMER_2, LVar0, LVar1, LVar2)
497 Call(SetPartPos, ACTOR_SELF, PRT_HAMMER_3, LVar0, LVar1, LVar2)
498 Call(SetPartPos, ACTOR_SELF, PRT_HAMMER_4, LVar0, LVar1, LVar2)
499 Call(SetPartPos, ACTOR_SELF, PRT_HAMMER_5, LVar0, LVar1, LVar2)
500 Call(GetStatusFlags, ACTOR_SELF, LVar0)
502 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_1, Float(0.4), Float(0.4), Float(0.4))
503 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_2, Float(0.4), Float(0.4), Float(0.4))
504 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_3, Float(0.4), Float(0.4), Float(0.4))
505 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_4, Float(0.4), Float(0.4), Float(0.4))
506 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_5, Float(0.4), Float(0.4), Float(0.4))
507 Else
508 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_1, Float(1.0), Float(1.0), Float(1.0))
509 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_2, Float(1.0), Float(1.0), Float(1.0))
510 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_3, Float(1.0), Float(1.0), Float(1.0))
511 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_4, Float(1.0), Float(1.0), Float(1.0))
512 Call(SetPartScale, ACTOR_SELF, PRT_HAMMER_5, Float(1.0), Float(1.0), Float(1.0))
513 EndIf
514 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
518 Set(LVarA, LVar0)
519 Set(LVar0, PRT_HAMMER_1)
520 Exec(N(EVS_HammerSurge_Miss))
521 Wait(5)
522 Set(LVar0, PRT_HAMMER_2)
523 Exec(N(EVS_HammerSurge_Miss))
524 Wait(5)
525 Set(LVar0, PRT_HAMMER_3)
526 Exec(N(EVS_HammerSurge_Miss))
527 Wait(5)
528 Set(LVar0, PRT_HAMMER_4)
529 Exec(N(EVS_HammerSurge_Miss))
530 Wait(5)
531 Set(LVar0, PRT_HAMMER_5)
532 Exec(N(EVS_HammerSurge_Miss))
533 Wait(5)
534 Wait(20)
535 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HammerBros_Anim02)
537 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
538 EndIf
539 Wait(15)
540 Call(YieldTurn)
541 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
542 Wait(20)
543 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
544 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
545 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
546 Return
549 Thread
550 Set(LVar0, PRT_HAMMER_1)
551 Exec(N(EVS_HammerSurge_Hit))
552 Wait(5)
553 Set(LVar0, PRT_HAMMER_2)
554 Exec(N(EVS_HammerSurge_Hit))
555 Wait(5)
556 Set(LVar0, PRT_HAMMER_3)
557 Exec(N(EVS_HammerSurge_Hit))
558 Wait(5)
559 Set(LVar0, PRT_HAMMER_4)
560 Exec(N(EVS_HammerSurge_Hit))
561 Wait(5)
562 Set(LVar0, PRT_HAMMER_5)
563 Exec(N(EVS_HammerSurge_Hit))
565 Wait(21)
566 Wait(2)
567 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_HAMMER_SURGE, BS_FLAGS1_INCLUDE_POWER_UPS)
568 Wait(5)
569 Wait(2)
570 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_HAMMER_SURGE, BS_FLAGS1_NICE_HIT)
571 Wait(5)
572 Wait(2)
573 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_HAMMER_SURGE, BS_FLAGS1_NICE_HIT)
574 Wait(5)
575 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_HammerBros_Anim02)
576 Wait(2)
577 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_HAMMER_SURGE, BS_FLAGS1_NICE_HIT)
578 Wait(5)
579 Wait(2)
584 Wait(20)
585 Call(YieldTurn)
588 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
589 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
590 Return
591 End
592};
593
594EvtScript N(EVS_TakeTurn) = {
595 Call(GetActorHP, ACTOR_SELF, LVar0)
596 Call(GetEnemyMaxHP, ACTOR_SELF, LVar1)
597 MulF(LVar0, Float(100.0))
599 IfGt(LVar0, 34)
600 ExecWait(N(EVS_Attack_HammerThrow))
601 Else
602 ExecWait(N(EVS_Attack_HammerSurge))
603 EndIf
604 Return
605 End
606};
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ ACTOR_SOUND_JUMP
Definition enums.h:2036
@ BS_FLAGS1_NICE_HIT
Definition enums.h:3576
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3575
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3571
@ 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:4824
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ 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:224
#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