Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
hyper_goomba.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/Goomba.h"
4
5#ifndef NESTED_HYPER_GOOMBA_INCLUDE
6#define NAMESPACE A(hyper_goomba)
7#endif
8
9extern s32 N(DefaultAnims)[];
10extern EvtScript N(EVS_Init);
11extern EvtScript N(EVS_Idle);
12extern EvtScript N(EVS_HandleEvent);
13extern EvtScript N(EVS_TakeTurn);
14extern EvtScript N(EVS_HandlePhase);
15extern EvtScript N(EVS_Attack_Headbonk);
16
17enum N(ActorParams) {
18 DMG_HEADBONK = 1,
19 DMG_CHARGED = 8,
20};
21
22#ifndef NESTED_HYPER_GOOMBA_INCLUDE
23
24enum N(ActorPartIDs) {
25 PRT_MAIN = 1,
26};
27
28enum N(ActorVars) {
29 AVAR_IsCharged = 0,
30 AVAR_NotFirstTurn = 1,
31};
32
33s32 N(DefenseTable)[] = {
36};
37
38s32 N(StatusTable)[] = {
45 STATUS_KEY_FEAR, 100,
61};
62
63ActorPartBlueprint N(ActorParts)[] = {
64 {
66 .index = PRT_MAIN,
67 .posOffset = { 0, 0, 0 },
68 .targetOffset = { 0, 22 },
69 .opacity = 255,
70 .idleAnimations = N(DefaultAnims),
71 .defenseTable = N(DefenseTable),
72 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
73 .elementImmunityFlags = 0,
74 .projectileTargetOffset = { 0, -10 },
75 },
76};
77
78ActorBlueprint NAMESPACE = {
79 .flags = 0,
80 .type = ACTOR_TYPE_HYPER_GOOMBA,
81 .level = ACTOR_LEVEL_HYPER_GOOMBA,
82 .maxHP = 7,
83 .partCount = ARRAY_COUNT(N(ActorParts)),
84 .partsData = N(ActorParts),
85 .initScript = &N(EVS_Init),
86 .statusTable = N(StatusTable),
87 .escapeChance = 60,
88 .airLiftChance = 90,
89 .hurricaneChance = 90,
90 .spookChance = 80,
91 .upAndAwayChance = 95,
92 .spinSmashReq = 0,
93 .powerBounceChance = 100,
94 .coinReward = 1,
95 .size = { 24, 24 },
96 .healthBarOffset = { 0, 0 },
97 .statusIconOffset = { -10, 20 },
98 .statusTextOffset = { 10, 20 },
99};
100
101#endif // NESTED_HYPER_GOOMBA_INCLUDE
102
103s32 N(HyperAnims)[] = {
104 STATUS_KEY_NORMAL, ANIM_Goomba_Hyper_Sleep,
105 STATUS_KEY_STONE, ANIM_Goomba_Hyper_Still,
106 STATUS_KEY_SLEEP, ANIM_Goomba_Hyper_Sleep,
107 STATUS_KEY_POISON, ANIM_Goomba_Hyper_Sleep,
108 STATUS_KEY_STOP, ANIM_Goomba_Hyper_Still,
109 STATUS_KEY_STATIC, ANIM_Goomba_Hyper_Sleep,
110 STATUS_KEY_PARALYZE, ANIM_Goomba_Hyper_Still,
111 STATUS_KEY_DIZZY, ANIM_Goomba_Hyper_Dizzy,
112 STATUS_KEY_FEAR, ANIM_Goomba_Hyper_Dizzy,
114};
115
116EvtScript N(EVS_Init) = {
117 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
118 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
119 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
120 Call(BindHandlePhase, ACTOR_SELF, Ref(N(EVS_HandlePhase)))
121 Call(SetActorVar, ACTOR_SELF, AVAR_IsCharged, FALSE)
122 Call(SetActorVar, ACTOR_SELF, AVAR_NotFirstTurn, FALSE)
123 Return
124 End
125};
126
127EvtScript N(EVS_HandlePhase) = {
128 Call(GetBattlePhase, LVar0)
134 Call(SetActorVar, ACTOR_SELF, AVAR_NotFirstTurn, TRUE)
136 Return
137 End
138};
139
141
142EvtScript N(EVS_Move_Charge) = {
143 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
144 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
145 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
146 Call(SetGoalToTarget, ACTOR_SELF)
147 Call(GetActorVar, ACTOR_SELF, AVAR_IsCharged, LVar0)
148 IfEq(LVar0, 0)
149 Call(UseBattleCamPreset, BTL_CAM_ACTOR)
150 Call(BattleCamTargetActor, ACTOR_SELF)
151 Call(MoveBattleCamOver, 20)
152 Wait(20)
153 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_POWER_UP)
154 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
155 Add(LVar1, 10)
156 PlayEffect(EFFECT_ENERGY_IN_OUT, 6, LVar0, LVar1, LVar2, Float(1.0), 45, 0)
157 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run)
158 Wait(30)
159 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
160 Call(MoveBattleCamOver, 20)
161 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
162 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.0))
163 Call(SetGoalPos, ACTOR_SELF, LVar0, 0, LVar2)
164 Call(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
165 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_GOOMBA_STEP)
166 Call(N(StartRumbleWithParams), 128, 10)
167 Thread
168 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(0.5))
170 Call(SetActorVar, ACTOR_SELF, AVAR_IsCharged, 1)
171 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(HyperAnims)))
172 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle)
173 Call(EnableActorGlow, ACTOR_SELF, TRUE)
174 Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, TRUE)
175 Wait(2)
176 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
177 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
178 Return
179 EndIf
180 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
181 Call(BattleCamTargetActor, ACTOR_SELF)
182 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
183 Loop(20)
184 Call(SetActorDispOffset, ACTOR_SELF, 1, 0, 0)
185 Wait(1)
186 Call(SetActorDispOffset, ACTOR_SELF, -1, 0, 0)
187 Wait(1)
188 EndLoop
189 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
190 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
194 Set(LVarA, LVar0)
195 Thread
196 Loop(0)
197 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
198 Add(LVar0, 30)
199 Call(GetActorPos, ACTOR_SELF, LVar3, LVar4, LVar5)
202 EndIf
203 Wait(1)
204 EndLoop
205 Call(UseBattleCamPreset, BTL_CAM_INTERRUPT)
207 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
208 EndIf
209 Wait(15)
210 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
212 Call(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0)
213 Call(SetActorRotation, ACTOR_SELF, 0, 0, 80)
215 Call(SetGoalToTarget, ACTOR_SELF)
216 Call(AddGoalPos, ACTOR_SELF, -200, 0, 0)
217 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.01))
218 Call(SetActorSpeed, ACTOR_SELF, Float(15.0))
219 Call(JumpToGoal, ACTOR_SELF, 0, FALSE, TRUE, FALSE)
220 Call(ResetAllActorSounds, ACTOR_SELF)
221 Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
222 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
223 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
224 Call(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2)
225 Wait(20)
226 Call(EnableActorGlow, ACTOR_SELF, FALSE)
227 Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE)
228 Call(YieldTurn)
229 Call(SetActorPos, ACTOR_SELF, 300, 0, 0)
230 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
231 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run)
232 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
233 Call(SetGoalToHome, ACTOR_SELF)
234 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
235 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle)
236 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
237 Call(SetActorVar, ACTOR_SELF, AVAR_IsCharged, 0)
238 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(DefaultAnims)))
239 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
240 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
241 Return
245 Call(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0)
246 Call(SetActorRotation, ACTOR_SELF, 0, 0, 80)
247 Call(SetGoalToTarget, ACTOR_SELF)
248 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.01))
249 Call(SetActorSpeed, ACTOR_SELF, Float(15.0))
250 Call(JumpToGoal, ACTOR_SELF, 0, FALSE, TRUE, FALSE)
251 Wait(2)
252 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_CHARGED, BS_FLAGS1_TRIGGER_EVENTS)
256 Thread
257 Call(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0)
258 Set(LVar0, 80)
259 Loop(60)
260 Add(LVar0, 18)
261 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
262 Wait(1)
263 EndLoop
264 Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
265 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
267 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
268 Call(ResetAllActorSounds, ACTOR_SELF)
269 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.8))
270 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
271 Set(LVar1, 0)
272 Sub(LVar0, 50)
273 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
274 Call(JumpToGoal, ACTOR_SELF, 30, FALSE, TRUE, FALSE)
275 Sub(LVar0, 40)
276 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
277 Call(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
278 Sub(LVar0, 30)
279 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
280 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
281 Wait(10)
282 Call(EnableActorGlow, ACTOR_SELF, FALSE)
283 Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE)
284 Call(YieldTurn)
285 Call(SetActorYaw, ACTOR_SELF, 180)
286 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run)
287 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
288 Call(SetGoalToHome, ACTOR_SELF)
289 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
290 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle)
291 Call(SetActorYaw, ACTOR_SELF, 0)
292 Call(SetActorVar, ACTOR_SELF, AVAR_IsCharged, 0)
293 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(DefaultAnims)))
296 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
297 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
298 Return
299 End
300};
301
302EvtScript N(EVS_TakeTurn) = {
303 Call(GetBattlePhase, LVar0)
306 ExecWait(N(EVS_Attack_Headbonk))
307 Return
308 EndIf
309 Call(GetActorVar, ACTOR_SELF, AVAR_IsCharged, LVar0)
310 IfEq(LVar0, 1)
311 ExecWait(N(EVS_Move_Charge))
312 Return
313 EndIf
314 Call(GetBattleVar, BTL_VAR_HyperSync, LVar0)
317 Call(GetActorVar, ACTOR_SELF, AVAR_NotFirstTurn, LVar0)
318 IfEq(LVar0, 0)
319 Call(RandInt, 1000, LVar0)
320 IfLt(LVar0, 750)
322 ExecWait(N(EVS_Move_Charge))
323 Else
325 ExecWait(N(EVS_Attack_Headbonk))
326 EndIf
327 Else
328 Call(RandInt, 1000, LVar0)
329 IfLt(LVar0, 500)
331 ExecWait(N(EVS_Move_Charge))
332 Else
334 ExecWait(N(EVS_Attack_Headbonk))
335 EndIf
336 EndIf
338 ExecWait(N(EVS_Attack_Headbonk))
340 ExecWait(N(EVS_Move_Charge))
342 Return
343 End
344};
345
346s32 N(DefaultAnims)[] = {
347 STATUS_KEY_NORMAL, ANIM_Goomba_Hyper_Idle,
348 STATUS_KEY_STONE, ANIM_Goomba_Hyper_Still,
349 STATUS_KEY_SLEEP, ANIM_Goomba_Hyper_Sleep,
350 STATUS_KEY_POISON, ANIM_Goomba_Hyper_Idle,
351 STATUS_KEY_STOP, ANIM_Goomba_Hyper_Still,
352 STATUS_KEY_STATIC, ANIM_Goomba_Hyper_Idle,
353 STATUS_KEY_PARALYZE, ANIM_Goomba_Hyper_Still,
354 STATUS_KEY_DIZZY, ANIM_Goomba_Hyper_Dizzy,
355 STATUS_KEY_FEAR, ANIM_Goomba_Hyper_Dizzy,
357};
358
359s32 N(ShuffleAnims)[] = {
360 STATUS_KEY_NORMAL, ANIM_Goomba_Hyper_Run,
361 STATUS_KEY_STONE, ANIM_Goomba_Hyper_Still,
362 STATUS_KEY_SLEEP, ANIM_Goomba_Hyper_Sleep,
363 STATUS_KEY_POISON, ANIM_Goomba_Hyper_Idle,
364 STATUS_KEY_STOP, ANIM_Goomba_Hyper_Still,
365 STATUS_KEY_STATIC, ANIM_Goomba_Hyper_Run,
366 STATUS_KEY_PARALYZE, ANIM_Goomba_Hyper_Still,
367 STATUS_KEY_DIZZY, ANIM_Goomba_Hyper_Dizzy,
368 STATUS_KEY_FEAR, ANIM_Goomba_Hyper_Dizzy,
370};
371
372// unused
373EvtScript N(EVS_Init_Base) = {
374 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_Attack_Headbonk)))
375 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
376 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
377 Return
378 End
379};
380
381EvtScript N(EVS_Idle) = {
382 Label(10)
383 Call(RandInt, 80, LVar0)
384 Add(LVar0, 80)
385 Loop(LVar0)
386 Label(0)
387 Call(GetStatusFlags, ACTOR_SELF, LVar1)
389 Wait(1)
390 Goto(0)
391 EndIf
392 Wait(1)
393 EndLoop
394 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
395 Add(LVar0, 5)
396 Call(SetActorIdleSpeed, ACTOR_SELF, Float(1.0))
397 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(ShuffleAnims)))
398 Call(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2)
399 Call(IdleRunToGoal, ACTOR_SELF, 0)
400 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(DefaultAnims)))
401 Loop(20)
402 Label(1)
403 Call(GetStatusFlags, ACTOR_SELF, LVar1)
405 Wait(1)
406 Goto(1)
407 EndIf
408 Wait(1)
409 EndLoop
410 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
411 Sub(LVar0, 5)
412 Call(SetActorIdleSpeed, ACTOR_SELF, Float(1.0))
413 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(ShuffleAnims)))
414 Call(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2)
415 Call(IdleRunToGoal, ACTOR_SELF, 0)
416 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(DefaultAnims)))
417 Loop(80)
418 Label(2)
419 Call(GetStatusFlags, ACTOR_SELF, LVar1)
421 Wait(1)
422 Goto(2)
423 EndIf
424 Wait(1)
425 EndLoop
426 Goto(10)
427 Return
428 End
429};
430
431EvtScript N(EVS_HandleEvent) = {
432 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
433 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
434 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
435 Call(GetLastEvent, ACTOR_SELF, LVar0)
439 SetConst(LVar0, PRT_MAIN)
440 SetConst(LVar1, ANIM_Goomba_Hyper_Hurt)
444 SetConst(LVar0, PRT_MAIN)
445 SetConst(LVar1, ANIM_Goomba_Hyper_BurnHurt)
446 SetConst(LVar2, ANIM_Goomba_Hyper_BurnStill)
449 SetConst(LVar0, PRT_MAIN)
450 SetConst(LVar1, ANIM_Goomba_Hyper_BurnHurt)
451 SetConst(LVar2, ANIM_Goomba_Hyper_BurnStill)
453 SetConst(LVar0, PRT_MAIN)
454 SetConst(LVar1, ANIM_Goomba_Hyper_BurnStill)
456 Return
458 SetConst(LVar0, PRT_MAIN)
459 SetConst(LVar1, ANIM_Goomba_Hyper_Hurt)
462 SetConst(LVar0, PRT_MAIN)
463 SetConst(LVar1, ANIM_Goomba_Hyper_Hurt)
465 SetConst(LVar0, PRT_MAIN)
466 SetConst(LVar1, ANIM_Goomba_Hyper_Dead)
468 Return
470 Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
471 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
472 Call(EnableActorGlow, ACTOR_SELF, FALSE)
473 Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE)
474 Call(SetActorVar, ACTOR_SELF, AVAR_IsCharged, 0)
475 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(DefaultAnims)))
476 SetConst(LVar0, PRT_MAIN)
477 SetConst(LVar1, ANIM_Goomba_Hyper_Electrocute)
479 SetConst(LVar0, PRT_MAIN)
480 SetConst(LVar1, ANIM_Goomba_Hyper_Hurt)
482 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
483 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0))
484 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Dizzy)
485 Call(SetGoalToHome, ACTOR_SELF)
486 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
487 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
488 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0))
489 Wait(5)
490 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle)
491 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.6))
492 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
494 Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
495 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
496 Call(EnableActorGlow, ACTOR_SELF, FALSE)
497 Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE)
498 Call(SetActorVar, ACTOR_SELF, AVAR_IsCharged, 0)
499 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(DefaultAnims)))
500 SetConst(LVar0, PRT_MAIN)
501 SetConst(LVar1, ANIM_Goomba_Hyper_Electrocute)
503 SetConst(LVar0, PRT_MAIN)
504 SetConst(LVar1, ANIM_Goomba_Hyper_Dead)
506 Return
508 Call(GetActorVar, ACTOR_SELF, AVAR_IsCharged, LVar0)
509 IfEq(LVar0, 1)
510 Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
511 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
512 Call(EnableActorGlow, ACTOR_SELF, FALSE)
513 Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_ATTACK_CHARGED, FALSE)
514 Call(SetActorVar, ACTOR_SELF, AVAR_IsCharged, 0)
515 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(DefaultAnims)))
516 EndIf
517 SetConst(LVar0, PRT_MAIN)
518 SetConst(LVar1, ANIM_Goomba_Hyper_Idle)
523 SetConst(LVar0, PRT_MAIN)
524 SetConst(LVar1, ANIM_Goomba_Hyper_Idle)
528 SetConst(LVar0, PRT_MAIN)
529 SetConst(LVar1, ANIM_Goomba_Hyper_Hurt)
531 Wait(10)
532 SetConst(LVar0, PRT_MAIN)
533 SetConst(LVar1, ANIM_Goomba_Hyper_Dead)
535 Return
537 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0))
538 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run)
539 Call(SetGoalToHome, ACTOR_SELF)
540 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
541 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
542 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0))
543 Call(HPBarToHome, ACTOR_SELF)
545 SetConst(LVar0, PRT_MAIN)
546 SetConst(LVar1, ANIM_Goomba_Hyper_Idle)
549 SetConst(LVar0, PRT_MAIN)
550 SetConst(LVar1, ANIM_Goomba_Hyper_Run)
551 SetConst(LVar2, ANIM_Goomba_Hyper_Hurt)
553 Return
555 SetConst(LVar0, PRT_MAIN)
556 SetConst(LVar1, ANIM_Goomba_Hyper_Run)
559 SetConst(LVar0, PRT_MAIN)
560 SetConst(LVar1, ANIM_Goomba_Hyper_Hurt)
562 Return
565 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle)
566 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
567 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
568 Return
569 End
570};
571
572#include "common/CalculateArcsinDeg.inc.c"
573
574EvtScript N(EVS_Attack_Headbonk) = {
575 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
576 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
577 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
578 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
579 Call(BattleCamTargetActor, ACTOR_SELF)
580 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
581 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run)
582 Call(SetGoalToTarget, ACTOR_SELF)
583 Call(AddGoalPos, ACTOR_SELF, 50, 0, 0)
584 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
585 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
586 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle)
587 Call(SetActorDispOffset, ACTOR_SELF, 0, -1, 0)
588 Wait(1)
589 Call(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
590 Wait(5)
591 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
592 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair)
593 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
597 Set(LVarA, LVar0)
598 Call(SetGoalToTarget, ACTOR_SELF)
599 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
600 Sub(LVar0, 10)
601 Set(LVar1, 10)
602 Add(LVar2, 3)
603 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
604 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.2))
605 Thread
606 Call(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0)
607 Set(LVar0, 0)
608 Loop(16)
609 Call(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6)
610 Call(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0)
611 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
612 Set(LVar1, LVar4)
613 Set(LVar2, LVar5)
614 Set(LVar3, LVar6)
615 Wait(1)
616 EndLoop
618 Thread
619 Wait(6)
620 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair)
622 Call(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
623 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Sleep)
624 Call(SetActorScale, ACTOR_SELF, Float(1.1), Float(0.8), Float(1.0))
625 Call(SetActorDispOffset, ACTOR_SELF, 0, 5, 0)
626 Wait(1)
627 Call(SetActorScale, ACTOR_SELF, Float(1.3), Float(0.5), Float(1.0))
628 Call(SetActorDispOffset, ACTOR_SELF, 0, -2, 0)
629 Wait(1)
630 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
631 Call(SetActorDispOffset, ACTOR_SELF, 0, 7, 0)
632 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Hurt)
633 Wait(5)
635 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
636 EndIf
637 Wait(5)
638 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
639 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair)
640 Call(SetGoalToTarget, ACTOR_SELF)
641 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
642 Add(LVar0, 20)
643 Set(LVar1, 0)
644 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
645 Call(SetActorJumpGravity, ACTOR_SELF, Float(2.0))
646 Thread
647 Wait(4)
648 Set(LVar0, 180)
649 Loop(4)
650 Sub(LVar0, 45)
651 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
652 Wait(1)
653 EndLoop
654 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair)
656 Call(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
657 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Dizzy)
658 Wait(5)
659 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
660 Call(YieldTurn)
661 Call(SetActorYaw, ACTOR_SELF, 180)
662 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
663 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0))
664 Call(SetGoalToHome, ACTOR_SELF)
665 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
666 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
667 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0))
668 Call(SetActorYaw, ACTOR_SELF, 0)
669 Wait(5)
670 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle)
671 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.6))
672 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
673 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
674 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
675 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
676 Return
679 Call(SetGoalToTarget, ACTOR_SELF)
680 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.2))
681 Thread
682 Call(GetActorPos, ACTOR_SELF, LVar1, LVar2, LVar0)
683 Set(LVar0, 0)
684 Loop(16)
685 Call(GetActorPos, ACTOR_SELF, LVar4, LVar5, LVar6)
686 Call(N(CalculateArcsinDeg), LVar1, LVar2, LVar4, LVar5, LVar0)
687 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
688 Set(LVar1, LVar4)
689 Set(LVar2, LVar5)
690 Set(LVar3, LVar6)
691 Wait(1)
692 EndLoop
694 Thread
695 Wait(6)
696 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Midair)
698 Call(JumpToGoal, ACTOR_SELF, 16, FALSE, TRUE, FALSE)
699 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Tense)
700 Call(SetActorScale, ACTOR_SELF, Float(1.1), Float(0.8), Float(1.0))
701 Wait(1)
702 Call(SetActorScale, ACTOR_SELF, Float(1.3), Float(0.5), Float(1.0))
703 Wait(1)
705 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_HEADBONK, BS_FLAGS1_TRIGGER_EVENTS)
709 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
710 Call(SetActorScale, ACTOR_SELF, Float(1.1), Float(0.8), Float(1.0))
711 Wait(1)
712 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
713 Wait(1)
714 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
715 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
716 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle)
717 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
718 Add(LVar0, 40)
719 Set(LVar1, 0)
720 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
721 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
722 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
723 Add(LVar0, 30)
724 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
725 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
726 Add(LVar0, 20)
727 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
728 Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
729 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Idle)
730 Wait(3)
731 Call(YieldTurn)
732 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0))
733 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Goomba_Hyper_Run)
734 Call(SetGoalToHome, ACTOR_SELF)
735 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
736 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
737 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0))
740 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
741 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
742 Return
743 End
744};
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ BTL_CAM_XADJ_AVG
Definition enums.h:4900
@ ACTOR_SOUND_JUMP
Definition enums.h:2036
@ 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_EVENT_FLAG_ATTACK_CHARGED
Actor has charged an attack that can be removed with Star Beam.
Definition enums.h:3389
@ ACTOR_EVENT_FLAGS_NONE
Definition enums.h:3370
@ ACTOR_DECORATION_SWEAT
Definition enums.h:2045
@ PHASE_ENEMY_BEGIN
Definition enums.h:2068
@ PHASE_PLAYER_BEGIN
Definition enums.h:2066
@ PHASE_ENEMY_END
Definition enums.h:2067
@ 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
@ BTL_CAM_INTERRUPT
Definition enums.h:4823
@ BTL_CAM_ACTOR
Definition enums.h:4836
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4885
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ SOUND_POWER_UP
Definition enums.h:1050
@ SOUND_ACTOR_HURT
Definition enums.h:748
@ SOUND_GOOMBA_STEP
Definition enums.h:1507
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ BTL_CAM_YADJ_TARGET
Definition enums.h:4905
@ EVENT_HIT
Definition enums.h:2132
@ EVENT_SCARE_AWAY
Definition enums.h:2174
@ EVENT_BURN_HIT
Definition enums.h:2136
@ EVENT_STAR_BEAM
Definition enums.h:2140
@ EVENT_END_FIRST_STRIKE
Definition enums.h:2171
@ 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
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
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)
ApiStatus ShakeCam(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 LVar6
Definition macros.h:154
#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 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 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 IfLt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR < RVAR.
Definition macros.h:275
#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 BreakLoop
Breaks out of the innermost loop.
Definition macros.h:251
#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 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 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 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 Return
Kills the current EVT thread.
Definition macros.h:217
@ BTL_VAL_HyperSync_Active
Definition battle.h:86
@ BTL_VAL_HyperSync_Done
Definition battle.h:85
@ BTL_VAL_HyperSync_None
Definition battle.h:84
@ BTL_VAR_HyperSync
Definition battle.h:83