Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
swoopula.inc.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "effects.h"
4#include "sprite/npc/Swooper.h"
5#include "sprite/player.h"
7
8#define NAMESPACE A(swoopula)
9
10extern s32 N(CeilingAnims)[];
11extern EvtScript N(EVS_Init);
12extern EvtScript N(EVS_Idle);
13extern EvtScript N(EVS_TakeTurn);
14extern EvtScript N(EVS_HandleEvent);
15
16enum N(ActorPartIDs) {
17 PRT_MAIN = 1,
18};
19
20enum N(ActorVars) {
21 AVAR_IN_SnapToIndexPos = 0, // -1 = no, 0 = yes
22 AVAR_IsFlying = 8, // false when attached to ceiling
23};
24
25enum N(ActorParams) {
26 DMG_LEECH = 2,
27 MAX_LEECH_COUNT = 5,
28};
29
30s32 N(DefenseTable)[] = {
33};
34
35s32 N(StatusTable)[] = {
58};
59
60ActorPartBlueprint N(ActorParts)[] = {
61 {
63 .index = PRT_MAIN,
64 .posOffset = { 0, 0, 0 },
65 .targetOffset = { 0, 29 },
66 .opacity = 255,
67 .idleAnimations = N(CeilingAnims),
68 .defenseTable = N(DefenseTable),
69 .eventFlags = 0,
70 .elementImmunityFlags = 0,
71 .projectileTargetOffset = { 1, 15 },
72 },
73};
74
75ActorBlueprint NAMESPACE = {
77 .type = ACTOR_TYPE_SWOOPULA,
78 .level = ACTOR_LEVEL_SWOOPULA,
79 .maxHP = 8,
80 .partCount = ARRAY_COUNT(N(ActorParts)),
81 .partsData = N(ActorParts),
82 .initScript = &N(EVS_Init),
83 .statusTable = N(StatusTable),
84 .escapeChance = 30,
85 .airLiftChance = 95,
86 .hurricaneChance = 95,
87 .spookChance = 70,
88 .upAndAwayChance = 95,
89 .spinSmashReq = 0,
90 .powerBounceChance = 80,
91 .coinReward = 1,
92 .size = { 31, 24 },
93 .healthBarOffset = { 0, 0 },
94 .statusIconOffset = { -10, -20 },
95 .statusTextOffset = { 10, -20 },
96};
97
98s32 N(CeilingAnims)[] = {
99 STATUS_KEY_NORMAL, ANIM_Swooper_Gray_Anim0C,
100 STATUS_KEY_STONE, ANIM_Swooper_Gray_Anim0B,
101 STATUS_KEY_SLEEP, ANIM_Swooper_Gray_Anim0F,
102 STATUS_KEY_POISON, ANIM_Swooper_Gray_Anim0C,
103 STATUS_KEY_STOP, ANIM_Swooper_Gray_Anim0B,
104 STATUS_KEY_STATIC, ANIM_Swooper_Gray_Anim0C,
105 STATUS_KEY_PARALYZE, ANIM_Swooper_Gray_Anim0B,
106 STATUS_KEY_DIZZY, ANIM_Swooper_Gray_Anim10,
107 STATUS_KEY_FEAR, ANIM_Swooper_Gray_Anim10,
109};
110
111s32 N(FlyingAnims)[] = {
112 STATUS_KEY_NORMAL, ANIM_Swooper_Gray_Anim02,
113 STATUS_KEY_STONE, ANIM_Swooper_Gray_Anim01,
114 STATUS_KEY_SLEEP, ANIM_Swooper_Gray_Anim13,
115 STATUS_KEY_POISON, ANIM_Swooper_Gray_Anim02,
116 STATUS_KEY_STOP, ANIM_Swooper_Gray_Anim01,
117 STATUS_KEY_STATIC, ANIM_Swooper_Gray_Anim02,
118 STATUS_KEY_PARALYZE, ANIM_Swooper_Gray_Anim01,
119 STATUS_KEY_DIZZY, ANIM_Swooper_Gray_Anim14,
120 STATUS_KEY_FEAR, ANIM_Swooper_Gray_Anim14,
122};
123
124EvtScript N(EVS_Init) = {
125 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
126 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
127 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
128 Call(SetActorVar, ACTOR_SELF, AVAR_IsFlying, 0)
129 Return
130 End
131};
132
133EvtScript N(EVS_Idle) = {
134 Return
135 End
136};
137
138EvtScript N(EVS_ReturnHome) = {
139 Call(GetActorVar, ACTOR_SELF, AVAR_IsFlying, LVar0)
141 CaseEq(0)
142 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
143 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
144 Call(SetGoalToHome, ACTOR_SELF)
145 Call(AddGoalPos, ACTOR_SELF, 0, -24, 0)
146 Call(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT)
147 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_UPSIDE_DOWN, TRUE)
148 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(CeilingAnims)))
149 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim0C)
150 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
151 Add(LVar1, 24)
152 Call(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
153 Call(HPBarToHome, ACTOR_SELF)
154 CaseEq(1)
155 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
156 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
157 Call(SetGoalToHome, ACTOR_SELF)
158 Call(FlyToGoal, ACTOR_SELF, 0, 1, EASING_SIN_OUT)
160 Return
161 End
162};
163
164EvtScript N(EVS_Flying_HandleEvent) = {
165 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
166 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
167 Call(GetLastEvent, ACTOR_SELF, LVar0)
171 SetConst(LVar0, PRT_MAIN)
172 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
176 SetConst(LVar0, PRT_MAIN)
177 SetConst(LVar1, ANIM_Swooper_Gray_Anim17)
178 SetConst(LVar2, ANIM_Swooper_Gray_Anim18)
181 SetConst(LVar0, PRT_MAIN)
182 SetConst(LVar1, ANIM_Swooper_Gray_Anim17)
183 SetConst(LVar2, ANIM_Swooper_Gray_Anim18)
185 SetConst(LVar0, PRT_MAIN)
186 SetConst(LVar1, ANIM_Swooper_Gray_Anim18)
188 Return
190 Call(func_80269470)
191 SetConst(LVar0, PRT_MAIN)
192 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
194 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
195 ExecWait(N(EVS_ReturnHome))
197 Call(func_80269470)
198 SetConst(LVar0, PRT_MAIN)
199 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
201 Thread
202 Wait(30)
203 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
205 SetConst(LVar0, PRT_MAIN)
206 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
208 Return
212 SetConst(LVar0, PRT_MAIN)
213 SetConst(LVar1, ANIM_Swooper_Gray_Anim02)
217 SetConst(LVar0, PRT_MAIN)
218 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
220 Wait(10)
221 SetConst(LVar0, PRT_MAIN)
222 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
224 Return
226 SetConst(LVar0, PRT_MAIN)
227 SetConst(LVar1, ANIM_Swooper_Gray_Anim02)
230 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, FALSE)
231 SetConst(LVar0, PRT_MAIN)
232 SetConst(LVar1, ANIM_Swooper_Gray_Anim02)
233 SetConst(LVar2, ANIM_Swooper_Gray_Anim15)
235 Return
237 SetConst(LVar0, PRT_MAIN)
238 SetConst(LVar1, ANIM_Swooper_Gray_Anim02)
241 SetConst(LVar0, PRT_MAIN)
242 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
244 Return
246 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
247 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
248 Return
249 End
250};
251
252#include "common/battle/SetAbsoluteStatusOffsets.inc.c"
253
254EvtScript N(EVS_FallFromCeiling) = {
255 Call(HideHealthBar, ACTOR_SELF)
256 Call(GetLastDamage, ACTOR_SELF, LVar0)
257 IfLe(LVar0, 0)
258 Return
259 EndIf
260 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_UPSIDE_DOWN, FALSE)
261 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
262 Call(SetActorDispOffset, ACTOR_SELF, 0, 0, 0)
263 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
264 Sub(LVar1, 24)
265 Call(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
266 Call(GetActorVar, ACTOR_SELF, AVAR_IN_SnapToIndexPos, LVarA)
267 IfEq(LVarA, -1)
268 Call(SetHomePos, ACTOR_SELF, LVar0, 45, LVar2)
269 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.8))
270 Call(SetGoalToHome, ACTOR_SELF)
271 Call(JumpToGoal, ACTOR_SELF, 15, FALSE, FALSE, FALSE)
272 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE)
273 Else
274 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.8))
275 Call(SetGoalPos, ACTOR_SELF, LVar0, 45, LVar2)
276 Call(JumpToGoal, ACTOR_SELF, 15, FALSE, FALSE, FALSE)
277 Call(GetIndexFromPos, ACTOR_SELF, LVarA)
278 Mod(LVarA, 4)
279 Add(LVarA, 4)
280 Call(SetGoalToIndex, ACTOR_SELF, LVarA)
281 Call(GetGoalPos, ACTOR_SELF, LVarA, LVarB, LVarC)
282 Call(SetHomePos, ACTOR_SELF, LVarA, LVarB, LVarC)
283 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.8))
284 Call(SetGoalToHome, ACTOR_SELF)
285 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE)
286 EndIf
287 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -10)
288 Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 22)
289 Call(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20)
290 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(FlyingAnims)))
291 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, TRUE)
292 Call(HPBarToHome, ACTOR_SELF)
293 Call(SetActorVar, ACTOR_SELF, AVAR_IsFlying, 1)
294 Return
295 End
296};
297
298EvtScript N(EVS_HandleEvent) = {
299 Call(GetActorVar, ACTOR_SELF, AVAR_IsFlying, LVar0)
300 IfEq(LVar0, 1)
301 ExecWait(N(EVS_Flying_HandleEvent))
302 Return
303 EndIf
304 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
305 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
306 Call(GetLastEvent, ACTOR_SELF, LVar0)
309 Call(GetBattlePhase, LVar0)
311 SetConst(LVar0, PRT_MAIN)
312 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
314 Else
315 SetConst(LVar0, PRT_MAIN)
316 SetConst(LVar1, ANIM_Swooper_Gray_Anim0E)
318 EndIf
320 Call(GetBattlePhase, LVar0)
322 SetConst(LVar0, PRT_MAIN)
323 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
325 Else
326 SetConst(LVar0, PRT_MAIN)
327 SetConst(LVar1, ANIM_Swooper_Gray_Anim0E)
329 ExecWait(N(EVS_FallFromCeiling))
330 EndIf
332 Call(GetBattlePhase, LVar0)
334 SetConst(LVar0, PRT_MAIN)
335 SetConst(LVar1, ANIM_Swooper_Gray_Anim17)
336 SetConst(LVar2, ANIM_Swooper_Gray_Anim18)
338 Else
339 SetConst(LVar0, PRT_MAIN)
340 SetConst(LVar1, ANIM_Swooper_Gray_Anim11)
341 SetConst(LVar2, ANIM_Swooper_Gray_Anim12)
343 ExecWait(N(EVS_FallFromCeiling))
344 EndIf
346 Call(GetBattlePhase, LVar0)
348 SetConst(LVar0, PRT_MAIN)
349 SetConst(LVar1, ANIM_Swooper_Gray_Anim17)
350 SetConst(LVar2, ANIM_Swooper_Gray_Anim18)
352 SetConst(LVar0, PRT_MAIN)
353 SetConst(LVar1, ANIM_Swooper_Gray_Anim18)
355 Else
356 SetConst(LVar0, PRT_MAIN)
357 SetConst(LVar1, ANIM_Swooper_Gray_Anim11)
358 SetConst(LVar2, ANIM_Swooper_Gray_Anim12)
360 SetConst(LVar0, PRT_MAIN)
361 SetConst(LVar1, ANIM_Swooper_Gray_Anim12)
363 EndIf
364 Return
366 Call(func_80269470)
367 SetConst(LVar0, PRT_MAIN)
368 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
370 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
371 ExecWait(N(EVS_ReturnHome))
373 Call(func_80269470)
374 SetConst(LVar0, PRT_MAIN)
375 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
377 Thread
378 Wait(30)
379 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
381 SetConst(LVar0, PRT_MAIN)
382 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
384 Return
387 SetConst(LVar0, PRT_MAIN)
388 SetConst(LVar1, ANIM_Swooper_Gray_Anim0C)
392 Call(GetBattlePhase, LVar0)
394 SetConst(LVar0, PRT_MAIN)
395 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
397 Wait(10)
398 SetConst(LVar0, PRT_MAIN)
399 SetConst(LVar1, ANIM_Swooper_Gray_Anim15)
401 Else
402 SetConst(LVar0, PRT_MAIN)
403 SetConst(LVar1, ANIM_Swooper_Gray_Anim0E)
405 Wait(10)
406 SetConst(LVar0, PRT_MAIN)
407 SetConst(LVar1, ANIM_Swooper_Gray_Anim0E)
409 EndIf
410 Return
412 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_UPSIDE_DOWN, FALSE)
413 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(FlyingAnims)))
414 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
415 Call(SetActorPos, ACTOR_SELF, 20, 0, 0)
416 Call(HPBarToCurrent, ACTOR_SELF)
418 ExecWait(N(EVS_ReturnHome))
419 Call(HPBarToHome, ACTOR_SELF)
422 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLYING, TRUE)
423 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_UPSIDE_DOWN, FALSE)
424 Call(SetActorDispOffset, ACTOR_SELF, 0, -24, 0)
425 SetConst(LVar0, PRT_MAIN)
426 SetConst(LVar1, ANIM_Swooper_Gray_Anim02)
427 SetConst(LVar2, ANIM_Swooper_Gray_Anim15)
429 Return
431 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
432 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
433 Return
434 End
435};
436
437#include "common/SpawnEnemyDrainFX.inc.c"
438
439EvtScript N(EVS_Flying_TakeTurn) = {
440 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
441 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
442 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
443 Call(GetBattlePhase, LVar0)
445 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
446 Call(SetGoalToTarget, ACTOR_SELF)
447 Call(AddGoalPos, ACTOR_SELF, 50, 10, 0)
448 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
449 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
450 Call(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
451 Else
452 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
453 Call(BattleCamTargetActor, ACTOR_SELF)
454 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
455 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
456 Call(SetGoalToTarget, ACTOR_SELF)
457 Call(AddGoalPos, ACTOR_SELF, 50, 10, 0)
458 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
459 Call(FlyToGoal, ACTOR_SELF, 0, -4, EASING_LINEAR)
460 EndIf
465 Set(LVarA, LVar0)
466 Wait(10)
467 Call(SetActorSpeed, ACTOR_SELF, Float(5.0))
468 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
469 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim06)
470 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
471 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
472 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE)
473 Call(SetGoalToTarget, ACTOR_SELF)
474 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
475 Sub(LVar0, 50)
476 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
477 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
478 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim06)
479 Call(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR)
480 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(10.0))
481 Wait(15)
482 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0))
484 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
485 EndIf
486 Call(YieldTurn)
487 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
488 Call(SetActorYaw, ACTOR_SELF, 180)
489 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
490 ExecWait(N(EVS_ReturnHome))
491 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
492 Call(SetActorYaw, ACTOR_SELF, 0)
493 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
494 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
495 Return
498 Call(GetStatusFlags, ACTOR_SELF, LVar0)
500 Set(LFlag0, FALSE)
501 Else
502 Set(LFlag0, TRUE)
503 EndIf
505 Wait(10)
506 Call(SetActorSpeed, ACTOR_SELF, Float(5.0))
507 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
508 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim06)
509 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
510 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
511 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, FALSE, FALSE)
512 Call(SetGoalToTarget, ACTOR_SELF)
513 Call(AddGoalPos, ACTOR_SELF, -4, -8, -15)
514 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
515 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim06)
516 Call(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR)
517 IfEq(LFlag0, TRUE)
519 Return
520 EndIf
521 Call(GetStatusFlags, ACTOR_PLAYER, LVar0)
523 Wait(10)
524 Loop(2)
525 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
526 Wait(21)
527 Loop(2)
528 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_LEECH)
529 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
530 Wait(1)
531 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
532 Wait(1)
533 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
534 Wait(1)
535 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
536 Wait(1)
537 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
538 Wait(1)
539 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
540 Wait(1)
541 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
542 Wait(1)
543 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
544 Wait(1)
545 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
546 Wait(1)
547 EndLoop
548 Wait(5)
549 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
550 Wait(1)
551 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
552 Wait(1)
553 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
554 Wait(1)
555 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
556 Wait(1)
557 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
558 Wait(2)
559 Call(SetActorScale, ACTOR_SELF, Float(0.6), Float(1.6), Float(1.0))
560 Wait(10)
561 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
562 Wait(2)
563 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, DMG_LEECH, BS_FLAGS1_NICE_HIT)
564 Wait(30)
565 EndLoop
566 Else
567 Call(ShowMessageBox, BTL_MSG_ACTION_TIP_MASH_BUTTON, 32767)
568 Call(ShowActionHud, TRUE)
569 Call(LoadActionCommand, ACTION_COMMAND_STOP_LEECH)
570 Call(action_command_stop_leech_init)
571 Call(SetupMashMeter, 1, 30, 0, 0, 0, 0)
572 Wait(10)
573 Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE)
574 Call(action_command_stop_leech_start, 0, 32767, 3)
575 Set(LVarD, 0)
576 Loop(MAX_LEECH_COUNT)
577 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
578 Set(LFlag0, FALSE)
579 Loop(21)
580 Call(GetActionSuccessCopy, LVar1)
581 IfEq(LVar1, 1)
582 Set(LFlag0, TRUE)
584 EndIf
585 Wait(1)
586 EndLoop
587 IfEq(LFlag0, TRUE)
588 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
590 EndIf
591 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
592 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Leeching)
593 Loop(2)
594 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_LEECH)
595 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
596 Set(LFlag0, FALSE)
597 Loop(1)
598 Call(GetActionSuccessCopy, LVar1)
599 IfEq(LVar1, 1)
600 Set(LFlag0, TRUE)
602 EndIf
603 Wait(1)
604 EndLoop
605 IfEq(LFlag0, TRUE)
606 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
608 EndIf
609 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
610 Set(LFlag0, FALSE)
611 Loop(1)
612 Call(GetActionSuccessCopy, LVar1)
613 IfEq(LVar1, 1)
614 Set(LFlag0, TRUE)
616 EndIf
617 Wait(1)
618 EndLoop
619 IfEq(LFlag0, TRUE)
620 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
622 EndIf
623 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
624 Set(LFlag0, FALSE)
625 Loop(1)
626 Call(GetActionSuccessCopy, LVar1)
627 IfEq(LVar1, 1)
628 Set(LFlag0, TRUE)
630 EndIf
631 Wait(1)
632 EndLoop
633 IfEq(LFlag0, TRUE)
634 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
636 EndIf
637 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
638 Set(LFlag0, FALSE)
639 Loop(1)
640 Call(GetActionSuccessCopy, LVar1)
641 IfEq(LVar1, 1)
642 Set(LFlag0, TRUE)
644 EndIf
645 Wait(1)
646 EndLoop
647 IfEq(LFlag0, TRUE)
648 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
650 EndIf
651 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
652 Set(LFlag0, FALSE)
653 Loop(1)
654 Call(GetActionSuccessCopy, LVar1)
655 IfEq(LVar1, 1)
656 Set(LFlag0, TRUE)
658 EndIf
659 Wait(1)
660 EndLoop
661 IfEq(LFlag0, TRUE)
662 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
664 EndIf
665 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
666 Set(LFlag0, FALSE)
667 Loop(1)
668 Call(GetActionSuccessCopy, LVar1)
669 IfEq(LVar1, 1)
670 Set(LFlag0, TRUE)
672 EndIf
673 Wait(1)
674 EndLoop
675 IfEq(LFlag0, TRUE)
676 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
678 EndIf
679 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
680 Set(LFlag0, FALSE)
681 Loop(1)
682 Call(GetActionSuccessCopy, LVar1)
683 IfEq(LVar1, 1)
684 Set(LFlag0, TRUE)
686 EndIf
687 Wait(1)
688 EndLoop
689 IfEq(LFlag0, TRUE)
690 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
692 EndIf
693 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
694 Set(LFlag0, FALSE)
695 Loop(1)
696 Call(GetActionSuccessCopy, LVar1)
697 IfEq(LVar1, 1)
698 Set(LFlag0, TRUE)
700 EndIf
701 Wait(1)
702 EndLoop
703 IfEq(LFlag0, TRUE)
704 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
706 EndIf
707 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
708 Set(LFlag0, FALSE)
709 Loop(1)
710 Call(GetActionSuccessCopy, LVar1)
711 IfEq(LVar1, 1)
712 Set(LFlag0, TRUE)
714 EndIf
715 Wait(1)
716 EndLoop
717 IfEq(LFlag0, TRUE)
718 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
720 EndIf
721 EndLoop
722 IfEq(LFlag0, TRUE)
724 EndIf
725 Set(LFlag0, FALSE)
726 Loop(5)
727 Call(GetActionSuccessCopy, LVar1)
728 IfEq(LVar1, 1)
729 Set(LFlag0, TRUE)
731 EndIf
732 Wait(1)
733 EndLoop
734 IfEq(LFlag0, TRUE)
735 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
737 EndIf
738 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_LEECH)
739 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
740 Set(LFlag0, FALSE)
741 Loop(1)
742 Call(GetActionSuccessCopy, LVar1)
743 IfEq(LVar1, 1)
744 Set(LFlag0, TRUE)
746 EndIf
747 Wait(1)
748 EndLoop
749 IfEq(LFlag0, TRUE)
750 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
752 EndIf
753 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
754 Set(LFlag0, FALSE)
755 Loop(1)
756 Call(GetActionSuccessCopy, LVar1)
757 IfEq(LVar1, 1)
758 Set(LFlag0, TRUE)
760 EndIf
761 Wait(1)
762 EndLoop
763 IfEq(LFlag0, TRUE)
764 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
766 EndIf
767 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
768 Set(LFlag0, FALSE)
769 Loop(1)
770 Call(GetActionSuccessCopy, LVar1)
771 IfEq(LVar1, 1)
772 Set(LFlag0, TRUE)
774 EndIf
775 Wait(1)
776 EndLoop
777 IfEq(LFlag0, TRUE)
778 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
780 EndIf
781 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
782 Set(LFlag0, FALSE)
783 Loop(1)
784 Call(GetActionSuccessCopy, LVar1)
785 IfEq(LVar1, 1)
786 Set(LFlag0, TRUE)
788 EndIf
789 Wait(1)
790 EndLoop
791 IfEq(LFlag0, TRUE)
792 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
794 EndIf
795 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
796 Set(LFlag0, FALSE)
797 Loop(2)
798 Call(GetActionSuccessCopy, LVar1)
799 IfEq(LVar1, 1)
800 Set(LFlag0, TRUE)
802 EndIf
803 Wait(1)
804 EndLoop
805 IfEq(LFlag0, TRUE)
806 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
808 EndIf
809 Call(SetActorScale, ACTOR_SELF, Float(0.6), Float(1.6), Float(1.0))
810 Set(LFlag0, FALSE)
811 Loop(10)
812 Call(GetActionSuccessCopy, LVar1)
813 IfEq(LVar1, 1)
814 Set(LFlag0, TRUE)
816 EndIf
817 Wait(1)
818 EndLoop
819 IfEq(LFlag0, TRUE)
820 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
822 EndIf
823 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
824 Set(LFlag0, FALSE)
825 Loop(2)
826 Call(GetActionSuccessCopy, LVar1)
827 IfEq(LVar1, 1)
828 Set(LFlag0, TRUE)
830 EndIf
831 Wait(1)
832 EndLoop
833 IfEq(LFlag0, TRUE)
834 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
836 EndIf
837 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
839 Call(GetLastDamage, ACTOR_PLAYER, LVar3)
840 IfNe(LVar3, 0)
841 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_RECOVER_HEART)
842 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HEART_BOUNCE)
843 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
844 Add(LVar1, 15)
845 Call(N(SpawnDrainHealthStartFX), LVar0, LVar1, LVar2, LVar3)
846 Thread
847 Wait(15)
848 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_STAR_BOUNCE_A)
849 Call(N(SpawnDrainHealthContinueFX), LVar0, LVar1, LVar2, LVar3)
851 Add(LVar0, 20)
852 Add(LVar1, 20)
853 PlayEffect(EFFECT_RECOVER, 0, LVar0, LVar1, LVar2, LVar3, 0)
854 Call(GetActorHP, ACTOR_SELF, LVar0)
855 Add(LVar0, LVar3)
856 Call(SetEnemyHP, ACTOR_SELF, LVar0)
857 Else
858 Add(LVarD, 1)
859 IfGt(LVarD, 1)
860 Call(func_80269470)
862 EndIf
863 EndIf
864 Call(GetPlayerHP, LVar1)
865 IfEq(LVar1, 0)
866 Call(func_80269470)
868 EndIf
869 Set(LFlag0, FALSE)
870 Loop(30)
871 Call(GetActionSuccessCopy, LVar1)
872 IfEq(LVar1, 1)
873 Set(LFlag0, TRUE)
875 EndIf
876 Wait(1)
877 EndLoop
878 IfEq(LFlag0, TRUE)
880 EndIf
881 EndLoop
882 Call(func_80269470)
883 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
884 EndIf
885 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
886 Call(SetGoalToTarget, ACTOR_SELF)
887 Call(AddGoalPos, ACTOR_SELF, 50, 10, 0)
888 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
889 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
890 Call(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR)
891 Wait(10)
892 Call(YieldTurn)
893 ExecWait(N(EVS_ReturnHome))
894 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
895 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
896 Return
897 End
898};
899
900EvtScript N(EVS_TakeTurn) = {
901 Call(GetActorVar, ACTOR_SELF, AVAR_IsFlying, LVar0)
902 IfEq(LVar0, 1)
903 ExecWait(N(EVS_Flying_TakeTurn))
904 Return
905 EndIf
906 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
907 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
908 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
909 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
910 Call(BattleCamTargetActor, ACTOR_SELF)
911 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
912 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
913 Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_UPSIDE_DOWN, FALSE)
914 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
915 Sub(LVar1, 24)
916 Call(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
921 Set(LVarA, LVar0)
922 Wait(10)
923 Call(SetActorSpeed, ACTOR_SELF, Float(5.0))
924 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
925 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim06)
926 Call(SetGoalToTarget, ACTOR_SELF)
927 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
928 Call(AddGoalPos, ACTOR_SELF, -50, 0, 0)
929 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
930 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim06)
931 Call(FlyToGoal, ACTOR_SELF, 0, -40, EASING_LINEAR)
932 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(10.0))
933 Wait(15)
934 Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0))
936 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
937 EndIf
938 Call(YieldTurn)
939 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
940 Call(SetActorYaw, ACTOR_SELF, 180)
941 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
942 ExecWait(N(EVS_ReturnHome))
943 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
944 Call(SetActorYaw, ACTOR_SELF, 0)
945 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
946 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
947 Return
950 Call(GetStatusFlags, ACTOR_SELF, LVar0)
952 Set(LFlag0, FALSE)
953 Else
954 Set(LFlag0, TRUE)
955 EndIf
957 Wait(10)
958 Call(SetActorSpeed, ACTOR_SELF, Float(5.0))
959 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
960 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim06)
961 Call(SetGoalToTarget, ACTOR_SELF)
962 Call(AddGoalPos, ACTOR_SELF, -4, -8, -15)
963 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
964 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim06)
965 Call(FlyToGoal, ACTOR_SELF, 0, -40, EASING_LINEAR)
966 IfEq(LFlag0, TRUE)
968 Return
969 EndIf
970 Call(GetStatusFlags, ACTOR_PLAYER, LVar0)
972 Wait(10)
973 Loop(2)
974 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
975 Wait(21)
976 Loop(2)
977 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_LEECH)
978 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
979 Wait(1)
980 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
981 Wait(1)
982 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
983 Wait(1)
984 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
985 Wait(1)
986 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
987 Wait(1)
988 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
989 Wait(1)
990 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
991 Wait(1)
992 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
993 Wait(1)
994 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
995 Wait(1)
996 EndLoop
997 Wait(5)
998 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_LEECH)
999 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
1000 Wait(1)
1001 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
1002 Wait(1)
1003 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
1004 Wait(1)
1005 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
1006 Wait(1)
1007 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
1008 Wait(2)
1009 Call(SetActorScale, ACTOR_SELF, Float(0.6), Float(1.6), Float(1.0))
1010 Wait(10)
1011 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
1012 Wait(2)
1013 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_IGNORE_DEFENSE, 0, 0, 2, BS_FLAGS1_NICE_HIT)
1014 Wait(30)
1015 EndLoop
1016 Else
1017 Call(ShowMessageBox, BTL_MSG_ACTION_TIP_MASH_BUTTON, 32767)
1018 Call(ShowActionHud, TRUE)
1019 Call(LoadActionCommand, ACTION_COMMAND_STOP_LEECH)
1020 Call(action_command_stop_leech_init)
1021 Call(SetupMashMeter, 1, 30, 0, 0, 0, 0)
1022 Wait(10)
1023 Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE)
1024 Call(action_command_stop_leech_start, 0, 32767, 3)
1025 Set(LVarD, 0)
1026 Loop(MAX_LEECH_COUNT)
1027 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
1028 Set(LFlag0, FALSE)
1029 Loop(21)
1030 Call(GetActionSuccessCopy, LVar1)
1031 IfEq(LVar1, 1)
1032 Set(LFlag0, TRUE)
1033 BreakLoop
1034 EndIf
1035 Wait(1)
1036 EndLoop
1037 IfEq(LFlag0, TRUE)
1038 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1039 BreakLoop
1040 EndIf
1041 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Leeching)
1042 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
1043 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_LEECH)
1044 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
1045 Set(LFlag0, FALSE)
1046 Loop(1)
1047 Call(GetActionSuccessCopy, LVar1)
1048 IfEq(LVar1, 1)
1049 Set(LFlag0, TRUE)
1050 BreakLoop
1051 EndIf
1052 Wait(1)
1053 EndLoop
1054 IfEq(LFlag0, TRUE)
1055 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1056 BreakLoop
1057 EndIf
1058 Call(SetActorScale, ACTOR_SELF, Float(0.9), Float(1.2), Float(1.0))
1059 Set(LFlag0, FALSE)
1060 Loop(1)
1061 Call(GetActionSuccessCopy, LVar1)
1062 IfEq(LVar1, 1)
1063 Set(LFlag0, TRUE)
1064 BreakLoop
1065 EndIf
1066 Wait(1)
1067 EndLoop
1068 IfEq(LFlag0, TRUE)
1069 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1070 BreakLoop
1071 EndIf
1072 Call(SetActorScale, ACTOR_SELF, Float(0.8), Float(1.3), Float(1.0))
1073 Set(LFlag0, FALSE)
1074 Loop(1)
1075 Call(GetActionSuccessCopy, LVar1)
1076 IfEq(LVar1, 1)
1077 Set(LFlag0, TRUE)
1078 BreakLoop
1079 EndIf
1080 Wait(1)
1081 EndLoop
1082 IfEq(LFlag0, TRUE)
1083 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1084 BreakLoop
1085 EndIf
1086 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.4), Float(1.0))
1087 Set(LFlag0, FALSE)
1088 Loop(1)
1089 Call(GetActionSuccessCopy, LVar1)
1090 IfEq(LVar1, 1)
1091 Set(LFlag0, TRUE)
1092 BreakLoop
1093 EndIf
1094 Wait(1)
1095 EndLoop
1096 IfEq(LFlag0, TRUE)
1097 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1098 BreakLoop
1099 EndIf
1100 Call(SetActorScale, ACTOR_SELF, Float(0.7), Float(1.5), Float(1.0))
1101 Set(LFlag0, FALSE)
1102 Loop(2)
1103 Call(GetActionSuccessCopy, LVar1)
1104 IfEq(LVar1, 1)
1105 Set(LFlag0, TRUE)
1106 BreakLoop
1107 EndIf
1108 Wait(1)
1109 EndLoop
1110 IfEq(LFlag0, TRUE)
1111 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1112 BreakLoop
1113 EndIf
1114 Call(SetActorScale, ACTOR_SELF, Float(0.6), Float(1.6), Float(1.0))
1115 Set(LFlag0, FALSE)
1116 Loop(10)
1117 Call(GetActionSuccessCopy, LVar1)
1118 IfEq(LVar1, 1)
1119 Set(LFlag0, TRUE)
1120 BreakLoop
1121 EndIf
1122 Wait(1)
1123 EndLoop
1124 IfEq(LFlag0, TRUE)
1125 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1126 BreakLoop
1127 EndIf
1128 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
1129 Set(LFlag0, FALSE)
1130 Loop(2)
1131 Call(GetActionSuccessCopy, LVar1)
1132 IfEq(LVar1, 1)
1133 Set(LFlag0, TRUE)
1134 BreakLoop
1135 EndIf
1136 Wait(1)
1137 EndLoop
1138 IfEq(LFlag0, TRUE)
1139 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1140 BreakLoop
1141 EndIf
1142 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
1144 Call(GetLastDamage, ACTOR_PLAYER, LVar3)
1145 IfNe(LVar3, 0)
1146 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_RECOVER_HEART)
1147 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HEART_BOUNCE)
1148 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
1149 Add(LVar1, 15)
1150 Call(N(SpawnDrainHealthStartFX), LVar0, LVar1, LVar2, LVar3)
1151 Thread
1152 Wait(15)
1153 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_STAR_BOUNCE_A)
1154 Call(N(SpawnDrainHealthContinueFX), LVar0, LVar1, LVar2, LVar3)
1155 EndThread
1156 Add(LVar0, 20)
1157 Add(LVar1, 20)
1158 PlayEffect(EFFECT_RECOVER, 0, LVar0, LVar1, LVar2, LVar3, 0)
1159 Call(GetActorHP, ACTOR_SELF, LVar0)
1160 Add(LVar0, LVar3)
1161 Call(SetEnemyHP, ACTOR_SELF, LVar0)
1162 Else
1163 Add(LVarD, 1)
1164 IfGt(LVarD, 1)
1165 Call(func_80269470)
1166 BreakLoop
1167 EndIf
1168 EndIf
1169 Call(GetPlayerHP, LVar1)
1170 IfEq(LVar1, 0)
1171 Call(func_80269470)
1172 BreakLoop
1173 EndIf
1174 Set(LFlag0, FALSE)
1175 Loop(35)
1176 Call(GetActionSuccessCopy, LVar1)
1177 IfEq(LVar1, 1)
1178 Set(LFlag0, TRUE)
1179 BreakLoop
1180 EndIf
1181 Wait(1)
1182 EndLoop
1183 IfEq(LFlag0, TRUE)
1184 BreakLoop
1185 EndIf
1186 EndLoop
1187 Call(func_80269470)
1188 Call(SetActorScale, ACTOR_SELF, Float(1.0), Float(1.0), Float(1.0))
1189 EndIf
1190 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
1191 Call(SetGoalToTarget, ACTOR_SELF)
1192 Call(AddGoalPos, ACTOR_SELF, 50, 10, 0)
1193 Call(SetActorSpeed, ACTOR_SELF, Float(8.0))
1194 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Swooper_Gray_Anim02)
1195 Call(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR)
1196 Wait(10)
1197 Call(YieldTurn)
1198 ExecWait(N(EVS_ReturnHome))
1199 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1200 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1201 Return
1202 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
1203 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
1204 Return
1205 End
1206};
Bytecode EvtScript[]
@ BTL_CAM_XADJ_AVG
Definition enums.h:4900
@ ACTION_COMMAND_STOP_LEECH
Definition enums.h:3478
@ 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
@ BS_FLAGS1_4000
Definition enums.h:3583
@ BTL_MSG_ACTION_TIP_MASH_BUTTON
Definition enums.h:4108
@ 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_HIT_STATIC
Definition enums.h:1957
@ HIT_RESULT_LUCKY
Definition enums.h:1955
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4885
@ EASING_SIN_OUT
Definition enums.h:521
@ EASING_LINEAR
Definition enums.h:510
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ STATUS_FLAG_STATIC
Definition enums.h:2813
@ STATUS_FLAG_STONE
Definition enums.h:2820
@ SOUND_STAR_BOUNCE_A
Definition enums.h:975
@ SOUND_RECOVER_HEART
Definition enums.h:1406
@ SOUND_LEECH
Definition enums.h:1288
@ SOUND_HEART_BOUNCE
Definition enums.h:925
@ 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_UPSIDE_DOWN
HP bar offset below actor (e.g. Swooper when upside-down).
Definition enums.h:3331
@ 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_BURN_DEATH
Definition enums.h:2157
@ EVENT_ZERO_DAMAGE
Definition enums.h:2144
@ EVENT_SHOCK_DEATH
Definition enums.h:2159
@ 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
@ DAMAGE_TYPE_UNBLOCKABLE
Definition enums.h:2875
@ DAMAGE_TYPE_IGNORE_DEFENSE
Definition enums.h:2877
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
EvtScript EVS_Enemy_ScareAway
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_ShockHit_Impl
EvtScript EVS_Enemy_ShockHit
EvtScript EVS_Enemy_AirLift
EvtScript EVS_Enemy_BlowAway
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#define Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:319
#define 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 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 LVarC
Definition macros.h:160
#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 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 LVarB
Definition macros.h:159
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define IfLe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR > RVAR.
Definition macros.h:281
#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 LFlag0
Definition macros.h:167
#define LVarA
Definition macros.h:158
#define LVarD
Definition macros.h:161
#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 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