Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
dark_paratroopa.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "sprite/npc/ParaTroopa.h"
4#include "sprite/npc/KoopaTroopa.h"
5#include "effects.h"
6
7#define NAMESPACE A(dark_paratroopa)
8
9extern EvtScript N(EVS_Init_Flying);
10extern EvtScript N(EVS_Idle_Flying);
11extern EvtScript N(EVS_TakeTurn_Flying);
12extern EvtScript N(EVS_HandleEvent_Flying);
13extern EvtScript N(EVS_HandlePhase_Flying);
14
15extern EvtScript N(EVS_Init_Koopa);
16extern EvtScript N(EVS_Idle_Koopa);
17extern EvtScript N(EVS_TakeTurn_Koopa);
18extern EvtScript N(EVS_HandleEvent_Koopa);
19extern EvtScript N(EVS_HandlePhase_Koopa);
20extern EvtScript N(EVS_FallDown);
21
22extern s32 N(KoopaAnims)[];
23extern s32 N(FlyingAnims)[];
24extern s32 N(WingAnims)[];
25
26enum N(ActorPartIDs) {
27 PRT_MAIN = 1,
28 PRT_FLYING = 2,
29 PRT_WINGS = 3,
30};
31
32enum N(ActorVars) {
33 AVAR_TriggeredFall = 0,
34 AVAR_HasWhirlwind = 1,
35 AVAR_State = 8,
36 AVAL_State_Normal = 0,
37 AVAL_State_Hyper = 1,
38 AVAL_State_ToppledNormal = 2,
39 AVAL_State_ToppledHyper = 3,
40 AVAR_ToppleTurns = 9,
41};
42
43enum N(ActorParams) {
44 DMG_SKY_DIVE = 3,
45 DMG_SHELL_TOSS = 3,
46};
47
48#define SWEAT_DECOR_IDX 0
49#define WHIRLWIND_DECOR_IDX 1
50
51s32 N(UprightDefenseTable)[] = {
54 ELEMENT_JUMP, 2,
58};
59
60s32 N(defenseTable2)[] = {
63};
64
65s32 N(ToppledDefenseTable)[] = {
68};
69
70s32 N(StatusTable)[] = {
93};
94
95s32 N(FlyingStatusTable)[] = {
106 STATUS_KEY_STOP, 90,
118};
119
120ActorPartBlueprint N(ActorParts)[] = {
121 {
123 .index = PRT_MAIN,
124 .posOffset = { 0, 0, 0 },
125 .targetOffset = { -2, 36 },
126 .opacity = 255,
127 .idleAnimations = N(KoopaAnims),
128 .defenseTable = N(UprightDefenseTable),
129 .eventFlags = ACTOR_EVENT_FLAG_FLIPABLE,
130 .elementImmunityFlags = 0,
131 .projectileTargetOffset = { 0, -7 },
132 },
133 {
135 .index = PRT_FLYING,
136 .posOffset = { 0, 0, 0 },
137 .targetOffset = { -4, 36 },
138 .opacity = 255,
139 .idleAnimations = N(FlyingAnims),
140 .defenseTable = N(defenseTable2),
141 .eventFlags = ACTOR_EVENT_FLAG_GROUNDABLE,
142 .elementImmunityFlags = 0,
143 .projectileTargetOffset = { 2, -14 },
144 },
145 {
147 .index = PRT_WINGS,
148 .posOffset = { 0, 0, 0 },
149 .targetOffset = { 0, 32 },
150 .opacity = 255,
151 .idleAnimations = N(WingAnims),
152 .defenseTable = N(UprightDefenseTable),
153 .eventFlags = 0,
154 .elementImmunityFlags = 0,
155 .projectileTargetOffset = { 0, -10 },
156 },
157};
158
159ActorBlueprint NAMESPACE = {
160 .flags = ACTOR_FLAG_FLYING,
161 .type = ACTOR_TYPE_DARK_PARATROOPA,
162 .level = ACTOR_LEVEL_DARK_PARATROOPA,
163 .maxHP = 8,
164 .partCount = ARRAY_COUNT(N(ActorParts)),
165 .partsData = N(ActorParts),
166 .initScript = &N(EVS_Init_Flying),
167 .statusTable = N(FlyingStatusTable),
168 .escapeChance = 50,
169 .airLiftChance = 90,
170 .hurricaneChance = 80,
171 .spookChance = 70,
172 .upAndAwayChance = 95,
173 .spinSmashReq = 0,
174 .powerBounceChance = 85,
175 .coinReward = 2,
176 .size = { 50, 38 },
177 .healthBarOffset = { 0, 0 },
178 .statusIconOffset = { -10, 29 },
179 .statusTextOffset = { 8, 30 },
180};
181
182s32 N(FlyingAnims)[] = {
183 STATUS_KEY_NORMAL, ANIM_ParaTroopa_Dark_Idle,
184 STATUS_KEY_STONE, ANIM_ParaTroopa_Dark_Still,
185 STATUS_KEY_SLEEP, ANIM_ParaTroopa_Dark_Sleep,
186 STATUS_KEY_POISON, ANIM_ParaTroopa_Dark_Still,
187 STATUS_KEY_STOP, ANIM_ParaTroopa_Dark_Still,
188 STATUS_KEY_STATIC, ANIM_ParaTroopa_Dark_Idle,
189 STATUS_KEY_PARALYZE, ANIM_ParaTroopa_Dark_Still,
190 STATUS_KEY_DIZZY, ANIM_ParaTroopa_Dark_Stunned,
191 STATUS_KEY_FEAR, ANIM_ParaTroopa_Dark_Stunned,
193};
194
195s32 N(FlyingShuffleAnims)[] = {
196 STATUS_KEY_NORMAL, ANIM_ParaTroopa_Dark_Idle,
197 STATUS_KEY_STONE, ANIM_ParaTroopa_Dark_Still,
198 STATUS_KEY_SLEEP, ANIM_ParaTroopa_Dark_Sleep,
199 STATUS_KEY_POISON, ANIM_ParaTroopa_Dark_Still,
200 STATUS_KEY_STOP, ANIM_ParaTroopa_Dark_Still,
201 STATUS_KEY_STATIC, ANIM_ParaTroopa_Dark_Idle,
202 STATUS_KEY_PARALYZE, ANIM_ParaTroopa_Dark_Still,
203 STATUS_KEY_DIZZY, ANIM_ParaTroopa_Dark_Stunned,
204 STATUS_KEY_FEAR, ANIM_ParaTroopa_Dark_Stunned,
206};
207
208s32 N(WingAnims)[] = {
209 STATUS_KEY_NORMAL, ANIM_ParaTroopa_Dark_WingsStill,
210 STATUS_KEY_STONE, ANIM_ParaTroopa_Dark_Still,
211 STATUS_KEY_SLEEP, ANIM_ParaTroopa_Dark_Sleep,
212 STATUS_KEY_POISON, ANIM_ParaTroopa_Dark_Still,
213 STATUS_KEY_STOP, ANIM_ParaTroopa_Dark_Still,
214 STATUS_KEY_STATIC, ANIM_ParaTroopa_Dark_WingsStill,
215 STATUS_KEY_PARALYZE, ANIM_ParaTroopa_Dark_Still,
216 STATUS_KEY_DIZZY, ANIM_ParaTroopa_Dark_Stunned,
217 STATUS_KEY_FEAR, ANIM_ParaTroopa_Dark_Stunned,
219};
220
221EvtScript N(EVS_HandlePhase_Flying) = {
222 Call(SetActorVar, ACTOR_SELF, AVAR_TriggeredFall, FALSE)
223 Return
224 End
225};
226
227EvtScript N(EVS_Init_Flying) = {
228 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn_Flying)))
229 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle_Flying)))
230 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent_Flying)))
231 Call(BindHandlePhase, ACTOR_SELF, Ref(N(EVS_HandlePhase_Flying)))
232 Call(SetActorVar, ACTOR_SELF, AVAR_TriggeredFall, FALSE)
233 Return
234 End
235};
236
239
240EvtScript N(EVS_UpdateOffsets_Flying) = {
242 Call(SetTargetOffset, ACTOR_SELF, PRT_FLYING, 0, 25)
243 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_FLYING, 3, -6)
244 Call(N(SetAbsoluteStatusOffsets), -19, 25, 4, 28)
245 Else
246 Call(SetTargetOffset, ACTOR_SELF, PRT_FLYING, -2, 36)
247 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_FLYING, 0, -7)
248 Call(N(SetAbsoluteStatusOffsets), -10, 29, 8, 30)
249 EndIf
250 Return
251 End
252};
253
254EvtScript N(EVS_Idle_Flying) = {
255 Label(10)
256 Call(RandInt, 80, LVar0)
257 Add(LVar0, 80)
258 Loop(LVar0)
259 Label(0)
260 Call(GetStatusFlags, ACTOR_SELF, LVar1)
261 ExecWait(N(EVS_UpdateOffsets_Flying))
263 Wait(1)
264 Goto(0)
265 EndIf
266 Wait(1)
267 EndLoop
268 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
269 Add(LVar0, 5)
270 Call(SetActorIdleSpeed, ACTOR_SELF, Float(0.6))
271 Call(SetIdleAnimations, ACTOR_SELF, PRT_FLYING, Ref(N(FlyingShuffleAnims)))
272 Call(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2)
273 Call(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR)
274 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(FlyingAnims)))
275 Loop(20)
276 Label(1)
277 Call(GetStatusFlags, ACTOR_SELF, LVar1)
278 ExecWait(N(EVS_UpdateOffsets_Flying))
280 Wait(1)
281 Goto(1)
282 EndIf
283 Wait(1)
284 EndLoop
285 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
286 Sub(LVar0, 5)
287 Call(SetActorIdleSpeed, ACTOR_SELF, Float(0.6))
288 Call(SetIdleAnimations, ACTOR_SELF, PRT_FLYING, Ref(N(FlyingShuffleAnims)))
289 Call(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2)
290 Call(IdleFlyToGoal, ACTOR_SELF, 0, -5, EASING_LINEAR)
291 Call(SetIdleAnimations, ACTOR_SELF, PRT_FLYING, Ref(N(FlyingAnims)))
292 Loop(40)
293 Label(2)
294 Call(GetStatusFlags, ACTOR_SELF, LVar1)
295 ExecWait(N(EVS_UpdateOffsets_Flying))
297 Wait(1)
298 Goto(2)
299 EndIf
300 Wait(1)
301 EndLoop
302 Goto(10)
303 Return
304 End
305};
306
307EvtScript N(EVS_ReturnHome) = {
308 Call(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Dark_Run)
309 Call(SetGoalToHome, ACTOR_SELF)
310 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
311 Call(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT)
312 Call(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Dark_Idle)
313 Return
314 End
315};
316
317EvtScript N(EVS_HandleEvent_Flying) = {
318 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
319 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
320 Call(GetLastEvent, ACTOR_SELF, LVar0)
323 Call(SetActorVar, ACTOR_SELF, AVAR_TriggeredFall, TRUE)
324 SetConst(LVar0, PRT_FLYING)
325 SetConst(LVar1, ANIM_ParaTroopa_Dark_Hurt)
328 SetConst(LVar0, PRT_FLYING)
329 SetConst(LVar1, ANIM_ParaTroopa_Dark_Hurt)
331 Call(GetBattlePhase, LVar0)
333 Call(GetEncounterTrigger, LVar0)
335 ExecWait(N(EVS_FallDown))
336 EndIf
337 EndIf
339 SetConst(LVar0, PRT_FLYING)
340 SetConst(LVar1, ANIM_ParaTroopa_Dark_Hurt)
343 SetConst(LVar0, PRT_FLYING)
344 SetConst(LVar1, ANIM_ParaTroopa_Dark_Hurt)
346 SetConst(LVar0, PRT_FLYING)
347 SetConst(LVar1, ANIM_ParaTroopa_Dark_HurtStill)
349 Return
351 SetConst(LVar0, PRT_FLYING)
352 SetConst(LVar1, ANIM_ParaTroopa_Dark_BurnHurt)
353 SetConst(LVar2, ANIM_ParaTroopa_Dark_BurnStill)
356 SetConst(LVar0, PRT_FLYING)
357 SetConst(LVar1, ANIM_ParaTroopa_Dark_BurnHurt)
358 SetConst(LVar2, ANIM_ParaTroopa_Dark_BurnStill)
360 SetConst(LVar0, PRT_FLYING)
361 SetConst(LVar1, ANIM_ParaTroopa_Dark_BurnStill)
363 Return
365 SetConst(LVar0, PRT_FLYING)
366 SetConst(LVar1, ANIM_ParaTroopa_Dark_Hurt)
368 ExecWait(N(EVS_FallDown))
370 SetConst(LVar0, PRT_MAIN)
371 SetConst(LVar1, ANIM_ParaTroopa_Dark_BurnHurt)
372 SetConst(LVar1, ANIM_ParaTroopa_Dark_BurnStill)
374 ExecWait(N(EVS_FallDown))
376 SetConst(LVar0, PRT_MAIN)
377 SetConst(LVar1, ANIM_ParaTroopa_Dark_Hurt)
379 SetConst(LVar0, PRT_MAIN)
380 SetConst(LVar1, ANIM_ParaTroopa_Dark_HurtStill)
382 ExecWait(N(EVS_ReturnHome))
384 SetConst(LVar0, PRT_FLYING)
385 SetConst(LVar1, ANIM_ParaTroopa_Dark_Hurt)
387 SetConst(LVar0, PRT_FLYING)
388 SetConst(LVar1, ANIM_ParaTroopa_Dark_HurtStill)
390 Return
392 Call(SetActorVar, ACTOR_SELF, AVAR_TriggeredFall, TRUE)
393 SetConst(LVar0, PRT_FLYING)
394 SetConst(LVar1, ANIM_ParaTroopa_Dark_ShellEnter)
398 SetConst(LVar0, PRT_FLYING)
399 SetConst(LVar1, ANIM_ParaTroopa_Dark_ShellEnter)
401 Call(GetBattlePhase, LVar0)
403 Call(GetEncounterTrigger, LVar0)
405 ExecWait(N(EVS_FallDown))
406 EndIf
407 EndIf
410 SetConst(LVar0, PRT_FLYING)
411 SetConst(LVar1, ANIM_ParaTroopa_Dark_Hurt)
413 Wait(10)
414 SetConst(LVar0, PRT_FLYING)
415 SetConst(LVar1, ANIM_ParaTroopa_Dark_HurtStill)
417 Return
419 Call(SetActorPos, ACTOR_SELF, 20, 0, 0)
420 Call(HPBarToCurrent, ACTOR_SELF)
422 ExecWait(N(EVS_ReturnHome))
423 Call(HPBarToHome, ACTOR_SELF)
425 SetConst(LVar0, PRT_FLYING)
426 SetConst(LVar1, ANIM_ParaTroopa_Dark_Idle)
429 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE)
430 SetConst(LVar0, PRT_FLYING)
431 SetConst(LVar1, ANIM_ParaTroopa_Dark_Run)
432 SetConst(LVar2, ANIM_ParaTroopa_Dark_Hurt)
434 Return
436 SetConst(LVar0, PRT_FLYING)
437 SetConst(LVar1, ANIM_ParaTroopa_Dark_Run)
440 SetConst(LVar0, PRT_FLYING)
441 SetConst(LVar1, ANIM_ParaTroopa_Dark_Hurt)
443 Return
446 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_RESTART)
447 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
448 Return
449 End
450};
451
452EvtScript N(EVS_TakeTurn_Flying) = {
453 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
454 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
455 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
456 Call(SetGoalToTarget, ACTOR_SELF)
457 Call(UseBattleCamPreset, BTL_CAM_ACTOR_TARGET_MIDPOINT)
458 Call(BattleCamTargetActor, ACTOR_SELF)
459 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
460 Call(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Dark_Run)
461 Call(SetGoalToTarget, ACTOR_SELF)
462 Call(AddGoalPos, ACTOR_SELF, 40, 30, 0)
463 Call(SetActorSpeed, ACTOR_SELF, Float(7.0))
464 Call(FlyToGoal, ACTOR_SELF, 0, -16, EASING_LINEAR)
465 Call(UseBattleCamPresetImmediately, BTL_CAM_INTERRUPT)
466 Wait(5)
467 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 3, BS_FLAGS1_INCLUDE_POWER_UPS)
471 Set(LVarA, LVar0)
472 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_PARAGOOMBA_PREDIVE)
474 Call(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Dark_Windup)
475 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
476 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
477 Call(AddGoalPos, ACTOR_SELF, 6, 6, 0)
478 Call(SetActorSpeed, ACTOR_SELF, Float(2.0))
479 Call(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR)
480 Wait(6)
481 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_PARAGOOMBA_DIVE)
483 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
484 Sub(LVar0, 25)
485 Set(LVar1, 0)
486 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
487 Call(SetActorSpeed, ACTOR_SELF, Float(10.0))
488 Call(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Dark_ShellDive)
489 Call(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR)
490 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
491 Sub(LVar0, 30)
492 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
493 Call(SetActorJumpGravity, ACTOR_SELF, Float(4.0))
494 Thread
495 Call(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0)
496 Set(LVar0, 0)
497 Loop(8)
498 Add(LVar0, 90)
499 IfGe(LVar0, 360)
500 Sub(LVar0, 360)
501 EndIf
502 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
503 Wait(1)
504 EndLoop
505 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
506 Call(SetActorRotationOffset, ACTOR_SELF, 0, -10, 0)
508 Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
509 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
510 Sub(LVar0, 30)
511 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
512 Call(SetActorJumpGravity, ACTOR_SELF, Float(4.0))
513 Call(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Dark_Hurt)
514 Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
515 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
516 Sub(LVar0, 30)
517 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
518 Call(SetActorJumpGravity, ACTOR_SELF, Float(4.0))
519 Call(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Dark_Hurt)
520 Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
522 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
523 EndIf
524 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
525 Add(LVar1, 30)
526 Call(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
527 Wait(20)
528 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
529 Call(YieldTurn)
530 Call(ResetAllActorSounds, ACTOR_SELF)
531 Call(AddActorDecoration, ACTOR_SELF, PRT_FLYING, 0, ACTOR_DECORATION_SWEAT)
532 Call(SetActorYaw, ACTOR_SELF, 180)
533 ExecWait(N(EVS_ReturnHome))
534 Call(SetActorYaw, ACTOR_SELF, 0)
535 Call(RemoveActorDecoration, ACTOR_SELF, PRT_FLYING, 0)
536 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_RESTART)
537 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
538 Return
541 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_PARAGOOMBA_PREDIVE)
543 Call(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Dark_Windup)
544 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
545 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
546 Call(AddGoalPos, ACTOR_SELF, 6, 6, 0)
547 Call(SetActorSpeed, ACTOR_SELF, Float(2.0))
548 Call(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR)
549 Wait(6)
550 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_PARAGOOMBA_DIVE)
552 Call(SetGoalToTarget, ACTOR_SELF)
553 Call(SetActorSpeed, ACTOR_SELF, Float(10.0))
554 Call(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Dark_ShellDive)
555 Call(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR)
556 Wait(2)
557 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, SUPPRESS_EVENT_ALL, 0, DMG_SKY_DIVE, BS_FLAGS1_TRIGGER_EVENTS)
561 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
562 Call(SetGoalToTarget, ACTOR_SELF)
563 Call(AddGoalPos, ACTOR_SELF, 40, 30, 0)
564 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
565 Call(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Dark_ShellHit)
566 Thread
567 Call(SetActorRotationOffset, ACTOR_SELF, 0, 10, 0)
568 Set(LVar0, 0)
569 Loop(12)
570 Sub(LVar0, 90)
571 IfLt(LVar0, 0)
572 Add(LVar0, 360)
573 EndIf
574 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
575 Wait(1)
576 EndLoop
577 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
578 Call(SetActorRotationOffset, ACTOR_SELF, 0, -10, 0)
579 Call(SetAnimation, ACTOR_SELF, PRT_FLYING, ANIM_ParaTroopa_Dark_Idle)
581 Call(FlyToGoal, ACTOR_SELF, 0, 30, EASING_LINEAR)
582 Wait(10)
583 Call(YieldTurn)
584 Call(ResetAllActorSounds, ACTOR_SELF)
585 ExecWait(N(EVS_ReturnHome))
588 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_RESTART)
589 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
590 Return
591 End
592};
593
594EvtScript N(EVS_FallDown) = {
595 Call(SetPartDispOffset, ACTOR_SELF, PRT_FLYING, 0, 0, 0)
596 Call(HideHealthBar, ACTOR_SELF)
600 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
601 Add(LVar1, 8)
602 Sub(LVar2, 2)
603 Call(SetPartPos, ACTOR_SELF, PRT_WINGS, LVar0, LVar1, LVar2)
604 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Hurt)
606 Call(GetActorVar, ACTOR_SELF, AVAR_TriggeredFall, LVarA)
607 IfEq(LVarA, FALSE)
608 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
609 Set(LVar1, 0)
610 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.8))
611 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
612 Call(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
613 Call(N(StartRumbleWithParams), 128, 7)
614 Thread
615 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(0.3))
617 Call(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP)
618 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
619 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
620 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
621 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
622 Loop(10)
623 Call(SetPartFlagBits, ACTOR_SELF, PRT_WINGS, ACTOR_PART_FLAG_INVISIBLE, TRUE)
624 Wait(1)
625 Call(SetPartFlagBits, ACTOR_SELF, PRT_WINGS, ACTOR_PART_FLAG_INVISIBLE, FALSE)
626 Wait(1)
627 EndLoop
628 Call(SetPartFlagBits, ACTOR_SELF, PRT_WINGS, ACTOR_PART_FLAG_INVISIBLE, TRUE)
629 Else
630 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
631 Set(LVar1, 0)
632 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.8))
633 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
634 Call(JumpToGoal, ACTOR_SELF, 15, FALSE, TRUE, FALSE)
635 Thread
636 Loop(10)
637 Call(SetPartFlagBits, ACTOR_SELF, PRT_WINGS, ACTOR_PART_FLAG_INVISIBLE, TRUE)
638 Wait(1)
639 Call(SetPartFlagBits, ACTOR_SELF, PRT_WINGS, ACTOR_PART_FLAG_INVISIBLE, FALSE)
640 Wait(1)
641 EndLoop
642 Call(SetPartFlagBits, ACTOR_SELF, PRT_WINGS, ACTOR_PART_FLAG_INVISIBLE, TRUE)
644 Call(N(StartRumbleWithParams), 150, 7)
645 Thread
646 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(0.3))
648 Call(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP)
649 EndIf
650 Call(GetIndexFromHome, ACTOR_SELF, LVar0)
651 Mod(LVar0, 4)
652 Call(SetGoalToIndex, ACTOR_SELF, LVar0)
653 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
654 Call(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2)
655 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle)
656 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE)
657 Call(SetStatusTable, ACTOR_SELF, Ref(N(StatusTable)))
658 Call(BindHandlePhase, ACTOR_SELF, 0)
659 ExecWait(N(EVS_Init_Koopa))
660 Call(SetActorType, ACTOR_SELF, ACTOR_TYPE_DARK_KOOPA)
661 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TYPE_CHANGED, TRUE)
662 Call(HPBarToHome, ACTOR_SELF)
663 Call(ResetAllActorSounds, ACTOR_SELF)
664 IfNe(LVarA, 0)
665 Call(DispatchEvent, ACTOR_SELF, EVENT_FLIP_TRIGGER)
666 EndIf
667 Return
668 End
669};
670
671// everything below this point refers to plain Dark Koopa
672
673s32 N(KoopaAnims)[] = {
674 STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Idle,
675 STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still,
676 STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep,
677 STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Idle,
678 STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still,
679 STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Idle,
680 STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still,
681 STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned,
682 STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned,
684};
685
686s32 N(ShuffleAnims)[] = {
687 STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Walk,
688 STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still,
689 STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep,
690 STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Walk,
691 STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still,
692 STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Walk,
693 STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still,
694 STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned,
695 STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned,
697};
698
699s32 N(HyperAnims)[] = {
700 STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Scramble,
701 STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still,
702 STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep,
703 STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Scramble,
704 STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still,
705 STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Scramble,
706 STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still,
707 STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned,
708 STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned,
710};
711
712s32 N(HyperShuffleAnims)[] = {
713 STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_Walk,
714 STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_Still,
715 STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_Sleep,
716 STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_Walk,
717 STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_Still,
718 STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_Walk,
719 STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_Still,
720 STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_Stunned,
721 STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_Stunned,
723};
724
725s32 N(ToppledAnims)[] = {
726 STATUS_KEY_NORMAL, ANIM_KoopaTroopa_Dark_ToppleStruggle,
727 STATUS_KEY_STONE, ANIM_KoopaTroopa_Dark_ToppleStill,
728 STATUS_KEY_SLEEP, ANIM_KoopaTroopa_Dark_ToppleSleep,
729 STATUS_KEY_POISON, ANIM_KoopaTroopa_Dark_ToppleStruggle,
730 STATUS_KEY_STOP, ANIM_KoopaTroopa_Dark_ToppleStill,
731 STATUS_KEY_STATIC, ANIM_KoopaTroopa_Dark_ToppleStruggle,
732 STATUS_KEY_PARALYZE, ANIM_KoopaTroopa_Dark_ToppleStill,
733 STATUS_KEY_DIZZY, ANIM_KoopaTroopa_Dark_ToppleStunned,
734 STATUS_KEY_FEAR, ANIM_KoopaTroopa_Dark_ToppleStunned,
736};
737
738EvtScript N(EVS_Init_Koopa) = {
739 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn_Koopa)))
740 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle_Koopa)))
741 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent_Koopa)))
742 Call(RandInt, 1000, LVar0)
743 IfLt(LVar0, 300)
744 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_Normal)
745 Else
746 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_Hyper)
747 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(HyperAnims)))
748 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble)
749 EndIf
750 Call(SetActorVar, ACTOR_SELF, AVAR_HasWhirlwind, FALSE)
751 Return
752 End
753};
754
755EvtScript N(EVS_UpdateOffsets_Koopa) = {
757 CaseOrEq(AVAL_State_Normal)
758 CaseOrEq(AVAL_State_Hyper)
760 Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15)
761 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0)
762 Call(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20)
763 Else
764 Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32)
765 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4)
766 Call(N(SetAbsoluteStatusOffsets), -15, 32, 5, 32)
767 EndIf
769 CaseOrEq(AVAL_State_ToppledNormal)
770 CaseOrEq(AVAL_State_ToppledHyper)
771 Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15)
772 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0)
773 Call(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20)
776 Return
777 End
778};
779
780EvtScript N(EVS_Idle_Koopa) = {
781 Label(0)
782 Call(RandInt, 80, LVarA)
783 Add(LVarA, 80)
784 Loop(LVarA)
785 Label(1)
786 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
787 Call(GetStatusFlags, ACTOR_SELF, LVar1)
788 ExecWait(N(EVS_UpdateOffsets_Koopa))
789 IfEq(LVar0, AVAL_State_ToppledNormal)
790 Wait(1)
791 Goto(1)
792 EndIf
793 IfEq(LVar0, AVAL_State_ToppledHyper)
794 Wait(1)
795 Goto(1)
796 EndIf
798 Wait(1)
799 Goto(1)
800 EndIf
801 Wait(1)
802 EndLoop
803 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
805 CaseEq(AVAL_State_Normal)
806 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(ShuffleAnims)))
807 CaseEq(AVAL_State_Hyper)
808 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(HyperShuffleAnims)))
810 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
811 Add(LVar0, 5)
812 Call(SetActorIdleSpeed, ACTOR_SELF, Float(1.0))
813 Call(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2)
814 Call(IdleRunToGoal, ACTOR_SELF, 0)
815 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
817 CaseEq(AVAL_State_Normal)
818 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(KoopaAnims)))
819 CaseEq(AVAL_State_Hyper)
820 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(HyperAnims)))
821 CaseOrEq(AVAL_State_ToppledNormal)
822 CaseOrEq(AVAL_State_ToppledHyper)
823 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(ToppledAnims)))
826 Loop(20)
827 Label(2)
828 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
829 Call(GetStatusFlags, ACTOR_SELF, LVar1)
830 ExecWait(N(EVS_UpdateOffsets_Koopa))
831 IfEq(LVar0, AVAL_State_ToppledNormal)
832 Wait(1)
833 Goto(2)
834 EndIf
835 IfEq(LVar0, AVAL_State_ToppledHyper)
836 Wait(1)
837 Goto(2)
838 EndIf
840 Wait(1)
841 Goto(2)
842 EndIf
843 Wait(1)
844 EndLoop
845 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
847 CaseEq(AVAL_State_Normal)
848 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(ShuffleAnims)))
849 CaseEq(AVAL_State_Hyper)
850 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(HyperShuffleAnims)))
852 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
853 Sub(LVar0, 5)
854 Call(SetActorIdleSpeed, ACTOR_SELF, Float(1.0))
855 Call(SetIdleGoal, ACTOR_SELF, LVar0, LVar1, LVar2)
856 Call(IdleRunToGoal, ACTOR_SELF, 0)
857 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
859 CaseEq(AVAL_State_Normal)
860 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(KoopaAnims)))
861 CaseEq(AVAL_State_Hyper)
862 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(HyperAnims)))
863 CaseOrEq(AVAL_State_ToppledNormal)
864 CaseOrEq(AVAL_State_ToppledHyper)
865 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(ToppledAnims)))
868 Loop(50)
869 Label(3)
870 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
871 Call(GetStatusFlags, ACTOR_SELF, LVar1)
872 ExecWait(N(EVS_UpdateOffsets_Koopa))
873 IfEq(LVar0, AVAL_State_ToppledNormal)
874 Wait(1)
875 Goto(3)
876 EndIf
877 IfEq(LVar0, AVAL_State_ToppledHyper)
878 Wait(1)
879 Goto(3)
880 EndIf
882 Wait(1)
883 Goto(3)
884 EndIf
885 Wait(1)
886 EndLoop
887 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
889 CaseEq(AVAL_State_Hyper)
890 Call(SetActorVar, ACTOR_SELF, AVAR_HasWhirlwind, TRUE)
891 Thread
892 Call(MakeLerp, 720, 0, 30, EASING_COS_IN_OUT)
893 Label(10)
895 Call(SetActorYaw, ACTOR_SELF, LVar0)
896 IfEq(LVar1, 1)
897 Call(GetActorVar, ACTOR_SELF, AVAR_HasWhirlwind, LVar2)
898 IfEq(LVar2, 1)
899 Wait(1)
900 Goto(10)
901 EndIf
902 EndIf
903 Call(SetActorVar, ACTOR_SELF, AVAR_HasWhirlwind, FALSE)
904 Call(SetActorYaw, ACTOR_SELF, 0)
906 Wait(8)
907 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, WHIRLWIND_DECOR_IDX, ACTOR_DECORATION_WHIRLWIND)
908 Wait(15)
909 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, WHIRLWIND_DECOR_IDX)
910 Wait(8)
911 Call(SetActorVar, ACTOR_SELF, AVAR_HasWhirlwind, FALSE)
912 CaseEq(AVAL_State_Normal)
913 CaseEq(AVAL_State_ToppledNormal)
914 CaseEq(AVAL_State_ToppledHyper)
916 Goto(0)
917 Return
918 End
919};
920
921s32 N(FlipPosOffsets)[] = { 9, 16, 22, 26, 30, 32, 33, 32, 30, 26, 22, 16, 9, 0, 4, 6, 7, 6, 4, 0, 2, 0 };
922
923EvtScript N(EVS_HandleEvent_Koopa) = {
924 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
925 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
926 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0))
927 Call(SetActorYaw, ACTOR_SELF, 0)
928 Call(GetActorVar, ACTOR_SELF, AVAR_HasWhirlwind, LVar0)
929 IfEq(LVar0, TRUE)
930 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, WHIRLWIND_DECOR_IDX)
931 Call(SetActorVar, ACTOR_SELF, AVAR_HasWhirlwind, FALSE)
932 EndIf
933 Call(GetLastEvent, ACTOR_SELF, LVar0)
937 SetConst(LVar0, PRT_MAIN)
938 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Hurt)
942 SetConst(LVar0, PRT_MAIN)
943 SetConst(LVar1, ANIM_KoopaTroopa_Dark_BurnHurt)
944 SetConst(LVar2, ANIM_KoopaTroopa_Dark_BurnStill)
947 SetConst(LVar0, PRT_MAIN)
948 SetConst(LVar1, ANIM_KoopaTroopa_Dark_BurnHurt)
949 SetConst(LVar2, ANIM_KoopaTroopa_Dark_BurnStill)
951 SetConst(LVar0, PRT_MAIN)
952 SetConst(LVar1, ANIM_KoopaTroopa_Dark_BurnStill)
954 Return
956 SetConst(LVar0, PRT_MAIN)
957 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Hurt)
960 SetConst(LVar0, PRT_MAIN)
961 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Hurt)
963 SetConst(LVar0, PRT_MAIN)
964 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Hurt)
966 Return
968 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
970 CaseEq(AVAL_State_Normal)
971 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_ToppledNormal)
972 CaseEq(AVAL_State_Hyper)
973 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_ToppledHyper)
975 Call(SetActorVar, ACTOR_SELF, AVAR_ToppleTurns, 1)
976 Call(SetDefenseTable, ACTOR_SELF, PRT_MAIN, Ref(N(ToppledDefenseTable)))
977 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(ToppledAnims)))
978 Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -5, 15)
979 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0)
980 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE)
981 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Hurt)
982 Call(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0)
983 Thread
984 Wait(4)
985 Call(SetActorRotation, ACTOR_SELF, 0, 0, 30)
986 Wait(1)
987 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
988 Wait(1)
989 Call(SetActorRotation, ACTOR_SELF, 0, 0, -30)
990 Wait(1)
991 Call(SetActorRotation, ACTOR_SELF, 0, 0, -60)
992 Wait(1)
993 Call(SetActorRotation, ACTOR_SELF, 0, 0, -75)
994 Wait(1)
996 UseBuf(N(FlipPosOffsets))
997 Loop(ARRAY_COUNT(N(FlipPosOffsets)))
999 Call(SetActorDispOffset, ACTOR_SELF, 0, LVar0, 0)
1000 Wait(1)
1001 EndLoop
1002 Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
1003 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
1004 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
1005 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ToppleStruggle)
1006 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(0.5))
1008 SetConst(LVar0, PRT_MAIN)
1009 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Hurt)
1011 SetConst(LVar0, PRT_MAIN)
1012 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Hurt)
1014 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
1015 SetConst(LVar0, PRT_MAIN)
1016 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Run)
1018 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.6))
1019 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
1021 SetConst(LVar0, PRT_MAIN)
1022 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Hurt)
1024 SetConst(LVar0, PRT_MAIN)
1025 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Hurt)
1027 Return
1030 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
1031 Switch(LVar0)
1032 CaseOrEq(AVAL_State_Normal)
1033 CaseOrEq(AVAL_State_Hyper)
1034 SetConst(LVar0, PRT_MAIN)
1035 SetConst(LVar1, ANIM_KoopaTroopa_Dark_ShellEnter)
1037 Call(GetStatusFlags, ACTOR_SELF, LVar0)
1039 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit)
1040 Wait(10)
1041 EndIf
1043 CaseOrEq(AVAL_State_ToppledNormal)
1044 CaseOrEq(AVAL_State_ToppledHyper)
1045 SetConst(LVar0, PRT_MAIN)
1046 SetConst(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle)
1049 EndSwitch
1052 SetConst(LVar0, PRT_MAIN)
1053 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Hurt)
1055 Wait(10)
1056 SetConst(LVar0, PRT_MAIN)
1057 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Hurt)
1059 Return
1061 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
1062 IfEq(LVar0, AVAL_State_Normal)
1063 SetConst(LVar0, PRT_MAIN)
1064 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Run)
1066 EndIf
1067 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1068 Call(SetHomePos, ACTOR_SELF, LVar0, LVar1, LVar2)
1069 Call(HPBarToHome, ACTOR_SELF)
1071 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
1072 IfEq(LVar0, AVAL_State_Normal)
1073 SetConst(LVar0, PRT_MAIN)
1074 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Scramble)
1076 EndIf
1078 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
1079 Switch(LVar0)
1080 CaseOrEq(AVAL_State_Normal)
1081 CaseOrEq(AVAL_State_Hyper)
1082 SetConst(LVar0, PRT_MAIN)
1083 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Run)
1084 SetConst(LVar2, ANIM_KoopaTroopa_Dark_Hurt)
1086 Return
1088 CaseOrEq(AVAL_State_ToppledNormal)
1089 CaseOrEq(AVAL_State_ToppledHyper)
1090 SetConst(LVar0, PRT_MAIN)
1091 SetConst(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle)
1094 EndSwitch
1096 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
1097 Switch(LVar0)
1098 CaseOrEq(AVAL_State_Normal)
1099 CaseOrEq(AVAL_State_Hyper)
1100 SetConst(LVar0, PRT_MAIN)
1101 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Panic)
1103 CaseOrEq(AVAL_State_ToppledNormal)
1104 CaseOrEq(AVAL_State_ToppledHyper)
1105 SetConst(LVar0, PRT_MAIN)
1106 SetConst(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle)
1108 EndSwitch
1111 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
1112 Switch(LVar0)
1113 CaseOrEq(AVAL_State_Normal)
1114 CaseOrEq(AVAL_State_Hyper)
1115 SetConst(LVar0, PRT_MAIN)
1116 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Panic)
1118 CaseOrEq(AVAL_State_ToppledNormal)
1119 CaseOrEq(AVAL_State_ToppledHyper)
1120 SetConst(LVar0, PRT_MAIN)
1121 SetConst(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle)
1123 EndSwitch
1125 Return
1127 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
1128 Switch(LVar0)
1129 CaseOrEq(AVAL_State_Normal)
1130 CaseOrEq(AVAL_State_Hyper)
1131 SetConst(LVar0, PRT_MAIN)
1132 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Idle)
1135 CaseOrEq(AVAL_State_ToppledNormal)
1136 CaseOrEq(AVAL_State_ToppledHyper)
1137 SetConst(LVar0, PRT_MAIN)
1138 SetConst(LVar1, ANIM_KoopaTroopa_Dark_ToppleStruggle)
1141 EndSwitch
1142 EndSwitch
1143 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_RESTART)
1144 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1145 Return
1146 End
1147};
1148
1149EvtScript N(EVS_Attack_ShellToss) = {
1150 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
1151 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
1152 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
1153 Call(GetBattlePhase, LVar0)
1155 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin)
1156 Else
1157 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
1158 Call(BattleCamTargetActor, ACTOR_SELF)
1159 Wait(10)
1160 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellEnter)
1161 Wait(10)
1162 Thread
1163 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1164 Add(LVar1, 4)
1165 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0)
1166 Wait(3)
1167 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0)
1168 Wait(2)
1169 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0)
1170 EndThread
1171 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SHELL_SPIN)
1172 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin)
1173 Wait(10)
1174 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
1175 EndIf
1176 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SHELL_TOSS)
1179 Switch(LVar0)
1182 Set(LVarA, LVar0)
1183 Call(SetGoalToTarget, ACTOR_SELF)
1184 Call(GetStatusFlags, ACTOR_SELF, LVar5)
1185 Call(AddGoalPos, ACTOR_SELF, -40, 0, 0)
1186 Call(SetActorSpeed, ACTOR_SELF, Float(16.0))
1187 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
1188 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit)
1189 Wait(8)
1190 Call(ResetAllActorSounds, ACTOR_SELF)
1191 Call(SetActorYaw, ACTOR_SELF, 180)
1192 Wait(4)
1194 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
1195 EndIf
1196 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_BeginPanic1)
1197 Wait(1)
1198 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_BeginPanic2)
1199 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1200 Add(LVar1, 20)
1201 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1202 Call(SetActorJumpGravity, ACTOR_SELF, Float(2.0))
1203 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
1204 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic)
1205 Wait(6)
1206 Sub(LVar1, 20)
1207 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1208 Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE)
1209 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1210 Call(YieldTurn)
1211 Call(SetActorYaw, ACTOR_SELF, 180)
1212 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, SWEAT_DECOR_IDX, ACTOR_DECORATION_SWEAT)
1213 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic)
1214 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1215 Call(SetGoalToHome, ACTOR_SELF)
1216 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
1217 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle)
1218 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, SWEAT_DECOR_IDX)
1219 Call(SetActorYaw, ACTOR_SELF, 0)
1220 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1221 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1222 Return
1224 EndSwitch
1225 Call(SetGoalToTarget, ACTOR_SELF)
1226 Call(SetActorSpeed, ACTOR_SELF, Float(16.0))
1227 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
1228 Call(ResetAllActorSounds, ACTOR_SELF)
1229 Wait(2)
1231 Switch(LVar0)
1234 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1235 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1236 Add(LVar0, 40)
1237 Set(LVar1, 0)
1238 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
1239 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1240 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
1241 Add(LVar0, 30)
1242 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1243 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
1244 Add(LVar0, 20)
1245 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1246 Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE)
1247 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit)
1248 Wait(8)
1249 Call(YieldTurn)
1250 SetConst(LVar0, PRT_MAIN)
1251 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Run)
1253 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Idle)
1255 EndSwitch
1256 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1257 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1258 Return
1259 End
1260};
1261
1262EvtScript N(EVS_Attack_Whirlwind) = {
1263 Label(10)
1264 Call(GetActorVar, ACTOR_SELF, AVAR_HasWhirlwind, LVar0)
1265 Wait(1)
1266 IfEq(LVar0, TRUE)
1267 Goto(10)
1268 EndIf
1269 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
1270 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
1271 Call(SetActorYaw, ACTOR_SELF, 0)
1272 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
1273 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
1274 Call(BattleCamTargetActor, ACTOR_SELF)
1275 Call(SetGoalToTarget, ACTOR_SELF)
1276 Call(GetStatusFlags, ACTOR_SELF, LVar0)
1278 Call(AddGoalPos, ACTOR_SELF, 8, 0, 0)
1279 Else
1280 Call(AddGoalPos, ACTOR_SELF, 20, 0, 0)
1281 EndIf
1282 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Run)
1283 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1284 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
1285 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble)
1286 Wait(10)
1287 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellEnter)
1288 Wait(10)
1289 Thread
1290 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1291 Add(LVar1, 4)
1292 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0)
1293 Wait(3)
1294 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0)
1295 Wait(2)
1296 PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0)
1297 EndThread
1298 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SHELL_SPIN)
1299 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellSpin)
1300 Wait(20)
1301 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_DIZZY_SHELL)
1302 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, WHIRLWIND_DECOR_IDX, ACTOR_DECORATION_WHIRLWIND)
1303 Wait(40)
1305 Switch(LVar0)
1308 Set(LVarA, LVar0)
1309 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit)
1310 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, WHIRLWIND_DECOR_IDX)
1311 Wait(10)
1313 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
1314 EndIf
1315 Wait(10)
1316 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1317 Call(YieldTurn)
1318 Call(SetActorYaw, ACTOR_SELF, 180)
1319 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, SWEAT_DECOR_IDX, ACTOR_DECORATION_SWEAT)
1320 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Panic)
1321 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
1322 Call(SetGoalToHome, ACTOR_SELF)
1323 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
1324 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble)
1325 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, SWEAT_DECOR_IDX)
1326 Call(SetActorYaw, ACTOR_SELF, 0)
1327 Return
1329 EndSwitch
1330 Wait(2)
1331 Call(SetGoalToTarget, ACTOR_SELF)
1333 Switch(LVar0)
1336 Thread
1337 Call(WasStatusInflicted, ACTOR_SELF, LVar0)
1338 IfEq(LVar0, 1)
1339 Call(MakeLerp, 0, 1080, 30, EASING_COS_IN_OUT)
1340 Label(0)
1342 Call(SetActorYaw, ACTOR_PLAYER, LVar0)
1343 Wait(1)
1344 IfEq(LVar1, 1)
1345 Goto(0)
1346 EndIf
1347 EndIf
1348 EndThread
1349 Wait(20)
1350 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ShellExit)
1351 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, WHIRLWIND_DECOR_IDX)
1352 Wait(10)
1353 Wait(10)
1354 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1355 Call(YieldTurn)
1356 SetConst(LVar0, PRT_MAIN)
1357 SetConst(LVar1, ANIM_KoopaTroopa_Dark_Run)
1359 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_Scramble)
1361 EndSwitch
1362 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1363 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1364 Return
1365 End
1366};
1367
1368EvtScript N(EVS_TryGettingUp) = {
1369 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
1370 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
1371 Call(SetActorYaw, ACTOR_SELF, 0)
1372 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
1373 Call(GetActorVar, ACTOR_SELF, AVAR_ToppleTurns, LVar0)
1374 Sub(LVar0, 1)
1375 IfGt(LVar0, 0)
1376 Call(SetActorVar, ACTOR_SELF, AVAR_ToppleTurns, LVar0)
1377 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, SWEAT_DECOR_IDX, ACTOR_DECORATION_SWEAT)
1378 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0))
1379 Wait(30)
1380 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(0.5))
1381 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, SWEAT_DECOR_IDX)
1382 Else
1383 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, SWEAT_DECOR_IDX, ACTOR_DECORATION_SWEAT)
1384 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0))
1385 Wait(20)
1386 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(0.5))
1387 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, SWEAT_DECOR_IDX)
1388 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_NONE, 0)
1389 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_ACTOR_JUMP)
1390 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0))
1391 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_KoopaTroopa_Dark_ToppleStruggle)
1392 Set(LVar0, 0)
1393 Call(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0)
1394 Thread
1395 Loop(5)
1396 Add(LVar0, 15)
1397 Call(SetActorRotation, ACTOR_SELF, 0, 0, LVar0)
1398 Wait(1)
1399 EndLoop
1400 EndThread
1401 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1402 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1403 Call(SetActorJumpGravity, ACTOR_SELF, Float(3.0))
1404 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
1405 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_ACTOR_STEP_A)
1406 Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0)
1407 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
1408 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
1409 Call(SetDefenseTable, ACTOR_SELF, PRT_MAIN, Ref(N(UprightDefenseTable)))
1410 Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 32)
1411 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, -1, -4)
1412 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE)
1413 Call(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP)
1414 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
1415 Switch(LVar0)
1416 CaseEq(AVAL_State_ToppledNormal)
1417 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_Normal)
1418 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(KoopaAnims)))
1419 CaseEq(AVAL_State_ToppledHyper)
1420 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_Hyper)
1421 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(HyperAnims)))
1422 EndSwitch
1423 EndIf
1424 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1425 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1426 Return
1427 End
1428};
1429
1430EvtScript N(EVS_TakeTurn_Koopa) = {
1431 Call(GetBattlePhase, LVar0)
1433 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_Normal)
1434 EndIf
1435 Call(GetActorVar, ACTOR_SELF, AVAR_State, LVar0)
1436 Switch(LVar0)
1437 CaseEq(AVAL_State_Normal)
1438 ExecWait(N(EVS_Attack_ShellToss))
1439 Call(RandInt, 1000, LVar0)
1440 IfLt(LVar0, 300)
1441 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_Normal)
1442 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(KoopaAnims)))
1443 Else
1444 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_Hyper)
1445 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(HyperAnims)))
1446 EndIf
1447 CaseEq(AVAL_State_Hyper)
1448 ExecWait(N(EVS_Attack_Whirlwind))
1449 Call(RandInt, 1000, LVar0)
1450 IfLt(LVar0, 300)
1451 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_Normal)
1452 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(KoopaAnims)))
1453 Else
1454 Call(SetActorVar, ACTOR_SELF, AVAR_State, AVAL_State_Hyper)
1455 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(HyperAnims)))
1456 EndIf
1457 CaseOrEq(AVAL_State_ToppledNormal)
1458 CaseOrEq(AVAL_State_ToppledHyper)
1459 ExecWait(N(EVS_TryGettingUp))
1461 EndSwitch
1462 Return
1463 End
1464};
Bytecode EvtScript[]
#define SWEAT_DECOR_IDX
#define WHIRLWIND_DECOR_IDX
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ BTL_CAM_XADJ_AVG
Definition enums.h:4900
@ ACTOR_SOUND_WALK
Definition enums.h:2034
@ ACTOR_SOUND_FLY
Definition enums.h:2035
@ 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_JUMP
Definition enums.h:2122
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_BLAST
Definition enums.h:2124
@ ELEMENT_SMASH
Definition enums.h:2121
@ ELEMENT_WATER
Definition enums.h:2117
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ACTOR_EVENT_FLAG_GROUNDABLE
Actor can be knocked down from flight; triggered by jump attacks.
Definition enums.h:3382
@ ACTOR_EVENT_FLAG_FLIPABLE
Actor can be flipped; triggered by jump and quake attacks.
Definition enums.h:3380
@ ACTOR_DECORATION_WHIRLWIND
Definition enums.h:2050
@ ACTOR_DECORATION_SWEAT
Definition enums.h:2045
@ PHASE_FIRST_STRIKE
Definition enums.h:2059
@ ENCOUNTER_TRIGGER_HAMMER
Definition enums.h:271
@ 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_ACTOR_TARGET_MIDPOINT
Definition enums.h:4827
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_INTERRUPT
Definition enums.h:4823
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4885
@ SUPPRESS_EVENT_ALL
Definition enums.h:2907
@ EASING_SIN_OUT
Definition enums.h:521
@ EASING_COS_IN_OUT
Definition enums.h:520
@ EASING_LINEAR
Definition enums.h:510
@ IDLE_SCRIPT_RESTART
Definition enums.h:6409
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ STATUS_FLAG_DIZZY
Definition enums.h:2818
@ STATUS_FLAG_SLEEP
Definition enums.h:2812
@ SOUND_NONE
Definition enums.h:547
@ SOUND_PARAGOOMBA_PREDIVE
Definition enums.h:1510
@ SOUND_ACTOR_STEP_A
Definition enums.h:1474
@ SOUND_SHELL_SPIN
Definition enums.h:1342
@ SOUND_FALL_QUICK
Definition enums.h:1090
@ SOUND_SHELL_TOSS
Definition enums.h:1497
@ SOUND_DIZZY_SHELL
Definition enums.h:1346
@ SOUND_ACTOR_JUMP
Definition enums.h:1290
@ SOUND_PARAGOOMBA_DIVE
Definition enums.h:1029
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
Definition enums.h:3329
@ ACTOR_FLAG_TYPE_CHANGED
Indicates actors type has changed, triggers recheck for if HP bar should be shown based on tattle sta...
Definition enums.h:3332
@ ACTOR_FLAG_FLIPPED
Actor has been flipped over.
Definition enums.h:3330
@ 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_BEGIN_FIRST_STRIKE
Definition enums.h:2173
@ EVENT_END_FIRST_STRIKE
Definition enums.h:2171
@ EVENT_IMMUNE
Definition enums.h:2146
@ EVENT_FALL_TRIGGER
Definition enums.h:2134
@ 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_15
Definition enums.h:2137
@ EVENT_AIR_LIFT_FAILED
Definition enums.h:2152
@ EVENT_BEGIN_AIR_LIFT
Definition enums.h:2175
@ EVENT_DEATH
Definition enums.h:2153
@ EVENT_FLIP_TRIGGER
Definition enums.h:2135
@ 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
@ ACTOR_PART_FLAG_NO_SHADOW
Definition enums.h:3352
@ 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
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
Definition enums.h:2880
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
EvtScript EVS_Enemy_ReturnHome
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 UpdateLerp(Evt *script, b32 isInitialCall)
ApiStatus RandInt(Evt *script, b32 isInitialCall)
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
ApiStatus MakeLerp(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 IfGe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR >= RVAR.
Definition macros.h:284
#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 IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define UseBuf(INT_PTR)
Loads a s32 pointer for use with subsequent EVT_BUF_READ commands.
Definition macros.h:389
#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 BufRead1(VAR)
Consumes the next s32 from the buffer and stores it in the given variable.
Definition macros.h:392
#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 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 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 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 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