Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
bow.c
Go to the documentation of this file.
1#include "battle/battle.h"
2#include "script_api/battle.h"
3#include "effects.h"
6#include "sprite/npc/BattleBow.h"
7#include "sprite/player.h"
8
9#define NAMESPACE battle_partner_bow
10
11extern EvtScript N(EVS_HandleEvent);
12extern EvtScript N(EVS_Idle);
13extern EvtScript N(EVS_HandlePhase);
14extern EvtScript N(EVS_TakeTurn);
15extern EvtScript N(EVS_Init);
16extern EvtScript N(EVS_ExecuteAction);
17extern EvtScript N(EVS_Celebrate);
18extern EvtScript N(runAway);
19extern EvtScript N(runAwayFail);
20extern EvtScript N(smack);
21extern EvtScript N(outtaSight);
22extern EvtScript N(spook);
23extern EvtScript N(fanSmack);
24extern EvtScript N(hidePlayer);
25
26extern s32 bMarioHideAnims[];
27
28enum N(ActorPartIDs) {
29 PRT_MAIN = 1,
30 PRT_ZERO = 0,
31};
32
33API_CALLABLE(N(IsOuttaSightActive)) {
34 BattleStatus* battleStatus = &gBattleStatus;
35 script->varTable[0] = battleStatus->outtaSightActive;
36
37 return ApiStatus_DONE2;
38}
39
40API_CALLABLE(N(GetBowSize)) {
41 BattleStatus* battleStatus = &gBattleStatus;
42 Actor* partnerActor = battleStatus->partnerActor;
43 Actor* partnerTargetActor = get_actor(partnerActor->targetActorID);
44 f32 partnerTargetActorSize = (partnerTargetActor->size.y + partnerTargetActor->size.x) / 2;
45
46 partnerTargetActorSize = (partnerTargetActorSize * 150.0f) / 100.0f;
47 script->varTable[0] = partnerTargetActorSize;
48
49 return ApiStatus_DONE2;
50}
51
52API_CALLABLE(N(ApplyOuttaSight)) {
53 ActorPart* playerActorPartTable = gBattleStatus.playerActor->partsTable;
54
58 }
59
60 playerActorPartTable->idleAnimations = bMarioHideAnims;
62 gBattleStatus.flags1 &= ~BS_FLAGS1_HUSTLED;
63
64 return ApiStatus_DONE2;
65}
66
67API_CALLABLE(N(ModifyBowPos)) {
68 BattleStatus* battleStatus = &gBattleStatus;
69 Bytecode* args = script->ptrReadPos;
70 Actor* playerActor = battleStatus->playerActor;
71 f32 deltaX = evt_get_variable(script, *args++);
72 f32 deltaY = evt_get_variable(script, *args++);
73 f32 scalingFactor = playerActor->scalingFactor;
74
75 deltaX *= scalingFactor;
76 script->varTable[0] += deltaX;
77
78 deltaY *= scalingFactor;
79 script->varTable[1] += deltaY;
80
81 return ApiStatus_DONE2;
82}
83
85API_CALLABLE(N(IsPartnerImmobile)) {
86 BattleStatus* battleStatus = &gBattleStatus;
87 Actor* playerActor = battleStatus->playerActor;
88 s32 isImmobile = playerActor->debuff == STATUS_KEY_FEAR
89 || playerActor->debuff == STATUS_KEY_DIZZY
90 || playerActor->debuff == STATUS_KEY_PARALYZE
91 || playerActor->debuff == STATUS_KEY_SLEEP
92 || playerActor->debuff == STATUS_KEY_FROZEN
93 || playerActor->debuff == STATUS_KEY_STOP;
94
95 if (playerActor->stoneStatus == STATUS_KEY_STONE) {
96 isImmobile = TRUE;
97 }
98
99 script->varTable[0] = isImmobile;
100 return ApiStatus_DONE2;
101}
102
103API_CALLABLE(N(RestorePlayerIdleAnimations)) {
104 BattleStatus* battleStatus = &gBattleStatus;
105 Actor* playerActor = battleStatus->playerActor;
106 ActorPart* playerActorPartTable = battleStatus->playerActor->partsTable;
107 playerActorPartTable->idleAnimations = bMarioIdleAnims;
108
109 return ApiStatus_DONE2;
110}
111
112API_CALLABLE(N(AverageSpookChance)) {
113 BattleStatus* battleStatus = &gBattleStatus;
114 Actor* partnerActor = battleStatus->partnerActor;
115 Actor* targetActor;
116 ActorBlueprint* targetActorBlueprint;
117 ActorPart* targetActorPart;
118 s32 spookChance;
119 s32 chanceTotal = 0;
120 s32 nTargets = 0;
121 s32 i;
122
123 for (i = 0; i < partnerActor->targetListLength; i++) {
124 targetActor = get_actor(partnerActor->targetData[i].actorID);
125 targetActorPart = get_actor_part(targetActor, partnerActor->targetData[i].partID);
126 targetActorBlueprint = targetActor->actorBlueprint;
127 spookChance = targetActorBlueprint->spookChance;
128
129 if (targetActor->transparentStatus == STATUS_KEY_TRANSPARENT) {
130 spookChance = 0;
131 }
132
133 if (targetActorPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY) {
134 spookChance = 0;
135 }
136
137 if (spookChance > 0) {
138 chanceTotal += spookChance;
139 nTargets++;
140 }
141 }
142
143 if (nTargets > 0) {
144 script->varTable[0] = chanceTotal / nTargets;
145 } else {
146 script->varTable[0] = 0;
147 }
148
149 return ApiStatus_DONE2;
150}
151
152s32 N(DefaultAnims)[] = {
153 STATUS_KEY_NORMAL, ANIM_BattleBow_Walk,
154 STATUS_KEY_STONE, ANIM_BattleBow_Still,
155 STATUS_KEY_SLEEP, ANIM_BattleBow_Pray,
156 STATUS_KEY_POISON, ANIM_BattleBow_Still,
157 STATUS_KEY_STOP, ANIM_BattleBow_Still,
158 STATUS_KEY_DAZE, ANIM_BattleBow_Injured,
159 STATUS_KEY_INACTIVE, ANIM_BattleBow_Still,
161};
162
163s32 N(DefenseTable)[] = {
166};
167
168s32 N(StatusTable)[] = {
171 STATUS_KEY_SLEEP, 100,
174 STATUS_KEY_DIZZY, 100,
175 STATUS_KEY_FEAR, 100,
179 STATUS_KEY_STOP, 100,
191};
192
193ActorPartBlueprint N(ActorParts)[] = {
194 {
195 .flags = 0,
196 .index = PRT_MAIN,
197 .posOffset = { 0, 0, 0 },
198 .targetOffset = { 9, 19 },
199 .opacity = 255,
200 .idleAnimations = N(DefaultAnims),
201 .defenseTable = N(DefenseTable),
202 .eventFlags = 0,
203 .elementImmunityFlags = 0,
204 .projectileTargetOffset = { 0, 0 },
205 },
206};
207
208ActorBlueprint NAMESPACE = {
209 .flags = ACTOR_FLAG_FLYING,
210 .type = ACTOR_TYPE_BOW,
211 .level = ACTOR_LEVEL_BOW,
212 .maxHP = 99,
213 .partCount = ARRAY_COUNT(N(ActorParts)),
214 .partsData = N(ActorParts),
215 .initScript = &N(EVS_Init),
216 .statusTable = N(StatusTable),
217 .escapeChance = 0,
218 .airLiftChance = 0,
219 .hurricaneChance = 0,
220 .spookChance = 0,
221 .upAndAwayChance = 0,
222 .spinSmashReq = 4,
223 .powerBounceChance = 80,
224 .coinReward = 0,
225 .size = { 36, 29 },
226 .healthBarOffset = { 0, 0 },
227 .statusIconOffset = { -10, 22 },
228 .statusTextOffset = { 10, 22 },
229};
230
231EvtScript N(EVS_Init) = {
232 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
233 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
234 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
235 Call(BindHandlePhase, ACTOR_SELF, Ref(N(EVS_HandlePhase)))
236 Return
237 End
238};
239
240EvtScript N(EVS_Idle) = {
241 Return
242 End
243};
244
245EvtScript N(EVS_HandleEvent) = {
246 Call(UseIdleAnimation, ACTOR_PARTNER, FALSE)
247 Call(CloseActionCommandInfo)
248 Call(GetLastEvent, ACTOR_PARTNER, LVar0)
252 SetConst(LVar1, ANIM_BattleBow_Hurt)
253 SetConst(LVar2, ANIM_BattleBow_Hurt)
255 SetConst(LVar1, ANIM_BattleBow_Hurt)
260 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_NO_DAMGE)
261 SetConst(LVar0, PRT_MAIN)
262 SetConst(LVar1, ANIM_BattleBow_Hurt)
266 SetConst(LVar1, ANIM_BattleBow_Hurt)
267 Set(LVar2, 14)
269 SetConst(LVar1, ANIM_BattleBow_Hurt)
272 SetConst(LVar1, ANIM_BattleBow_BurnHurt)
273 Set(LVar2, 14)
274 SetConst(LVar3, ANIM_BattleBow_BurnStill)
276 SetConst(LVar1, ANIM_BattleBow_Hurt)
279 SetConst(LVar1, ANIM_BattleBow_BurnHurt)
280 SetConst(LVar2, ANIM_BattleBow_BurnStill)
282 SetConst(LVar1, ANIM_BattleBow_Hurt)
285 SetConst(LVar1, ANIM_BattleBow_Hurt)
286 Set(LVar2, 14)
289 SetConst(LVar1, ANIM_BattleBow_Hurt)
292 SetConst(LVar0, PRT_MAIN)
293 SetConst(LVar1, ANIM_BattleBow_Idle)
294 SetConst(LVar2, ANIM_BattleBow_Run)
295 Set(LVar3, 20)
299 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_NO_DAMGE)
300 SetConst(LVar0, PRT_MAIN)
301 SetConst(LVar1, ANIM_BattleBow_Block)
303 Wait(10)
307 Call(UseIdleAnimation, ACTOR_PARTNER, TRUE)
308 Return
309 End
310};
311
312EvtScript N(EVS_TakeTurn) = {
313 Call(GetBattlePhase, LVar0)
316 ExecWait(N(EVS_ExecuteAction))
318 ExecWait(N(EVS_Celebrate))
320 ExecWait(N(runAway))
322 ExecWait(N(runAwayFail))
324 Return
325 End
326};
327
328EvtScript N(EVS_Celebrate) = {
329 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Celebrate)
330 Wait(36)
331 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
332 Return
333 End
334};
335
336EvtScript N(runAway) = {
337 SetConst(LVar0, PRT_MAIN)
338 SetConst(LVar1, ANIM_BattleBow_Run)
340 Return
341 End
342};
343
344EvtScript N(runAwayFail) = {
345 Call(UseIdleAnimation, ACTOR_PARTNER, FALSE)
346 Call(SetGoalToHome, ACTOR_PARTNER)
347 Call(SetActorSpeed, ACTOR_PARTNER, Float(6.0))
348 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Run)
349 Call(SetActorYaw, ACTOR_PARTNER, 0)
350 Call(RunToGoal, ACTOR_PARTNER, 0)
351 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
352 Call(UseIdleAnimation, ACTOR_PARTNER, TRUE)
353 Return
354 End
355};
356
357EvtScript N(EVS_HandlePhase) = {
358 Call(GetBattlePhase, LVar0)
361 Call(N(IsOuttaSightActive))
362 IfNe(LVar0, 0)
363 ExecWait(N(hidePlayer))
364 EndIf
366 Return
367 End
368};
369
370EvtScript N(EVS_ExecuteAction) = {
371 Call(ShowActionHud, TRUE)
372 Call(GetMenuSelection, LVar0, LVar1, LVar2)
375 Call(LoadStarPowerScript)
377 Return
379 Call(GetMenuSelection, LVar0, LVar1, LVar2)
381 CaseEq(MOVE_SMACK1)
382 ExecWait(N(smack))
383 CaseEq(MOVE_SMACK2)
384 ExecWait(N(smack))
385 CaseEq(MOVE_SMACK3)
386 ExecWait(N(smack))
387 CaseEq(MOVE_OUTTA_SIGHT)
388 Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE)
389 ExecWait(N(outtaSight))
390 CaseEq(MOVE_SPOOK)
391 Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE)
392 ExecWait(N(spook))
393 CaseEq(MOVE_FAN_SMACK)
394 ExecWait(N(fanSmack))
396 Return
397 End
398};
399
400EvtScript N(EVS_ReturnHome_Success) = {
401 Call(PartnerYieldTurn)
402 Call(UseBattleCamPreset, BTL_CAM_RETURN_HOME)
403 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_BOO_VANISH_A)
404 Thread
405 Set(LVar0, 200)
406 Loop(20)
407 Sub(LVar0, 10)
408 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
409 Wait(1)
410 EndLoop
412 Wait(10)
413 Call(SetGoalToHome, ACTOR_PARTNER)
414 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Run)
415 Call(FlyToGoal, ACTOR_PARTNER, 30, 0, EASING_COS_IN_OUT)
416 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
417 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_BOO_APPEAR_A)
418 Set(LVar0, 55)
419 Loop(20)
420 Add(LVar0, 10)
421 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
422 Wait(1)
423 EndLoop
424 Call(SetPartAlpha, ACTOR_PARTNER, -1, 255)
425 Return
426 End
427};
428
429EvtScript N(EVS_ReturnHome_Miss) = {
430 Call(PartnerYieldTurn)
431 Call(UseBattleCamPreset, BTL_CAM_PARTNER_MISTAKE)
432 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_BOO_VANISH_A)
433 Thread
434 Set(LVar0, 200)
435 Loop(20)
436 Sub(LVar0, 10)
437 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
438 Wait(1)
439 EndLoop
441 Wait(10)
442 Call(SetGoalToHome, ACTOR_PARTNER)
443 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Run)
444 Call(FlyToGoal, ACTOR_PARTNER, 30, 0, EASING_COS_IN_OUT)
445 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
446 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_BOO_APPEAR_A)
447 Set(LVar0, 55)
448 Loop(20)
449 Add(LVar0, 10)
450 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
451 Wait(1)
452 EndLoop
453 Call(SetPartAlpha, ACTOR_PARTNER, -1, 255)
454 Return
455 End
456};
457
458EvtScript N(80238EE0) = {
459 Call(PartnerYieldTurn)
460 Call(SetGoalToHome, ACTOR_PARTNER)
461 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Run)
462 Call(FlyToGoal, ACTOR_PARTNER, 15, 0, EASING_COS_IN_OUT)
463 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
464 Return
465 End
466};
467
468EvtScript N(smack) = {
469 Call(LoadActionCommand, ACTION_COMMAND_SMACK)
470 Call(action_command_smack_init)
471 Call(SetActionHudPrepareTime, 0)
472 Call(GetMenuSelection, LVar0, LVar1, LVar2)
474 CaseEq(MOVE_SMACK1)
475 Call(SetupMashMeter, 4, 40, 70, 99, 100, 0)
476 Set(LVarB, 60 * DT)
477 Set(LVarC, 1)
478 CaseEq(MOVE_SMACK2)
479 Call(SetupMashMeter, 5, 35, 60, 80, 99, 100)
480 Set(LVarB, 60 * DT)
481 Set(LVarC, 1)
482 CaseEq(MOVE_SMACK3)
483 Call(SetupMashMeter, 5, 35, 60, 80, 99, 100)
484 Set(LVarB, 60 * DT)
485 Set(LVarC, 1)
487 Wait(10)
488 Thread
489 Wait(10)
490 Set(LVar0, LVarB)
491 Add(LVar0, -3)
492 Call(action_command_smack_start, 0, LVar0, 3, 0)
493 Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE)
495 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_BOO_VANISH_A)
496 Call(SetPartAlpha, ACTOR_PARTNER, -1, 55)
497 Call(InitTargetIterator)
498 Call(SetGoalToTarget, ACTOR_PARTNER)
499 Thread
500 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Run)
501 Call(AddGoalPos, ACTOR_PARTNER, -15, -10, 0)
502 Call(FlyToGoal, ACTOR_PARTNER, 15, 0, EASING_COS_IN_OUT)
503 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
505 Call(UseBattleCamPreset, BTL_CAM_ACTOR_CLOSE)
506 Call(BattleCamTargetActor, ACTOR_SELF)
507 Call(SetBattleCamDist, 180)
508 Call(MoveBattleCamOver, 30)
509 Call(SetBattleCamOffsetY, 9)
510 Call(DisableBattleCamClampX)
511 Wait(15)
512 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_BOO_APPEAR_A)
513 Set(LVar0, 55)
514 Loop(5)
515 Add(LVar0, 40)
516 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
517 Wait(1)
518 EndLoop
519 Call(SetPartAlpha, ACTOR_PARTNER, -1, 255)
520 Call(UseBattleCamPresetImmediately, 19)
521 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_PreSlap)
522 Wait(20)
523 Set(LVarF, 0)
524 Set(LVarE, 0)
525 Set(LVarD, 0)
526 Set(LFlag0, FALSE)
527 Call(InitTargetIterator)
528 Call(SetGoalToTarget, ACTOR_SELF)
529 Loop(15)
530 Call(SetActorDispOffset, ACTOR_PARTNER, Float(0.5), 0, 0)
531 Wait(1)
532 Call(SetActorDispOffset, ACTOR_PARTNER, Float(-0.5), 0, 0)
533 Wait(1)
534 EndLoop
535 Call(GetPartnerActionSuccess, LVarB)
536 Call(func_80269600, LVarD)
537 Label(0)
540 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_SlapOnce)
541 Call(CloseActionCommandInfo)
542 Set(LVar0, 0)
543 Loop(20)
544 Add(LVar0, -45)
545 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
546 Wait(1)
547 EndLoop
548 Call(SetActorYaw, ACTOR_PARTNER, 0)
549 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Injured)
550 Call(AddActorDecoration, ACTOR_SELF, PRT_ZERO, 0, ACTOR_DECORATION_SEEING_STARS)
551 Wait(30)
552 Call(RemoveActorDecoration, ACTOR_SELF, PRT_ZERO, 0)
553 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
554 Wait(10)
555 ExecWait(N(EVS_ReturnHome_Miss))
556 Return
557 EndIf
558 Add(LVarE, 1)
560 Goto(2)
561 EndIf
562 Call(SetActorScale, ACTOR_PARTNER, Float(1.4), Float(1.4), Float(1.0))
563 IfEq(LFlag0, FALSE)
564 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_SlapOnce)
565 Set(LFlag0, TRUE)
566 Call(SetDamageSource, DMG_SRC_NEXT_SLAP_LEFT)
567 Else
568 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_SlapBack)
569 Set(LFlag0, FALSE)
570 Call(SetDamageSource, DMG_SRC_NEXT_SLAP_RIGHT)
571 EndIf
572 Wait(2)
573 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
574 Thread
575 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.5))
576 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.5))
577 Call(ShakeCam, CAM_BATTLE, 0, 1, Float(0.5))
578 Call(ShakeCam, CAM_BATTLE, 0, 1, Float(0.2))
580 IfEq(LVarE, 1)
581 Call(N(GetBowSize))
582 Call(AddBattleCamDist, LVar0)
583 Call(MoveBattleCamOver, 5)
584 Else
585 Call(AddBattleCamDist, 25)
586 Call(MoveBattleCamOver, 5)
587 EndIf
589 IfEq(LVarE, 1)
590 IfGt(LVarB, 99)
592 Else
594 EndIf
595 Goto(1)
596 Else
597 IfGt(LVarB, 99)
599 Else
600 Call(PartnerDamageEnemy, LVar0, 0, SUPPRESS_EVENT_SPIKY_TOP | SUPPRESS_EVENT_SPIKY_FRONT, 0, LVarC, 0)
601 EndIf
602 Goto(1)
603 EndIf
604 Label(1)
605 Wait(8)
606 Add(LVarF, 10)
607 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
608 Goto(0)
609 Label(2)
610 IfEq(LVarE, 1)
611 Call(N(GetBowSize))
612 Call(AddBattleCamDist, LVar0)
613 Call(MoveBattleCamOver, 5)
614 Else
615 Call(AddBattleCamDist, 25)
616 Call(MoveBattleCamOver, 5)
617 EndIf
618 Call(SetActorScale, ACTOR_PARTNER, Float(1.4), Float(1.4), Float(1.0))
619 IfEq(LFlag0, FALSE)
620 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_SlapOnce)
621 Set(LFlag0, TRUE)
622 Call(SetDamageSource, DMG_SRC_LAST_SLAP_LEFT)
623 Else
624 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_SlapBack)
625 Set(LFlag0, FALSE)
626 Call(SetDamageSource, DMG_SRC_LAST_SLAP_RIGHT)
627 EndIf
628 Wait(2)
629 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
631 Call(GetPartnerActionSuccess, LVar0)
633 CaseGt(99)
638 Wait(8)
642 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
643 ExecWait(N(EVS_ReturnHome_Miss))
647 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
648 ExecWait(N(EVS_ReturnHome_Success))
651 Return
652 End
653};
654
655EvtScript N(outtaSight) = {
656 Call(SetActorFlagBits, ACTOR_PLAYER, ACTOR_FLAG_NO_INACTIVE_ANIM, TRUE)
657 Call(SetActorFlagBits, ACTOR_PLAYER, ACTOR_FLAG_USING_IDLE_ANIM, FALSE)
658 Call(UseBattleCamPreset, BTL_CAM_REPOSITION)
659 Call(SetBattleCamTarget, -129, 28, 0)
660 Call(SetBattleCamOffsetY, 15)
661 Call(SetBattleCamDist, 260)
662 Call(MoveBattleCamOver, 40)
663 Thread
664 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
665 Add(LVar1, 5)
666 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
667 Call(FlyToGoal, ACTOR_PARTNER, 10, 0, EASING_COS_IN_OUT)
669 Set(LVar0, 0)
670 Loop(10)
671 Add(LVar0, 18)
672 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
673 Wait(1)
674 EndLoop
675 Wait(10)
676 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
677 Add(LVar0, -30)
678 Add(LVar1, 30)
679 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
680 Call(FlyToGoal, ACTOR_PARTNER, 20, 30, EASING_COS_IN_OUT)
681 Thread
682 Set(LVar0, 180)
683 Loop(10)
684 Sub(LVar0, 18)
685 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
686 Wait(1)
687 EndLoop
689 Thread
690 Set(LVar0, 255)
691 Loop(30)
692 Sub(LVar0, 5)
693 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
694 Wait(1)
695 EndLoop
697 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
698 Call(N(ModifyBowPos), -10, 20)
699 Add(LVar2, 5)
700 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
701 Call(FlyToGoal, ACTOR_PARTNER, 20, 0, EASING_LINEAR)
702 Call(N(IsPartnerImmobile))
703 IfEq(LVar0, 0)
704 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Crouch)
705 EndIf
706 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_BOW_VANISH)
707 Set(LVar0, 255)
708 Loop(15)
709 Sub(LVar0, 10)
710 Call(SetPartAlpha, ACTOR_PLAYER, 1, LVar0)
711 Wait(1)
712 EndLoop
713 Wait(15)
714 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
715 Call(MoveBattleCamOver, 30)
716 Call(N(ApplyOuttaSight))
717 Call(SetActorFlagBits, ACTOR_PLAYER, ACTOR_FLAG_NO_INACTIVE_ANIM, FALSE)
718 Return
719 End
720};
721
722EvtScript N(hidePlayer) = {
723 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
724 Wait(20)
725 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_BOW_APPEAR)
726 Thread
727 Wait(10)
728 Set(LVar0, 105)
729 Loop(30)
730 Add(LVar0, 5)
731 Call(SetPartAlpha, ACTOR_PLAYER, 1, LVar0)
732 Wait(1)
733 EndLoop
735 Thread
736 Set(LVar0, 105)
737 Loop(30)
738 Add(LVar0, 5)
739 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
740 Wait(1)
741 EndLoop
743 Call(PartnerYieldTurn)
744 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
745 Call(MoveBattleCamOver, 40)
746 Call(SetGoalToHome, ACTOR_PARTNER)
747 Call(FlyToGoal, ACTOR_PARTNER, 20, 0, EASING_COS_IN_OUT)
748 Call(N(RestorePlayerIdleAnimations))
749 Wait(20)
750 Return
751 End
752};
753
754EvtScript N(spook) = {
755 Call(LoadActionCommand, ACTION_COMMAND_SPOOK)
756 Call(action_command_spook_init)
757 Call(SetupMashMeter, 1, 100, 0, 0, 0, 0)
758 Call(SetActionHudPrepareTime, 20)
759 Wait(10)
760 Thread
761 Call(UseBattleCamPreset, BTL_CAM_ACTOR_FAR)
762 Call(BattleCamTargetActor, ACTOR_SELF)
763 Call(SetBattleCamOffsetY, 4)
764 Call(AddBattleCamDist, -150)
765 Call(MoveBattleCamOver, 20)
766 Call(DisableBattleCamClampX)
768 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
769 Add(LVar0, 40)
770 Add(LVar1, 10)
771 Call(SetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
772 Call(FlyToGoal, ACTOR_PARTNER, 20, 0, EASING_COS_IN_OUT)
773 Wait(15)
774 Call(UseBattleCamPresetImmediately, 19)
775 Thread
776 Wait(74)
777 Loop(8)
778 Call(SetActorDispOffset, ACTOR_PARTNER, 1, 0, 0)
779 Wait(1)
780 Call(SetActorDispOffset, ACTOR_PARTNER, -1, 0, 0)
781 Wait(1)
782 EndLoop
783 Loop(7)
784 Call(SetActorDispOffset, ACTOR_PARTNER, 2, 0, 0)
785 Wait(1)
786 Call(SetActorDispOffset, ACTOR_PARTNER, -2, 0, 0)
787 Wait(1)
788 EndLoop
789 Loop(8)
790 Call(SetActorDispOffset, ACTOR_PARTNER, 3, 0, 0)
791 Wait(1)
792 Call(SetActorDispOffset, ACTOR_PARTNER, -3, 0, 0)
793 Wait(1)
794 EndLoop
795 Call(SetActorDispOffset, ACTOR_PARTNER, 0, 0, 0)
797 Call(N(AverageSpookChance))
798 Call(action_command_spook_start, 0, 87 * DT, 3, LVar0)
799 Call(GetActionQuality, LVar1)
800 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Conceal)
801 Set(LVar1, 0)
802 Set(LVar2, 0)
803 Loop(90 * DT)
805 CaseGt(80)
806 IfEq(LVar2, 7)
807 Call(AddBattleCamDist, -20)
808 Call(MoveBattleCamOver, 20)
809 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_NONE, BTL_CAM_XADJ_NONE, TRUE)
810 Set(LVar2, 8)
811 EndIf
812 CaseGt(70)
813 IfEq(LVar2, 6)
814 Call(AddBattleCamDist, -20)
815 Call(MoveBattleCamOver, 20)
816 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_NONE, BTL_CAM_XADJ_NONE, TRUE)
817 Set(LVar2, 7)
818 EndIf
819 CaseGt(60)
820 IfEq(LVar2, 5)
821 Call(AddBattleCamDist, -20)
822 Call(MoveBattleCamOver, 20)
823 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_NONE, BTL_CAM_XADJ_NONE, TRUE)
824 Set(LVar2, 6)
825 EndIf
826 CaseGt(50)
827 IfEq(LVar2, 4)
828 Call(AddBattleCamDist, -20)
829 Call(MoveBattleCamOver, 20)
830 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_NONE, BTL_CAM_XADJ_NONE, TRUE)
831 Set(LVar2, 5)
832 EndIf
833 CaseGt(40)
834 IfEq(LVar2, 3)
835 Call(AddBattleCamDist, -20)
836 Call(MoveBattleCamOver, 20)
837 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_NONE, BTL_CAM_XADJ_NONE, TRUE)
838 Set(LVar2, 4)
839 EndIf
840 CaseGt(30)
841 IfEq(LVar2, 2)
842 Call(AddBattleCamDist, -20)
843 Call(MoveBattleCamOver, 20)
844 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_NONE, BTL_CAM_XADJ_NONE, TRUE)
845 Set(LVar2, 3)
846 EndIf
847 CaseGt(20)
848 IfEq(LVar2, 1)
849 Call(AddBattleCamDist, -20)
850 Call(MoveBattleCamOver, 20)
851 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_NONE, BTL_CAM_XADJ_NONE, TRUE)
852 Set(LVar2, 2)
853 EndIf
854 CaseGt(10)
855 IfEq(LVar2, 0)
856 Call(AddBattleCamDist, -20)
857 Call(MoveBattleCamOver, 20)
858 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_NONE, BTL_CAM_XADJ_NONE, TRUE)
859 Set(LVar2, 1)
860 EndIf
862 Add(LVar1, 1)
863 Wait(1)
864 EndLoop
865 Call(SetActorDispOffset, ACTOR_PARTNER, 0, 0, 0)
866 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_SpookLoop)
867 Call(SetActorRotationOffset, ACTOR_SELF, 0, 12, 0)
868 Thread
869 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
870 Call(MoveBattleCamOver, 5)
871 Wait(5)
872 Call(UseBattleCamPreset, BTL_CAM_INTERRUPT)
873 Loop(5)
874 Call(SetBattleCamParam, CAM_PARAM_FOV_SCALE, 110)
875 Wait(2)
876 Call(SetBattleCamParam, CAM_PARAM_FOV_SCALE, 100)
877 Wait(2)
878 EndLoop
880 Thread
881 Set(LVar0, 255)
882 Loop(15)
883 Sub(LVar0, 10)
884 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
885 Wait(1)
886 EndLoop
888 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_BOW_SPOOK)
889 SetF(LVar0, Float(1.0))
890 Call(GetActionQuality, LVar2)
892 CaseLe(20)
893 SetF(LVar1, Float(0.3))
894 CaseLe(40)
895 SetF(LVar1, Float(0.4))
896 CaseLe(60)
897 SetF(LVar1, Float(0.5))
898 CaseLe(80)
899 SetF(LVar1, Float(0.6))
901 SetF(LVar1, Float(0.7))
903 Loop(5)
905 Call(SetActorScale, ACTOR_PARTNER, LVar0, LVar0, LVar0)
906 Wait(1)
907 EndLoop
909 Thread
910 Loop(5)
911 Loop(3)
912 SubF(LVar0, Float(0.23))
913 Call(SetActorScale, ACTOR_PARTNER, LVar0, LVar0, LVar0)
914 Wait(1)
915 EndLoop
916 Loop(3)
917 AddF(LVar0, Float(0.23))
918 Call(SetActorScale, ACTOR_PARTNER, LVar0, LVar0, LVar0)
919 Wait(1)
920 EndLoop
921 EndLoop
923 Call(GetActorPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
924 Add(LVar1, 32)
925 PlayEffect(EFFECT_ENERGY_IN_OUT, 6, LVar0, LVar1, LVar2, Float(1.8), 45, 0)
926 PlayEffect(EFFECT_ENERGY_IN_OUT, 6, LVar0, LVar1, LVar2, Float(1.0), 45, 0)
927 Wait(15)
928 Call(InitTargetIterator)
929 Call(GetActionQuality, LVarF)
930 Loop(0)
931 Call(SetGoalToTarget, ACTOR_SELF)
933 IfEq(LVar0, 6)
934 Goto(10)
935 EndIf
936 Call(SetDamageSource, DMG_SRC_SPOOK)
938 CaseGt(99)
943 Label(10)
944 Wait(5)
945 Call(ChooseNextTarget, ITER_NEXT, LVar0)
948 EndIf
949 EndLoop
950 Call(GetPartnerActionSuccess, LVar0)
952 CaseGt(99)
953 Call(UseBattleCamPreset, BTL_CAM_RETURN_HOME)
955 Call(UseBattleCamPreset, BTL_CAM_PARTNER_MISTAKE)
957 Wait(30)
958 Thread
959 Set(LVar0, 105)
960 Loop(15)
961 Add(LVar0, 10)
962 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
963 Wait(1)
964 EndLoop
966 Call(GetActionQuality, LVar2)
968 CaseLe(20)
969 SetF(LVar1, Float(0.3))
970 CaseLe(40)
971 SetF(LVar1, Float(0.4))
972 CaseLe(60)
973 SetF(LVar1, Float(0.5))
974 CaseLe(80)
975 SetF(LVar1, Float(0.6))
977 SetF(LVar1, Float(0.7))
980 Loop(5)
982 Call(SetActorScale, ACTOR_PARTNER, LVar0, LVar0, LVar0)
983 Wait(1)
984 EndLoop
985 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
986 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
987 ExecWait(N(80238EE0))
988 Return
989 End
990};
991
992EvtScript N(fanSmack) = {
993 Call(LoadActionCommand, ACTION_COMMAND_SMACK)
994 Call(action_command_smack_init)
995 Call(SetActionHudPrepareTime, 0)
996 Call(SetupMashMeter, 5, 35, 60, 80, 99, 100)
997 Set(LVarB, 90 * DT)
998 Set(LVarC, 2)
999 Wait(10)
1000 Thread
1001 Wait(10)
1002 Set(LVar0, LVarB)
1003 Add(LVar0, -3)
1004 Call(action_command_smack_start, 0, LVar0, 3, 1)
1005 Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE)
1006 EndThread
1007 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_BOO_VANISH_A)
1008 Call(SetPartAlpha, ACTOR_PARTNER, -1, 55)
1009 Call(InitTargetIterator)
1010 Call(SetGoalToTarget, ACTOR_PARTNER)
1011 Thread
1012 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Run)
1013 Call(AddGoalPos, ACTOR_PARTNER, -25, -10, 0)
1014 Call(FlyToGoal, ACTOR_PARTNER, 15, 0, EASING_COS_IN_OUT)
1015 EndThread
1016 Call(UseBattleCamPreset, BTL_CAM_ACTOR_CLOSE)
1017 Call(BattleCamTargetActor, ACTOR_SELF)
1018 Call(SetBattleCamDist, 180)
1019 Call(MoveBattleCamOver, 30)
1020 Call(SetBattleCamOffsetY, 9)
1021 Call(DisableBattleCamClampX)
1022 Wait(15)
1023 Call(PlaySoundAtActor, ACTOR_PARTNER, SOUND_BOO_APPEAR_A)
1024 Set(LVar0, 55)
1025 Loop(5)
1026 Add(LVar0, 40)
1027 Call(SetPartAlpha, ACTOR_PARTNER, -1, LVar0)
1028 Wait(1)
1029 EndLoop
1030 Call(SetPartAlpha, ACTOR_PARTNER, -1, 255)
1031 Call(UseBattleCamPresetImmediately, 19)
1032 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Celebrate)
1033 Wait(20)
1034 Set(LVarF, 0)
1035 Set(LVarE, 0)
1036 Set(LVarD, 0)
1037 Set(LFlag0, FALSE)
1038 Call(InitTargetIterator)
1039 Call(SetGoalToTarget, ACTOR_SELF)
1040 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_CelebrateFast)
1041 Loop(30)
1042 Call(SetActorDispOffset, ACTOR_PARTNER, Float(0.5), 0, 0)
1043 Wait(1)
1044 Call(SetActorDispOffset, ACTOR_PARTNER, Float(-0.5), 0, 0)
1045 Wait(1)
1046 EndLoop
1047 Call(GetPartnerActionSuccess, LVarB)
1048 Call(func_80269600, LVarD)
1049 Label(0)
1052 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_FanSmackOnce)
1053 Call(CloseActionCommandInfo)
1054 Set(LVar0, 0)
1055 Loop(15)
1056 Add(LVar0, -45)
1057 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
1058 Wait(1)
1059 EndLoop
1060 Loop(15)
1061 Add(LVar0, -90)
1062 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
1063 Wait(1)
1064 EndLoop
1065 Call(SetActorYaw, ACTOR_PARTNER, 0)
1066 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Injured)
1067 Call(AddActorDecoration, ACTOR_SELF, PRT_ZERO, 0, ACTOR_DECORATION_SEEING_STARS)
1068 Wait(40)
1069 Call(RemoveActorDecoration, ACTOR_SELF, PRT_ZERO, 0)
1070 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
1071 Wait(10)
1072 ExecWait(N(EVS_ReturnHome_Miss))
1073 Return
1074 EndIf
1075 Add(LVarE, 1)
1076 IfGt(LVarE, LVarD)
1077 Goto(2)
1078 EndIf
1079 Call(SetActorScale, ACTOR_PARTNER, Float(1.4), Float(1.4), Float(1.0))
1080 IfEq(LFlag0, FALSE)
1081 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_FanSmackOnce)
1082 Set(LFlag0, TRUE)
1083 Call(SetDamageSource, DMG_SRC_NEXT_FAN_SMACK_LEFT)
1084 Else
1085 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_FanSmackBack)
1086 Set(LFlag0, FALSE)
1087 Call(SetDamageSource, DMG_SRC_NEXT_FAN_SMACK_RIGHT)
1088 EndIf
1089 Wait(2)
1090 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
1091 Thread
1092 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.5))
1093 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.5))
1094 Call(ShakeCam, CAM_BATTLE, 0, 1, Float(0.5))
1095 Call(ShakeCam, CAM_BATTLE, 0, 1, Float(0.2))
1096 EndThread
1097 IfEq(LVarE, 1)
1098 Call(N(GetBowSize))
1099 Call(AddBattleCamDist, LVar0)
1100 Call(MoveBattleCamOver, 5)
1101 Else
1102 Call(AddBattleCamDist, 25)
1103 Call(MoveBattleCamOver, 5)
1104 EndIf
1105 Call(GetGoalPos, ACTOR_PARTNER, LVar0, LVar1, LVar2)
1106 PlayEffect(EFFECT_CONFETTI, 5, LVar0, LVar1, LVar2, Float(1.0), 20, 0)
1108 IfEq(LVarE, 1)
1109 IfGt(LVarB, 99)
1111 Else
1113 EndIf
1114 Goto(1)
1115 Else
1116 IfGt(LVarB, 99)
1118 Else
1120 EndIf
1121 Goto(1)
1122 EndIf
1123 Label(1)
1124 IfEq(LVarE, 1)
1125 Set(LVar0, 0)
1126 Loop(8)
1127 Add(LVar0, 144)
1128 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
1129 Wait(1)
1130 EndLoop
1131 Else
1132 Set(LVar0, 0)
1133 Loop(8)
1134 Sub(LVar0, 144)
1135 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
1136 Wait(1)
1137 EndLoop
1138 EndIf
1139 Call(SetActorYaw, ACTOR_PARTNER, 0)
1140 Add(LVarF, 10)
1141 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
1142 Goto(0)
1143 Label(2)
1144 Thread
1145 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.5))
1146 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.5))
1147 Call(ShakeCam, CAM_BATTLE, 0, 1, Float(0.5))
1148 Call(ShakeCam, CAM_BATTLE, 0, 1, Float(0.2))
1149 EndThread
1150 IfEq(LVarE, 1)
1151 Call(N(GetBowSize))
1152 Call(AddBattleCamDist, LVar0)
1153 Call(MoveBattleCamOver, 5)
1154 Else
1155 Call(AddBattleCamDist, 25)
1156 Call(MoveBattleCamOver, 5)
1157 EndIf
1158 Call(SetActorScale, ACTOR_PARTNER, Float(1.4), Float(1.4), Float(1.0))
1159 IfEq(LFlag0, FALSE)
1160 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_FanSmackOnce)
1161 Set(LFlag0, TRUE)
1162 Call(SetDamageSource, DMG_SRC_LAST_FAN_SMACK_LEFT)
1163 Else
1164 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_FanSmackBack)
1165 Set(LFlag0, FALSE)
1166 Call(SetDamageSource, DMG_SRC_LAST_FAN_SMACK_RIGHT)
1167 EndIf
1168 Wait(2)
1169 Call(SetActorScale, ACTOR_PARTNER, Float(1.0), Float(1.0), Float(1.0))
1171 Call(GetPartnerActionSuccess, LVar0)
1172 Switch(LVar0)
1173 CaseGt(99)
1177 EndSwitch
1178 Thread
1179 IfEq(LVarE, 1)
1180 Set(LVar0, 0)
1181 Loop(8)
1182 Add(LVar0, 144)
1183 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
1184 Wait(1)
1185 EndLoop
1186 Else
1187 Set(LVar0, 0)
1188 Loop(8)
1189 Sub(LVar0, 144)
1190 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
1191 Wait(1)
1192 EndLoop
1193 EndIf
1194 IfEq(LVarE, 1)
1195 Set(LVar0, 0)
1196 Loop(8)
1197 Add(LVar0, 72)
1198 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
1199 Wait(1)
1200 EndLoop
1201 Else
1202 Set(LVar0, 0)
1203 Loop(8)
1204 Sub(LVar0, 72)
1205 Call(SetActorYaw, ACTOR_PARTNER, LVar0)
1206 Wait(1)
1207 EndLoop
1208 EndIf
1209 Call(SetActorYaw, ACTOR_PARTNER, 0)
1210 EndThread
1211 Switch(LVar0)
1214 Wait(10)
1215 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
1216 ExecWait(N(EVS_ReturnHome_Miss))
1218 CaseOrEq(1)
1219 CaseOrEq(3)
1220 Wait(10)
1221 Call(SetAnimation, ACTOR_PARTNER, -1, ANIM_BattleBow_Idle)
1222 ExecWait(N(EVS_ReturnHome_Success))
1224 EndSwitch
1225 Return
1226 End
1227};
1228
s32 bMarioHideAnims[]
Definition actors.c:99
u32 * idleAnimations
s8 transparentStatus
struct ActorBlueprint * actorBlueprint
f32 scalingFactor
struct ActorPart * partsTable
struct SelectableTarget targetData[24]
s16 targetActorID
Vec2bu size
Bytecode EvtScript[]
s8 targetListLength
@ BTL_CAM_XADJ_NONE
Definition enums.h:4899
@ ACTION_COMMAND_SPOOK
Definition enums.h:3493
@ ACTION_COMMAND_SMACK
Definition enums.h:3490
@ ACTOR_SOUND_HURT
Definition enums.h:2037
@ BS_FLAGS1_NO_RATING
Definition enums.h:3577
@ 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
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ITER_NO_MORE
Definition enums.h:2030
@ ITER_NEXT
Definition enums.h:2025
@ ACTOR_EVENT_FLAG_ILLUSORY
Player attacks pass through and miss.
Definition enums.h:3374
@ ACTOR_DECORATION_SEEING_STARS
Definition enums.h:2046
@ PHASE_RUN_AWAY_START
Definition enums.h:2060
@ PHASE_EXECUTE_ACTION
Definition enums.h:2058
@ PHASE_ENEMY_BEGIN
Definition enums.h:2068
@ PHASE_CELEBRATE
Definition enums.h:2062
@ PHASE_RUN_AWAY_FAIL
Definition enums.h:2064
@ BTL_MENU_TYPE_STAR_POWERS
Definition enums.h:4235
@ BS_FLAGS2_PLAYER_TURN_USED
Definition enums.h:3605
@ 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_TRANSPARENT
Definition enums.h:2210
@ 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_KEY_INACTIVE
Definition enums.h:2214
@ 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_DAZE
Definition enums.h:2209
@ STATUS_KEY_DEFAULT
Definition enums.h:2198
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1952
@ HIT_RESULT_HIT
Definition enums.h:1950
@ HIT_RESULT_NICE_NO_DAMAGE
Definition enums.h:1953
@ HIT_RESULT_NICE
Definition enums.h:1951
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_RETURN_HOME
Definition enums.h:4826
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_INTERRUPT
Definition enums.h:4823
@ BTL_CAM_REPOSITION
Definition enums.h:4841
@ BTL_CAM_ACTOR_CLOSE
Definition enums.h:4835
@ BTL_CAM_ACTOR_FAR
Definition enums.h:4837
@ BTL_CAM_PARTNER_MISTAKE
Definition enums.h:4873
@ SUPPRESS_EVENT_SPIKY_TOP
Definition enums.h:2900
@ SUPPRESS_EVENT_ALT_SPIKY
Definition enums.h:2905
@ SUPPRESS_EVENT_SPIKY_FRONT
Definition enums.h:2902
@ SUPPRESS_EVENT_BURN_CONTACT
Definition enums.h:2904
@ EASING_COS_IN_OUT
Definition enums.h:520
@ EASING_LINEAR
Definition enums.h:510
@ STATUS_FLAG_400000
Definition enums.h:2822
@ DMG_SRC_NEXT_SLAP_RIGHT
Definition enums.h:1999
@ DMG_SRC_LAST_SLAP_RIGHT
Definition enums.h:2001
@ DMG_SRC_NEXT_FAN_SMACK_LEFT
Definition enums.h:2002
@ DMG_SRC_LAST_FAN_SMACK_LEFT
Definition enums.h:2004
@ DMG_SRC_NEXT_SLAP_LEFT
Definition enums.h:1998
@ DMG_SRC_NEXT_FAN_SMACK_RIGHT
Definition enums.h:2003
@ DMG_SRC_SPOOK
Definition enums.h:2006
@ DMG_SRC_LAST_SLAP_LEFT
Definition enums.h:2000
@ DMG_SRC_LAST_FAN_SMACK_RIGHT
Definition enums.h:2005
@ SOUND_NO_DAMGE
Definition enums.h:1433
@ SOUND_BOW_APPEAR
Definition enums.h:1324
@ SOUND_BOW_SMACK
Definition enums.h:1334
@ SOUND_BOO_VANISH_A
Definition enums.h:692
@ SOUND_BOW_SPOOK
Definition enums.h:1008
@ SOUND_BOW_FAN_SMACK
Definition enums.h:1335
@ SOUND_BOO_APPEAR_A
Definition enums.h:694
@ SOUND_BOW_VANISH
Definition enums.h:1323
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_PARTNER
Definition enums.h:2086
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
Definition enums.h:3329
@ ACTOR_FLAG_NO_INACTIVE_ANIM
Definition enums.h:3345
@ ACTOR_FLAG_USING_IDLE_ANIM
Definition enums.h:3342
@ CAM_PARAM_FOV_SCALE
Definition enums.h:1816
@ BTL_CAM_YADJ_NONE
Definition enums.h:4906
@ EVENT_HIT
Definition enums.h:2132
@ EVENT_33
Definition enums.h:2169
@ EVENT_BURN_HIT
Definition enums.h:2136
@ EVENT_SPIKE_CONTACT
Definition enums.h:2163
@ EVENT_IMMUNE
Definition enums.h:2146
@ EVENT_ZERO_DAMAGE
Definition enums.h:2144
@ EVENT_BLOCK
Definition enums.h:2147
@ EVENT_18
Definition enums.h:2145
@ EVENT_HIT_COMBO
Definition enums.h:2131
@ EVENT_RECOVER_FROM_KO
Definition enums.h:2170
@ EVENT_SHOCK_HIT
Definition enums.h:2165
@ EVENT_BURN_CONTACT
Definition enums.h:2164
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
Definition enums.h:2880
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
@ DAMAGE_TYPE_MULTIPLE_POPUPS
Definition enums.h:2879
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
ActorPart * get_actor_part(Actor *actor, s32 partID)
Definition 190B20.c:1191
Actor * get_actor(s32 actorID)
Definition actor_api.c:155
EvtScript EVS_Partner_Hit
EvtScript EVS_Partner_Recover
EvtScript EVS_Partner_BurnContact
EvtScript EVS_Partner_Drop
EvtScript EVS_Partner_NoDamageHit
EvtScript EVS_Partner_ShockHit
EvtScript EVS_Partner_BurnHit
EvtScript EVS_Partner_SpikeContact
EvtScript EVS_Partner_RunAway
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#define 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 AddF(VAR, FLOAT_VALUE)
Definition macros.h:383
#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 LVarF
Definition macros.h:163
#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 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 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 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 CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
Definition macros.h:337
#define LVarB
Definition macros.h:159
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define BreakLoop
Breaks out of the innermost loop.
Definition macros.h:251
#define Thread
Marks the start of a thread block.
Definition macros.h:544
#define CaseLe(RVAR)
Marks the start of a switch case that executes only if LVAR > RVAR. It also marks the end of any prev...
Definition macros.h:331
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#define SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
Definition macros.h:373
#define LVar2
Definition macros.h:150
#define DT
Definition macros.h:522
#define LVar1
Definition macros.h:149
#define LFlag0
Definition macros.h:167
#define LVarD
Definition macros.h:161
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define SubF(VAR, FLOAT_VALUE)
Definition macros.h:384
#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 CaseGt(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:328
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar3
Definition macros.h:151
#define LVarE
Definition macros.h:162
#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
struct Actor * partnerActor
struct Actor * playerActor
BattleStatus gBattleStatus
Definition battle.c:11
u32 bMarioIdleAnims[]
Definition actors.c:53