From 6e07fb5c73298ee2bd5a7034a093cb3444ad22c3 Mon Sep 17 00:00:00 2001 From: Ethan Date: Fri, 17 May 2024 15:04:06 +0900 Subject: [PATCH] wip --- src/battle/area/iwa/area.c | 1256 +++++++++++++++++ src/battle/area/iwa/iwa_01_funcs.c | 14 + src/battle/area/iwa/iwa_02_funcs.c | 14 + src/battle/area/iwa/more_funcs.c | 17 + src/battle/area/iwa/whacka_funcs.c | 14 + src/battle/common/actor/cleft.inc.c | 140 +- src/battle/common/actor/monty_mole.inc.c | 122 +- src/battle/common/actor/whacka.inc.c | 67 +- src/battle/common/actor/whacka2.inc.c | 310 ++++ src/battle/common/stage/area_iwa/iwa_01.inc.c | 2 +- src/battle/common/stage/area_iwa/iwa_02.inc.c | 2 +- ver/us/splat.yaml | 21 +- 12 files changed, 1794 insertions(+), 185 deletions(-) create mode 100644 src/battle/area/iwa/iwa_01_funcs.c create mode 100644 src/battle/area/iwa/iwa_02_funcs.c create mode 100644 src/battle/area/iwa/more_funcs.c create mode 100644 src/battle/area/iwa/whacka_funcs.c create mode 100644 src/battle/common/actor/whacka2.inc.c diff --git a/src/battle/area/iwa/area.c b/src/battle/area/iwa/area.c index 9cd0569046..b6ef45f661 100644 --- a/src/battle/area/iwa/area.c +++ b/src/battle/area/iwa/area.c @@ -110,3 +110,1259 @@ StageList A(Stages) = { STAGE("iwa_02", A(iwa_02)), {}, }; + +#include "battle/common/actor/cleft.inc.c" + +#include "battle/common/actor/monty_mole.inc.c" + + +// BUZZAR + +#include "sprite/npc/Buzzar.h" +#include "battle/action_cmd/break_free.h" +#include "battle/action_cmd/whirlwind.h" +#include "sprite/player.h" + +#define NAMESPACE A(buzzar) + +API_CALLABLE(N(StartRumbleWithParams)); + +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_HandleEvent); +extern EvtScript N(EVS_HandlePhase); +extern EvtScript N(EVS_Attack_WindBlast); +extern EvtScript N(EVS_Attack_FeatherFling); +extern EvtScript N(EVS_Attack_GrappleDrop); +extern EvtScript N(EVS_Attack_ClawSwipe); +extern EvtScript N(EVS_FlyToHome); +extern EvtScript N(EVS_FlyToHome_GrappleFail); +extern EvtScript N(EVS_FlyToHome_Impl); +extern EvtScript N(EVS_FlyToHome_GrappleFail_Impl); +extern EvtScript N(EVS_DummyHit); + +enum N(ActorPartIDs) { + PRT_MAIN = 1, + PRT_TARGET = 2, + PRT_FEATHER_1 = 3, + PRT_FEATHER_2 = 4, + PRT_FEATHER_3 = 5, +}; + +enum N(ActorVars) { + AVAR_NextMove = 0, + AVAL_Move_WindBlast = 0, + AVAL_Move_GrappleThenSwipe = 1, + AVAL_Move_ClawSwipe = 2, + AVAL_Move_GrappleThenFling = 3, + AVAL_Move_FlingFeather = 4, + AVAL_Move_GrappleThenWind = 5, + AVAR_Unused_1 = 1, + AVAR_Unused_2 = 2, + AVAR_Unused_3 = 3, +}; + +enum N(ActorParams) { + DMG_FEATHER = 2, + DMG_SWIPE = 3, + DMG_DROP = 4, +}; + +s32 N(DefaultAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Buzzar_Anim01, + STATUS_KEY_STONE, ANIM_Buzzar_Anim00, + STATUS_KEY_SLEEP, ANIM_Buzzar_Anim19, + STATUS_KEY_STOP, ANIM_Buzzar_Anim00, + STATUS_KEY_STATIC, ANIM_Buzzar_Anim0C, + STATUS_KEY_PARALYZE, ANIM_Buzzar_Anim0C, + STATUS_KEY_DIZZY, ANIM_Buzzar_Anim0C, + STATUS_KEY_SHRINK, ANIM_Buzzar_Anim01, + STATUS_END, +}; + +s32 N(FeatherAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Buzzar_Anim14, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 60, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 70, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 70, + STATUS_KEY_SHRINK, 75, + STATUS_KEY_STOP, 70, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, -1, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 1, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, -1, + STATUS_TURN_MOD_SHRINK, -1, + STATUS_TURN_MOD_STOP, -1, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_NO_TARGET, + .index = PRT_MAIN, + .posOffset = { 0, 0, 0 }, + .targetOffset = { -20, 60 }, + .opacity = 255, + .idleAnimations = N(DefaultAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_PRIMARY_TARGET, + .index = PRT_TARGET, + .posOffset = { 0, 31, 0 }, + .targetOffset = { -14, 20 }, + .opacity = 255, + .idleAnimations = N(DefaultAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -14 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_FEATHER_1, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 0 }, + .opacity = 255, + .idleAnimations = N(FeatherAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_FEATHER_2, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 0 }, + .opacity = 255, + .idleAnimations = N(FeatherAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, + { + .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, + .index = PRT_FEATHER_3, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 0 }, + .opacity = 255, + .idleAnimations = N(FeatherAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, 0 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_FLYING, + .type = ACTOR_TYPE_BUZZAR, + .level = ACTOR_LEVEL_BUZZAR, + .maxHP = 40, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable), + .escapeChance = 0, + .airLiftChance = 0, + .hurricaneChance = 0, + .spookChance = 0, + .upAndAwayChance = 0, + .spinSmashReq = 4, + .powerBounceChance = 75, + .coinReward = 0, + .size = { 78, 74 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -35, 65 }, + .statusTextOffset = { 1, 58 }, +}; + +EvtScript N(EVS_Init) = { + Call(SetActorVar, ACTOR_SELF, AVAR_Unused_1, 0) + Call(SetActorVar, ACTOR_SELF, AVAR_NextMove, AVAL_Move_WindBlast) + Call(SetActorVar, ACTOR_SELF, AVAR_Unused_2, 0) + Call(SetActorVar, ACTOR_SELF, AVAR_Unused_3, 0) + Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn))) + Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle))) + Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent))) + Call(BindHandlePhase, ACTOR_SELF, Ref(N(EVS_HandlePhase))) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Set(LVar1, 40) + Call(SetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(ForceHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(HPBarToHome, ACTOR_SELF) + Return + End +}; + +EvtScript N(EVS_HandlePhase) = { + Return + Return + End +}; + +EvtScript N(EVS_Idle) = { + Return + End +}; + +EvtScript N(EVS_HandleEvent) = { + Call(UseIdleAnimation, ACTOR_SELF, FALSE) + Call(GetLastEvent, ACTOR_SELF, LVar0) + Switch(LVar0) + CaseEq(EVENT_HIT_COMBO) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim0B) + ExecWait(EVS_Enemy_Hit) + CaseEq(EVENT_HIT) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim0B) + ExecWait(EVS_Enemy_Hit) + ExecWait(N(EVS_DummyHit)) + CaseEq(EVENT_BURN_HIT) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim0B) + SetConst(LVar2, -1) + ExecWait(EVS_Enemy_BurnHit) + CaseEq(EVENT_BURN_DEATH) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim0B) + SetConst(LVar2, -1) + ExecWait(EVS_Enemy_BurnHit) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim0B) + ExecWait(EVS_Enemy_Death) + Return + CaseEq(EVENT_SHOCK_HIT) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim0B) + ExecWait(EVS_Enemy_ShockHit) + Call(UseBattleCamPreset, BTL_CAM_DEFAULT) + Call(MoveBattleCamOver, 20) + Call(SetActorVar, ACTOR_SELF, AVAR_NextMove, AVAL_Move_WindBlast) + ExecWait(N(EVS_FlyToHome)) + CaseEq(EVENT_SHOCK_DEATH) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim0B) + ExecWait(EVS_Enemy_ShockHit) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim0B) + ExecWait(EVS_Enemy_Death) + Return + CaseOrEq(EVENT_ZERO_DAMAGE) + CaseOrEq(EVENT_IMMUNE) + CaseOrEq(EVENT_AIR_LIFT_FAILED) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim01) + ExecWait(EVS_Enemy_NoDamageHit) + EndCaseGroup + CaseEq(EVENT_DEATH) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim0B) + ExecWait(EVS_Enemy_Hit) + Wait(10) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim0B) + ExecWait(EVS_Enemy_Death) + Return + CaseEq(EVENT_RECOVER_STATUS) + SetConst(LVar0, PRT_MAIN) + SetConst(LVar1, ANIM_Buzzar_Anim01) + ExecWait(EVS_Enemy_Recover) + CaseDefault + EndSwitch + Call(UseIdleAnimation, ACTOR_SELF, TRUE) + Return + End +}; + +EvtScript N(EVS_TakeTurn) = { + Call(UseIdleAnimation, ACTOR_SELF, FALSE) + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE) + Call(GetStatusFlags, ACTOR_SELF, LVar0) + IfFlag(LVar0, STATUS_FLAG_SHRINK) + Call(SetActorVar, ACTOR_SELF, AVAR_NextMove, AVAL_Move_ClawSwipe) + EndIf + Call(GetActorVar, ACTOR_SELF, AVAR_NextMove, LVar0) + Switch(LVar0) + CaseEq(AVAL_Move_WindBlast) + Call(SetActorVar, ACTOR_SELF, AVAR_NextMove, AVAL_Move_GrappleThenSwipe) + ExecWait(N(EVS_Attack_WindBlast)) + CaseEq(AVAL_Move_ClawSwipe) + Call(SetActorVar, ACTOR_SELF, AVAR_NextMove, AVAL_Move_GrappleThenFling) + ExecWait(N(EVS_Attack_ClawSwipe)) + CaseEq(AVAL_Move_FlingFeather) + Call(SetActorVar, ACTOR_SELF, AVAR_NextMove, AVAL_Move_GrappleThenWind) + ExecWait(N(EVS_Attack_FeatherFling)) + CaseDefault + Call(GetActorVar, ACTOR_SELF, AVAR_NextMove, LVar0) + IfEq(LVar0, AVAL_Move_GrappleThenWind) + Set(LVar0, AVAL_Move_WindBlast) + Else + Add(LVar0, 1) + EndIf + Call(SetActorVar, ACTOR_SELF, AVAR_NextMove, LVar0) + ExecWait(N(EVS_Attack_GrappleDrop)) + EndSwitch + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) + Call(UseIdleAnimation, ACTOR_SELF, TRUE) + Return + End +}; + + +EvtScript N(EVS_Attack_WindBlast) = { + Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + Call(SetGoalToTarget, ACTOR_SELF) + Call(UseBattleCamPreset, BTL_CAM_PRESET_13) + Call(SetBattleCamZoom, 180) + Call(BattleCamTargetActor, ACTOR_SELF) + Call(MoveBattleCamOver, 120) + Call(SetActorSpeed, ACTOR_SELF, Float(1.0)) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(SetGoalPos, ACTOR_SELF, LVar0, 70, LVar2) + Call(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar0) + Switch(LVar0) + CaseOrEq(ANIM_Buzzar_Anim01) + CaseOrEq(ANIM_Buzzar_Anim02) + CaseOrEq(ANIM_Buzzar_Anim0D) + CaseOrEq(ANIM_Buzzar_Anim16) + CaseOrEq(ANIM_Buzzar_Anim17) + Loop(0) + Call(GetPartAnimNotify, ACTOR_SELF, PRT_MAIN, LVar0) + IfEq(LVar0, 1) + BreakLoop + EndIf + Wait(1) + EndLoop + EndCaseGroup + EndSwitch + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim02) + Call(FlyToGoal, ACTOR_SELF, 0, -10, EASING_COS_IN_OUT) + Call(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_NO_CONTACT, 0, 1, BS_FLAGS1_TRIGGER_EVENTS) + Switch(LVarA) + CaseEq(HIT_RESULT_MISS) + Call(SetTargetActor, ACTOR_SELF, ACTOR_PARTNER) + Call(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_NO_CONTACT, 0, 1, BS_FLAGS1_TRIGGER_EVENTS) + Switch(LVarA) + CaseEq(HIT_RESULT_MISS) + Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + Wait(8) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim11) + Wait(15) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim13) + Wait(6) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_WHIRLWIND) + Call(UseBattleCamPreset, BTL_CAM_DEFAULT) + Call(MoveBattleCamOver, 50) + Thread + Call(ShakeCam, CAM_BATTLE, 0, 90, Float(0.5)) + EndThread + Call(N(StartRumbleWithParams), 70, 100) + Thread + Loop(20) + Call(SetGoalToTarget, ACTOR_SELF) + Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Add(LVar0, 10) + PlayEffect(EFFECT_WINDY_LEAVES, 2, LVar0, 10, LVar2, 0) + Wait(3) + EndLoop + EndThread + Wait(60) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim01) + IfEq(LVarA, HIT_RESULT_LUCKY) + Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EndIf + Wait(25) + ExecWait(N(EVS_FlyToHome)) + Return + CaseDefault + Call(SetTargetActor, ACTOR_SELF, ACTOR_PARTNER) + Call(ShowMessageBox, BTL_MSG_ACTION_TIP_REDUCE_DAMAGE, 90) + Call(ShowActionHud, TRUE) + Call(LoadActionCommand, ACTION_COMMAND_WHIRLWIND) + Call(action_command_whirlwind_init, 1) + Call(SetupMashMeter, 3, 40, 70, 100, 0, 0) + Wait(8) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim11) + Wait(15) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim13) + Wait(6) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_WHIRLWIND) + Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE) + Call(action_command_whirlwind_start, 0, 88 * DT, 3) + Call(UseBattleCamPreset, BTL_CAM_PRESET_19) + Call(SetBattleCamTarget, -25, 60, 0) + Call(SetBattleCamZoom, 460) + Call(SetBattleCamOffsetZ, 0) + Call(MoveBattleCamOver, 50) + Call(N(StartRumbleWithParams), 70, 130) + Thread + Loop(30) + Call(SetGoalToTarget, ACTOR_SELF) + Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Add(LVar0, 10) + PlayEffect(EFFECT_WINDY_LEAVES, 2, LVar0, 10, LVar2, 0) + Wait(3) + EndLoop + EndThread + Thread + Call(ShakeCam, CAM_BATTLE, 0, 90, Float(0.5)) + EndThread + Call(ActorExists, ACTOR_PARTNER, LVar0) + IfEq(LVar0, TRUE) + Thread + Call(UseIdleAnimation, ACTOR_PARTNER, FALSE) + Set(LVar0, 0) + Set(LVar1, 3) + Loop(93) + Call(SetActorYaw, ACTOR_PARTNER, LVar0) + Add(LVar0, LVar1) + Add(LVar1, 1) + Wait(1) + EndLoop + Call(SetActorYaw, ACTOR_PARTNER, 0) + EndThread + EndIf + Wait(90) + Call(GetActionQuality, LVar1) + Call(ActorExists, ACTOR_PARTNER, LVar0) + IfEq(LVar0, TRUE) + Wait(3) + Call(UseIdleAnimation, ACTOR_PARTNER, TRUE) + Call(SetTargetActor, ACTOR_SELF, ACTOR_PARTNER) + Call(SetGoalToTarget, ACTOR_SELF) + Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_UNBLOCKABLE | DAMAGE_TYPE_MULTIPLE_POPUPS, SUPPRESS_EVENT_ALL, 0, LVar1, BS_FLAGS1_TRIGGER_EVENTS) + EndIf + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim01) + Wait(25) + Call(UseBattleCamPreset, BTL_CAM_DEFAULT) + Call(MoveBattleCamOver, 20) + ExecWait(N(EVS_FlyToHome)) + Return + EndSwitch + CaseDefault + EndSwitch + Call(ShowMessageBox, BTL_MSG_ACTION_TIP_REDUCE_DAMAGE, 90) + Call(ShowActionHud, TRUE) + Call(LoadActionCommand, ACTION_COMMAND_WHIRLWIND) + Call(action_command_whirlwind_init, 1) + Call(SetupMashMeter, 3, 40, 70, 100, 0, 0) + Wait(8) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim11) + Wait(15) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim13) + Wait(6) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_WHIRLWIND) + Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE) + Call(action_command_whirlwind_start, 0, 88 * DT, 3) + Call(UseBattleCamPreset, BTL_CAM_PRESET_19) + Call(SetBattleCamTarget, -25, 60, 0) + Call(SetBattleCamZoom, 460) + Call(SetBattleCamOffsetZ, 0) + Call(MoveBattleCamOver, 50) + Call(N(StartRumbleWithParams), 70, 130) + Thread + Loop(30) + Call(SetGoalToTarget, ACTOR_SELF) + Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Add(LVar0, 10) + PlayEffect(EFFECT_WINDY_LEAVES, 2, LVar0, 10, LVar2, 0) + Wait(3) + EndLoop + EndThread + Thread + Call(ShakeCam, CAM_BATTLE, 0, 90, Float(0.5)) + EndThread + Call(GetStatusFlags, ACTOR_PLAYER, LVar1) + IfNotFlag(LVar1, STATUS_FLAG_STONE) + Thread + Call(UseIdleAnimation, ACTOR_PLAYER, FALSE) + Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_FallBack) + Set(LVar0, 0) + Set(LVar1, 3) + Loop(90) + Call(SetActorYaw, ACTOR_PLAYER, LVar0) + Add(LVar0, LVar1) + Add(LVar1, 1) + Wait(1) + EndLoop + Call(SetActorYaw, ACTOR_PLAYER, 0) + EndThread + EndIf + Call(ActorExists, ACTOR_PARTNER, LVar0) + IfEq(LVar0, TRUE) + Thread + Call(UseIdleAnimation, ACTOR_PARTNER, FALSE) + Set(LVar0, 0) + Set(LVar1, 3) + Loop(93) + Call(SetActorYaw, ACTOR_PARTNER, LVar0) + Add(LVar0, LVar1) + Add(LVar1, 1) + Wait(1) + EndLoop + Call(SetActorYaw, ACTOR_PARTNER, 0) + EndThread + EndIf + Call(FreezeBattleState, TRUE) + Wait(90) + Call(GetActionQuality, LVar1) + Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + Call(SetGoalToTarget, ACTOR_SELF) + Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_UNBLOCKABLE | DAMAGE_TYPE_MULTIPLE_POPUPS, SUPPRESS_EVENT_ALL, 0, LVar1, BS_FLAGS1_TRIGGER_EVENTS) + Call(ActorExists, ACTOR_PARTNER, LVar0) + IfEq(LVar0, TRUE) + Wait(3) + Call(UseIdleAnimation, ACTOR_PARTNER, TRUE) + Call(SetTargetActor, ACTOR_SELF, ACTOR_PARTNER) + Call(SetGoalToTarget, ACTOR_SELF) + Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_UNBLOCKABLE | DAMAGE_TYPE_MULTIPLE_POPUPS, SUPPRESS_EVENT_ALL, 0, LVar1, BS_FLAGS1_TRIGGER_EVENTS) + EndIf + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim01) + Wait(25) + Call(UseBattleCamPreset, BTL_CAM_DEFAULT) + Call(MoveBattleCamOver, 20) + ExecWait(N(EVS_FlyToHome)) + Call(FreezeBattleState, FALSE) + Return + End +}; + +EvtScript N(EVS_Attack_FeatherFling) = { + Call(UseIdleAnimation, ACTOR_SELF, FALSE) + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE) + Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + Call(SetGoalToTarget, ACTOR_SELF) + Call(UseBattleCamPreset, BTL_CAM_PRESET_05) + Call(SetBattleCamZoom, 180) + Call(SetBattleCamOffsetZ, 0) + Call(BattleCamTargetActor, ACTOR_SELF) + Call(MoveBattleCamOver, 40) + Call(SetActorSpeed, ACTOR_SELF, Float(4.0)) + Call(SetGoalToTarget, ACTOR_SELF) + Call(AddGoalPos, ACTOR_SELF, 90, 35, 0) + Call(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar0) + Switch(LVar0) + CaseOrEq(ANIM_Buzzar_Anim01) + CaseOrEq(ANIM_Buzzar_Anim02) + CaseOrEq(ANIM_Buzzar_Anim0D) + CaseOrEq(ANIM_Buzzar_Anim16) + CaseOrEq(ANIM_Buzzar_Anim17) + Loop(0) + Call(GetPartAnimNotify, ACTOR_SELF, PRT_MAIN, LVar0) + IfEq(LVar0, 1) + BreakLoop + EndIf + Wait(1) + EndLoop + EndCaseGroup + EndSwitch + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim02) + Call(FlyToGoal, ACTOR_SELF, 0, -15, EASING_COS_IN_OUT) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Add(LVar0, -30) + Add(LVar1, 25) + Call(SetPartPos, ACTOR_SELF, PRT_FEATHER_1, LVar0, LVar1, LVar2) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Add(LVar0, -30) + Add(LVar1, 35) + Call(SetPartPos, ACTOR_SELF, PRT_FEATHER_2, LVar0, LVar1, LVar2) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Add(LVar0, -20) + Add(LVar1, 25) + Call(SetPartPos, ACTOR_SELF, PRT_FEATHER_3, LVar0, LVar1, LVar2) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim0E) + Wait(15) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Add(LVar0, 24) + Add(LVar1, 24) + PlayEffect(EFFECT_SHINY_FLARE, 0, LVar0, LVar1, LVar2, Float(0.6), 0, 0) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SMALL_LENS_FLARE) + Wait(10) + Call(SetPartSounds, ACTOR_SELF, PRT_FEATHER_1, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE) + Call(SetPartSounds, ACTOR_SELF, PRT_FEATHER_2, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE) + Call(SetPartSounds, ACTOR_SELF, PRT_FEATHER_3, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE) + Call(UseBattleCamPreset, BTL_CAM_DEFAULT) + Call(MoveBattleCamOver, 20) + Thread + Wait(20) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim01) + EndThread + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim10) + Call(SetPartRotation, ACTOR_SELF, PRT_FEATHER_1, 0, 0, -45) + Call(SetPartRotation, ACTOR_SELF, PRT_FEATHER_2, 0, 0, -45) + Call(SetPartRotation, ACTOR_SELF, PRT_FEATHER_3, 0, 0, -45) + Wait(10) + Call(SetAnimation, ACTOR_SELF, PRT_FEATHER_1, ANIM_Buzzar_Anim14) + Call(SetAnimation, ACTOR_SELF, PRT_FEATHER_2, ANIM_Buzzar_Anim14) + Call(SetAnimation, ACTOR_SELF, PRT_FEATHER_3, ANIM_Buzzar_Anim14) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_1, ACTOR_PART_FLAG_INVISIBLE, FALSE) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) + Call(SetPartMoveSpeed, ACTOR_SELF, PRT_FEATHER_1, Float(6.0)) + Call(SetPartJumpGravity, ACTOR_SELF, PRT_FEATHER_1, Float(0.1)) + Call(SetPartMoveSpeed, ACTOR_SELF, PRT_FEATHER_2, Float(6.0)) + Call(SetPartJumpGravity, ACTOR_SELF, PRT_FEATHER_2, Float(0.1)) + Call(SetPartMoveSpeed, ACTOR_SELF, PRT_FEATHER_3, Float(6.0)) + Call(SetPartJumpGravity, ACTOR_SELF, PRT_FEATHER_3, Float(0.1)) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_THROW) + Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 2, BS_FLAGS1_INCLUDE_POWER_UPS) + Switch(LVar0) + CaseOrEq(HIT_RESULT_MISS) + CaseOrEq(HIT_RESULT_LUCKY) + Set(LVarA, LVar0) + Call(SetGoalToTarget, ACTOR_SELF) + Thread + Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(RandInt, 10, LVar3) + Sub(LVar3, 30) + Add(LVar0, LVar3) + Call(FlyPartTo, ACTOR_SELF, PRT_FEATHER_2, LVar0, 5, LVar2, 9, 0, EASING_LINEAR) + Call(SetAnimation, ACTOR_SELF, PRT_FEATHER_2, ANIM_Buzzar_Anim15) + EndThread + Thread + Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(RandInt, 10, LVar3) + Sub(LVar3, 40) + Add(LVar0, LVar3) + Call(FlyPartTo, ACTOR_SELF, PRT_FEATHER_3, LVar0, 5, LVar2, 9, 0, EASING_LINEAR) + Call(SetAnimation, ACTOR_SELF, PRT_FEATHER_3, ANIM_Buzzar_Anim15) + EndThread + Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Sub(LVar0, 30) + Call(FlyPartTo, ACTOR_SELF, PRT_FEATHER_1, LVar0, 5, LVar2, 9, 0, EASING_LINEAR) + Call(SetAnimation, ACTOR_SELF, PRT_FEATHER_1, ANIM_Buzzar_Anim15) + Thread + Wait(10) + Call(SetAnimation, ACTOR_SELF, PRT_FEATHER_1, ANIM_Buzzar_Anim14) + Call(SetAnimation, ACTOR_SELF, PRT_FEATHER_2, ANIM_Buzzar_Anim14) + Call(SetAnimation, ACTOR_SELF, PRT_FEATHER_3, ANIM_Buzzar_Anim14) + Wait(20) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_1, ACTOR_PART_FLAG_INVISIBLE, TRUE) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + EndThread + Wait(10) + Call(func_8024ECF8, BTL_CAM_MODEY_0, BTL_CAM_MODEX_1, FALSE) + Wait(10) + IfEq(LVarA, HIT_RESULT_LUCKY) + Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EndIf + ExecWait(N(EVS_FlyToHome)) + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) + Call(UseIdleAnimation, ACTOR_SELF, TRUE) + Return + EndCaseGroup + CaseDefault + EndSwitch + Call(func_8024ECF8, BTL_CAM_MODEY_0, BTL_CAM_MODEX_1, FALSE) + Call(SetGoalToTarget, ACTOR_SELF) + Thread + Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(RandInt, 10, LVar3) + Sub(LVar3, 10) + Add(LVar1, LVar3) + Call(FlyPartTo, ACTOR_SELF, PRT_FEATHER_2, LVar0, LVar1, LVar2, 6, 0, EASING_LINEAR) + EndThread + Thread + Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(RandInt, 10, LVar3) + Add(LVar3, 10) + Add(LVar1, LVar3) + Call(FlyPartTo, ACTOR_SELF, PRT_FEATHER_3, LVar0, LVar1, LVar2, 6, 0, EASING_LINEAR) + EndThread + Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(FlyPartTo, ACTOR_SELF, PRT_FEATHER_1, LVar0, LVar1, LVar2, 6, 0, EASING_LINEAR) + Wait(2) + Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_FEATHER, BS_FLAGS1_TRIGGER_EVENTS) + Set(LVarF, LVar0) + Switch(LVarF) + CaseDefault + Thread + Call(SetPartRotation, ACTOR_SELF, PRT_FEATHER_2, 0, 45, 90) + Call(GetPartOffset, ACTOR_SELF, PRT_FEATHER_2, LVar0, LVar1, LVar2) + Sub(LVar0, 40) + Set(LVar1, 2) + Call(SetPartJumpGravity, ACTOR_SELF, PRT_FEATHER_2, Float(1.5)) + Call(JumpPartTo, ACTOR_SELF, PRT_FEATHER_2, LVar0, LVar1, LVar2, 10, TRUE) + Call(SetPartRotation, ACTOR_SELF, PRT_FEATHER_2, 0, 80, 90) + Wait(8) + Loop(15) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_2, ACTOR_PART_FLAG_INVISIBLE, FALSE) + Wait(1) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_2, ACTOR_PART_FLAG_INVISIBLE, TRUE) + Wait(1) + EndLoop + EndThread + Thread + Call(SetPartRotation, ACTOR_SELF, PRT_FEATHER_3, 0, 45, -90) + Call(GetPartOffset, ACTOR_SELF, PRT_FEATHER_3, LVar0, LVar1, LVar2) + Add(LVar0, 20) + Set(LVar1, 4) + Call(SetPartJumpGravity, ACTOR_SELF, PRT_FEATHER_3, Float(1.5)) + Call(JumpPartTo, ACTOR_SELF, PRT_FEATHER_3, LVar0, LVar1, LVar2, 10, TRUE) + Call(SetPartRotation, ACTOR_SELF, PRT_FEATHER_3, 0, 90, -90) + Wait(8) + Loop(15) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_3, ACTOR_PART_FLAG_INVISIBLE, FALSE) + Wait(1) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_3, ACTOR_PART_FLAG_INVISIBLE, TRUE) + Wait(1) + EndLoop + EndThread + Thread + Call(SetPartRotation, ACTOR_SELF, PRT_FEATHER_1, 0, 45, -90) + Call(GetPartOffset, ACTOR_SELF, PRT_FEATHER_1, LVar0, LVar1, LVar2) + Sub(LVar0, 5) + Set(LVar1, 4) + Call(SetPartJumpGravity, ACTOR_SELF, PRT_FEATHER_1, Float(1.5)) + Call(JumpPartTo, ACTOR_SELF, PRT_FEATHER_1, LVar0, LVar1, LVar2, 10, TRUE) + Call(SetPartRotation, ACTOR_SELF, PRT_FEATHER_1, 0, 90, -90) + Wait(8) + Loop(15) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_1, ACTOR_PART_FLAG_INVISIBLE, FALSE) + Wait(1) + Call(SetPartFlagBits, ACTOR_SELF, PRT_FEATHER_1, ACTOR_PART_FLAG_INVISIBLE, TRUE) + Wait(1) + EndLoop + EndThread + Wait(30) + Call(YieldTurn) + ExecWait(N(EVS_FlyToHome)) + EndSwitch + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) + Call(UseIdleAnimation, ACTOR_SELF, TRUE) + Return + End +}; + +EvtScript N(EVS_LiftMario) = { + Call(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar0) + Switch(LVar0) + CaseOrEq(ANIM_Buzzar_Anim01) + CaseOrEq(ANIM_Buzzar_Anim02) + CaseOrEq(ANIM_Buzzar_Anim0D) + CaseOrEq(ANIM_Buzzar_Anim16) + CaseOrEq(ANIM_Buzzar_Anim17) + Loop(0) + Call(GetPartAnimNotify, ACTOR_SELF, PRT_MAIN, LVar0) + IfEq(LVar0, 1) + BreakLoop + EndIf + Wait(1) + EndLoop + EndCaseGroup + EndSwitch + Call(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY) + Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY_INCREMENT, -8, 0) + ChildThread + Loop(0) + Call(N(StartRumbleWithParams), 100, 10) + Wait(10) + EndLoop + EndChildThread + ChildThread + Call(SetActorSpeed, ACTOR_PLAYER, Float(5.0)) + Call(SetActorJumpGravity, ACTOR_PLAYER, Float(0.1)) + Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + Add(LVar1, 180) + Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + Call(FlyToGoal, ACTOR_PLAYER, 99, 0, EASING_LINEAR) + EndChildThread + Call(SetActorSpeed, ACTOR_SELF, Float(5.0)) + Call(SetActorJumpGravity, ACTOR_SELF, Float(0.1)) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Add(LVar1, 180) + Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(FlyToGoal, ACTOR_SELF, 99, 0, EASING_LINEAR) + Return + End +}; + +EvtScript N(EVS_Attack_GrappleDrop) = { + Call(UseIdleAnimation, ACTOR_SELF, FALSE) + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE) + Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + Call(SetGoalToTarget, ACTOR_SELF) + Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + Call(SetBattleCamZoom, 240) + Call(BattleCamTargetActor, ACTOR_SELF) + Call(SetActorSpeed, ACTOR_SELF, Float(4.0)) + Call(SetGoalToTarget, ACTOR_SELF) + Call(AddGoalPos, ACTOR_SELF, 45, 55, 0) + Call(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar0) + Switch(LVar0) + CaseOrEq(ANIM_Buzzar_Anim01) + CaseOrEq(ANIM_Buzzar_Anim02) + CaseOrEq(ANIM_Buzzar_Anim0D) + CaseOrEq(ANIM_Buzzar_Anim16) + CaseOrEq(ANIM_Buzzar_Anim17) + Loop(0) + Call(GetPartAnimNotify, ACTOR_SELF, PRT_MAIN, LVar0) + IfEq(LVar0, 1) + BreakLoop + EndIf + Wait(1) + EndLoop + EndCaseGroup + EndSwitch + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim02) + Call(FlyToGoal, ACTOR_SELF, 0, -10, EASING_COS_IN_OUT) + Call(EnemyTestTarget, ACTOR_SELF, LVarA, 0, 0, 4, BS_FLAGS1_INCLUDE_POWER_UPS) + Switch(LVarA) + CaseOrEq(HIT_RESULT_MISS) + CaseOrEq(HIT_RESULT_LUCKY) + Wait(10) + Call(UseBattleCamPreset, BTL_CAM_PRESET_66) + Call(SetBattleCamZoom, 240) + Call(SetBattleCamOffsetZ, -10) + Call(BattleCamTargetActor, ACTOR_SELF) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_WINDUP) + Call(SetActorSpeed, ACTOR_SELF, Float(5.0)) + Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8)) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_DIVE) + Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE) + Call(SetGoalToTarget, ACTOR_SELF) + Call(AddGoalPos, ACTOR_SELF, -45, -20, 0) + Call(SetActorSpeed, ACTOR_SELF, Float(6.0)) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim18) + Call(FlyToGoal, ACTOR_SELF, 12, -12, EASING_LINEAR) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim01) + Wait(10) + Call(UseBattleCamPreset, BTL_CAM_DEFAULT) + IfEq(LVarA, HIT_RESULT_LUCKY) + Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EndIf + ExecWait(N(EVS_FlyToHome_GrappleFail)) + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) + Call(UseIdleAnimation, ACTOR_SELF, TRUE) + Return + EndCaseGroup + CaseEq(HIT_RESULT_IMMUNE) + Call(UseBattleCamPreset, BTL_CAM_PRESET_66) + Call(SetBattleCamZoom, 240) + Call(SetBattleCamOffsetZ, -10) + Call(BattleCamTargetActor, ACTOR_SELF) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_WINDUP) + Call(SetActorSpeed, ACTOR_SELF, Float(5.0)) + Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8)) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_DIVE) + Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE) + Call(SetGoalToTarget, ACTOR_SELF) + Call(AddGoalPos, ACTOR_SELF, -15, -10, 0) + Call(SetActorSpeed, ACTOR_SELF, Float(6.0)) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim18) + Call(FlyToGoal, ACTOR_SELF, 8, -5, EASING_LINEAR) + Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_DROP, BS_FLAGS1_TRIGGER_EVENTS) + Call(SetGoalToTarget, ACTOR_SELF) + Call(AddGoalPos, ACTOR_SELF, 40, 10, 0) + Call(SetActorSpeed, ACTOR_SELF, Float(6.0)) + Call(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar0) + Switch(LVar0) + CaseOrEq(ANIM_Buzzar_Anim01) + CaseOrEq(ANIM_Buzzar_Anim02) + CaseOrEq(ANIM_Buzzar_Anim0D) + CaseOrEq(ANIM_Buzzar_Anim16) + CaseOrEq(ANIM_Buzzar_Anim17) + Loop(0) + Call(GetPartAnimNotify, ACTOR_SELF, PRT_MAIN, LVar0) + IfEq(LVar0, 1) + BreakLoop + EndIf + Wait(1) + EndLoop + EndCaseGroup + EndSwitch + Call(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY) + Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY_INCREMENT, -14, 0) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim02) + Call(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) + Wait(20) + Call(UseBattleCamPreset, BTL_CAM_DEFAULT) + ExecWait(N(EVS_FlyToHome)) + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) + Call(UseIdleAnimation, ACTOR_SELF, TRUE) + Return + CaseDefault + EndSwitch + Wait(10) + Call(UseBattleCamPresetImmediately, BTL_CAM_PRESET_19) + Call(SetBattleCamZoom, 360) + Call(MoveBattleCamOver, 30) + Thread + Wait(5) + Call(UseBattleCamPreset, BTL_CAM_PRESET_19) + Call(SetBattleCamZoom, 360) + Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + Set(LVar1, 27) + Call(SetBattleCamTarget, LVar0, LVar1, LVar2) + Call(MoveBattleCamOver, 20) + EndThread + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_WINDUP) + Call(SetActorSpeed, ACTOR_SELF, Float(5.0)) + Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8)) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_DIVE) + Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE) + Call(SetGoalToTarget, ACTOR_SELF) + Call(AddGoalPos, ACTOR_SELF, -15, -10, 0) + Call(SetActorSpeed, ACTOR_SELF, Float(6.0)) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim18) + Call(FlyToGoal, ACTOR_SELF, 8, -5, EASING_LINEAR) + IfEq(LVarA, HIT_RESULT_HIT_STATIC) + Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_DROP, BS_FLAGS1_TRIGGER_EVENTS) + EndIf + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_GRAB) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim16) + Call(N(StartRumbleWithParams), 180, 20) + Call(UseIdleAnimation, ACTOR_PLAYER, FALSE) + Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Flail) + Call(ShowMessageBox, BTL_MSG_ACTION_TIP_BREAK_FREE, 90) + Thread + Loop(90) + Call(SetMessageBoxDuration, 99) + Wait(1) + EndLoop + Call(SetMessageBoxDuration, 0) + EndThread + Wait(20) + Call(LoadActionCommand, ACTION_COMMAND_BREAK_FREE) + Call(action_command_whirlwind_init) + Call(SetupMashMeter, 1, 30, 0, 0, 0, 0) + Wait(10) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim17) + Call(UseBattleCamPreset, BTL_CAM_PRESET_66) + Call(SetBattleCamZoom, 240) + Call(SetBattleCamOffsetZ, -10) + Call(BattleCamTargetActor, ACTOR_SELF) + Call(MoveBattleCamOver, 60) + Call(SetBattleFlagBits, BS_FLAGS1_4000, FALSE) + Call(ShowActionHud, TRUE) + Call(action_command_break_free_start, 0, 60 * DT, 30, 3) + ExecGetTID(N(EVS_LiftMario), LVarA) + Wait(62) + Call(GetActionSuccessCopy, LVar0) + IfGt(LVar0, 0) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim01) + Wait(2) + KillThread(LVarA) + Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Jump, ANIM_Mario1_Land) + Call(SetActorSpeed, ACTOR_PLAYER, Float(5.0)) + Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.8)) + Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + Set(LVar1, 0) + Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + Call(PlayerFallToGoal, 15) + Wait(8) + Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle) + Call(UseIdleAnimation, ACTOR_PLAYER, TRUE) + Wait(8) + Call(UseBattleCamPreset, BTL_CAM_DEFAULT) + ExecWait(N(EVS_FlyToHome_GrappleFail)) + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) + Call(UseIdleAnimation, ACTOR_SELF, TRUE) + Return + EndIf + Call(UseBattleCamPreset, BTL_CAM_PRESET_19) + Call(SetBattleCamZoom, 360) + Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + Set(LVar1, 50) + Call(SetBattleCamTarget, LVar0, LVar1, LVar2) + Call(MoveBattleCamOver, 200) + Wait(39) + Wait(10) + Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_PanicRun, ANIM_Mario1_PanicRun, ANIM_Mario1_PanicRun) + Call(SetActorSpeed, ACTOR_PLAYER, Float(5.0)) + Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.2)) + Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + Set(LVar1, 0) + Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) + Call(PlayerFallToGoal, 24) + Call(UseIdleAnimation, ACTOR_PLAYER, TRUE) + Call(SetGoalToTarget, ACTOR_SELF) + Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_DROP, BS_FLAGS1_TRIGGER_EVENTS) + Set(LVarF, LVar0) + Switch(LVarF) + CaseOrEq(HIT_RESULT_HIT) + CaseOrEq(HIT_RESULT_NO_DAMAGE) + Call(SetGoalToTarget, ACTOR_SELF) + Call(AddGoalPos, ACTOR_SELF, 50, 10, 0) + Call(SetActorSpeed, ACTOR_SELF, Float(4.0)) + Call(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar0) + Switch(LVar0) + CaseOrEq(ANIM_Buzzar_Anim01) + CaseOrEq(ANIM_Buzzar_Anim02) + CaseOrEq(ANIM_Buzzar_Anim0D) + CaseOrEq(ANIM_Buzzar_Anim16) + CaseOrEq(ANIM_Buzzar_Anim17) + Loop(0) + Call(GetPartAnimNotify, ACTOR_SELF, PRT_MAIN, LVar0) + IfEq(LVar0, 1) + BreakLoop + EndIf + Wait(1) + EndLoop + EndCaseGroup + EndSwitch + Call(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY) + Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY_INCREMENT, -14, 0) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim02) + Call(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) + Wait(10) + Call(UseBattleCamPreset, BTL_CAM_DEFAULT) + Call(YieldTurn) + ExecWait(N(EVS_FlyToHome)) + EndCaseGroup + EndSwitch + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) + Call(UseIdleAnimation, ACTOR_SELF, TRUE) + Return + End +}; + +EvtScript N(EVS_Attack_ClawSwipe) = { + Call(UseIdleAnimation, ACTOR_SELF, FALSE) + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE) + Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) + Call(SetGoalToTarget, ACTOR_SELF) + Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH) + Call(SetBattleCamZoom, 240) + Call(BattleCamTargetActor, ACTOR_SELF) + Call(func_8024ECF8, BTL_CAM_MODEY_MINUS_1, BTL_CAM_MODEX_1, FALSE) + Call(SetActorSpeed, ACTOR_SELF, Float(4.0)) + Call(SetGoalToTarget, ACTOR_SELF) + Call(AddGoalPos, ACTOR_SELF, 60, 15, 0) + Call(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar0) + Switch(LVar0) + CaseOrEq(ANIM_Buzzar_Anim01) + CaseOrEq(ANIM_Buzzar_Anim02) + CaseOrEq(ANIM_Buzzar_Anim0D) + CaseOrEq(ANIM_Buzzar_Anim16) + CaseOrEq(ANIM_Buzzar_Anim17) + Loop(0) + Call(GetPartAnimNotify, ACTOR_SELF, PRT_MAIN, LVar0) + IfEq(LVar0, 1) + BreakLoop + EndIf + Wait(1) + EndLoop + EndCaseGroup + EndSwitch + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim02) + Call(FlyToGoal, ACTOR_SELF, 0, -15, EASING_COS_IN_OUT) + Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 3, BS_FLAGS1_INCLUDE_POWER_UPS) + Switch(LVar0) + CaseOrEq(HIT_RESULT_MISS) + CaseOrEq(HIT_RESULT_LUCKY) + Set(LVarA, LVar0) + Wait(10) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_WINDUP) + Call(SetActorSpeed, ACTOR_SELF, Float(5.0)) + Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8)) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_DIVE) + Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE) + Call(SetGoalToTarget, ACTOR_SELF) + Call(AddGoalPos, ACTOR_SELF, -45, -20, 0) + Call(SetActorSpeed, ACTOR_SELF, Float(6.0)) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim18) + Call(FlyToGoal, ACTOR_SELF, 12, -12, EASING_LINEAR) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim01) + Wait(10) + Call(UseBattleCamPreset, BTL_CAM_DEFAULT) + IfEq(LVarA, HIT_RESULT_LUCKY) + Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) + EndIf + ExecWait(N(EVS_FlyToHome)) + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) + Call(UseIdleAnimation, ACTOR_SELF, TRUE) + Return + EndCaseGroup + EndSwitch + Wait(10) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_WINDUP) + Call(SetActorSpeed, ACTOR_SELF, Float(5.0)) + Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8)) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BUZZAR_DIVE) + Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE) + Call(SetGoalToTarget, ACTOR_SELF) + Call(AddGoalPos, ACTOR_SELF, -5, -10, 0) + Call(SetActorSpeed, ACTOR_SELF, Float(6.0)) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim18) + Call(FlyToGoal, ACTOR_SELF, 8, 0, EASING_LINEAR) + Wait(2) + Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_SWIPE, BS_FLAGS1_TRIGGER_EVENTS) + Set(LVarF, LVar0) + Switch(LVarF) + CaseOrEq(HIT_RESULT_HIT) + CaseOrEq(HIT_RESULT_NO_DAMAGE) + Call(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar0) + Switch(LVar0) + CaseOrEq(ANIM_Buzzar_Anim01) + CaseOrEq(ANIM_Buzzar_Anim02) + CaseOrEq(ANIM_Buzzar_Anim0D) + CaseOrEq(ANIM_Buzzar_Anim16) + CaseOrEq(ANIM_Buzzar_Anim17) + Loop(0) + Call(GetPartAnimNotify, ACTOR_SELF, PRT_MAIN, LVar0) + IfEq(LVar0, 1) + BreakLoop + EndIf + Wait(1) + EndLoop + EndCaseGroup + EndSwitch + Call(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY) + Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY_INCREMENT, -14, 0) + Call(SetGoalToTarget, ACTOR_SELF) + Call(AddGoalPos, ACTOR_SELF, 50, 10, 0) + Call(SetActorSpeed, ACTOR_SELF, Float(6.0)) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim02) + Call(FlyToGoal, ACTOR_SELF, 0, 0, EASING_LINEAR) + Wait(10) + Call(UseBattleCamPreset, BTL_CAM_DEFAULT) + Call(YieldTurn) + ExecWait(N(EVS_FlyToHome)) + EndCaseGroup + EndSwitch + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) + Call(UseIdleAnimation, ACTOR_SELF, TRUE) + Return + End +}; + +EvtScript N(EVS_FlyToHome) = { + ExecWait(N(EVS_FlyToHome_Impl)) + Return + End +}; + +EvtScript N(EVS_FlyToHome_GrappleFail) = { + ExecWait(N(EVS_FlyToHome_GrappleFail_Impl)) + Return + End +}; + +EvtScript N(EVS_FlyToHome_Impl) = { + Call(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar0) + Switch(LVar0) + CaseOrEq(ANIM_Buzzar_Anim01) + CaseOrEq(ANIM_Buzzar_Anim02) + CaseOrEq(ANIM_Buzzar_Anim0D) + CaseOrEq(ANIM_Buzzar_Anim16) + CaseOrEq(ANIM_Buzzar_Anim17) + Loop(0) + Call(GetPartAnimNotify, ACTOR_SELF, PRT_MAIN, LVar0) + IfEq(LVar0, 1) + BreakLoop + EndIf + Wait(1) + EndLoop + EndCaseGroup + EndSwitch + Call(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY) + Call(SetActorSpeed, ACTOR_SELF, Float(4.0)) + Call(SetGoalToHome, ACTOR_SELF) + Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Set(LVar1, 40) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim01) + Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY_INCREMENT, -20, 0) + Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(FlyToGoal, ACTOR_SELF, 0, -10, EASING_LINEAR) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(ForceHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim01) + Call(HPBarToHome, ACTOR_SELF) + Return + End +}; + +EvtScript N(EVS_FlyToHome_GrappleFail_Impl) = { + Call(GetAnimation, ACTOR_SELF, PRT_MAIN, LVar0) + Switch(LVar0) + CaseOrEq(ANIM_Buzzar_Anim01) + CaseOrEq(ANIM_Buzzar_Anim02) + CaseOrEq(ANIM_Buzzar_Anim0D) + CaseOrEq(ANIM_Buzzar_Anim16) + CaseOrEq(ANIM_Buzzar_Anim17) + Loop(0) + Call(GetPartAnimNotify, ACTOR_SELF, PRT_MAIN, LVar0) + IfEq(LVar0, 1) + BreakLoop + EndIf + Wait(1) + EndLoop + EndCaseGroup + EndSwitch + Call(ResetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY) + Call(SetActorSpeed, ACTOR_SELF, Float(6.0)) + Call(SetGoalToHome, ACTOR_SELF) + Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Set(LVar1, 40) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim01) + Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_FLY_INCREMENT, -20, 0) + Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(FlyToGoal, ACTOR_SELF, 0, 45, EASING_LINEAR) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(ForceHomePos, ACTOR_SELF, LVar0, LVar1, LVar2) + Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Buzzar_Anim01) + Call(HPBarToHome, ACTOR_SELF) + Return + End +}; + +EvtScript N(EVS_DummyHit) = { + Return + Return + End +}; + + +// BUZZAR end + +#include "battle/common/actor/whacka2.inc.c" + +#include "battle/common/stage/area_iwa/iwa_01.inc.c" + +#include "battle/common/stage/area_iwa/iwa_01b.inc.c" + +#include "battle/common/stage/area_iwa/iwa_02.inc.c" diff --git a/src/battle/area/iwa/iwa_01_funcs.c b/src/battle/area/iwa/iwa_01_funcs.c new file mode 100644 index 0000000000..3dbb2420bb --- /dev/null +++ b/src/battle/area/iwa/iwa_01_funcs.c @@ -0,0 +1,14 @@ + +#include "sprite/npc/Buzzar.h" +#include "battle/action_cmd/break_free.h" +#include "battle/action_cmd/whirlwind.h" +#include "sprite/player.h" + +API_CALLABLE(b_area_iwa_iwa_01_whacka_iwa_01_IsHitEightTimes) { + script->varTable[0] = 0; + if (evt_get_variable(NULL, GB_IWA00_Whacka_HitCount) >= 8) { + script->varTable[0] = 1; + } + + return ApiStatus_DONE2; +} diff --git a/src/battle/area/iwa/iwa_02_funcs.c b/src/battle/area/iwa/iwa_02_funcs.c new file mode 100644 index 0000000000..d1a50f3abe --- /dev/null +++ b/src/battle/area/iwa/iwa_02_funcs.c @@ -0,0 +1,14 @@ + +#include "sprite/npc/Buzzar.h" +#include "battle/action_cmd/break_free.h" +#include "battle/action_cmd/whirlwind.h" +#include "sprite/player.h" + +API_CALLABLE(b_area_iwa_iwa_02_whacka_iwa_02_IsHitEightTimes) { + script->varTable[0] = 0; + if (evt_get_variable(NULL, GB_IWA00_Whacka_HitCount) >= 8) { + script->varTable[0] = 1; + } + + return ApiStatus_DONE2; +} diff --git a/src/battle/area/iwa/more_funcs.c b/src/battle/area/iwa/more_funcs.c new file mode 100644 index 0000000000..7ab91a0707 --- /dev/null +++ b/src/battle/area/iwa/more_funcs.c @@ -0,0 +1,17 @@ + +#include "sprite/npc/Buzzar.h" +#include "battle/action_cmd/break_free.h" +#include "battle/action_cmd/whirlwind.h" +#include "sprite/player.h" + +#define NAMESPACE A(buzzar) + +API_CALLABLE(b_area_iwa_buzzar_StartRumbleWithParams) { + Bytecode* args = script->ptrReadPos; + s32 var0 = evt_get_variable(script, *args++); + s32 var1 = evt_get_variable(script, *args++); + + start_rumble(var0, var1); + + return ApiStatus_DONE2; +} diff --git a/src/battle/area/iwa/whacka_funcs.c b/src/battle/area/iwa/whacka_funcs.c new file mode 100644 index 0000000000..e5d1d657a0 --- /dev/null +++ b/src/battle/area/iwa/whacka_funcs.c @@ -0,0 +1,14 @@ + +#include "sprite/npc/Buzzar.h" +#include "battle/action_cmd/break_free.h" +#include "battle/action_cmd/whirlwind.h" +#include "sprite/player.h" + +API_CALLABLE(b_area_iwa_whacka_IsHitEightTimes) { + script->varTable[0] = 0; + if (evt_get_variable(NULL, GB_IWA00_Whacka_HitCount) >= 8) { + script->varTable[0] = 1; + } + + return ApiStatus_DONE2; +} diff --git a/src/battle/common/actor/cleft.inc.c b/src/battle/common/actor/cleft.inc.c index f5f7bb1dd7..e22c7422da 100644 --- a/src/battle/common/actor/cleft.inc.c +++ b/src/battle/common/actor/cleft.inc.c @@ -12,10 +12,6 @@ extern EvtScript N(EVS_Idle); extern EvtScript N(EVS_TakeTurn); extern EvtScript N(EVS_HandleEvent); -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - enum N(ActorVars) { AVAR_Toppled = 0, AVAR_ToppleTurns = 1, @@ -66,7 +62,7 @@ s32 N(StatusTable)[] = { ActorPartBlueprint N(ActorParts)[] = { { .flags = ACTOR_PART_FLAG_PRIMARY_TARGET, - .index = PRT_MAIN, + .index = 1, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 22 }, .opacity = 255, @@ -148,7 +144,7 @@ EvtScript N(EVS_Idle) = { EvtScript N(EVS_FlipOver) = { Call(SetActorVar, ACTOR_SELF, AVAR_Toppled, 1) Call(SetActorVar, ACTOR_SELF, AVAR_ToppleTurns, 2) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim07) Call(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) Thread Set(LVar0, 0) @@ -171,12 +167,12 @@ EvtScript N(EVS_FlipOver) = { Call(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) Call(SetActorRotationOffset, ACTOR_SELF, 0, 0, 0) Call(SetActorRotation, ACTOR_SELF, 0, 0, 0) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) - Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(ToppledAnims))) - Call(SetDefenseTable, ACTOR_SELF, PRT_MAIN, Ref(N(ToppledDefenseTable))) - Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 15) - Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -7) - Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim03) + Call(SetIdleAnimations, ACTOR_SELF, 1, Ref(N(ToppledAnims))) + Call(SetDefenseTable, ACTOR_SELF, 1, Ref(N(ToppledDefenseTable))) + Call(SetTargetOffset, ACTOR_SELF, 1, 0, 15) + Call(SetProjectileTargetOffset, ACTOR_SELF, 1, 0, -7) + Call(SetPartEventBits, ACTOR_SELF, 1, ACTOR_EVENT_FLAG_SPIKY_TOP, FALSE) Call(N(SetSpinSmashable), FALSE) Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, TRUE) Return @@ -201,7 +197,7 @@ EvtScript N(EVS_HandleEvent) = { Else SetConst(LVar1, ANIM_Cleft_Anim08) EndIf - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) ExecWait(EVS_Enemy_Hit) EndSwitch EndCaseGroup @@ -211,37 +207,37 @@ EvtScript N(EVS_HandleEvent) = { CaseFlag(DAMAGE_TYPE_BLAST) ExecWait(N(EVS_FlipOver)) CaseDefault - Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, TRUE) + Call(SetPartEventBits, ACTOR_SELF, 1, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, TRUE) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) IfEq(LVar0, 1) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim09) SetConst(LVar2, -1) ExecWait(EVS_Enemy_BurnHit) Else - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar2, -1) ExecWait(EVS_Enemy_BurnHit) EndIf - Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, FALSE) + Call(SetPartEventBits, ACTOR_SELF, 1, ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION, FALSE) EndSwitch CaseEq(EVENT_BURN_DEATH) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) IfEq(LVar0, 1) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim09) SetConst(LVar2, -1) ExecWait(EVS_Enemy_BurnHit) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim09) ExecWait(EVS_Enemy_Death) Else - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) SetConst(LVar2, -1) ExecWait(EVS_Enemy_BurnHit) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) ExecWait(EVS_Enemy_Death) EndIf @@ -253,44 +249,44 @@ EvtScript N(EVS_HandleEvent) = { Else SetConst(LVar1, ANIM_Cleft_Anim08) EndIf - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) ExecWait(EVS_Enemy_SpinSmashHit) CaseEq(EVENT_SPIN_SMASH_DEATH) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) IfEq(LVar0, 1) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim09) ExecWait(EVS_Enemy_SpinSmashHit) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim09) ExecWait(EVS_Enemy_Death) Else - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) ExecWait(EVS_Enemy_SpinSmashHit) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) ExecWait(EVS_Enemy_Death) EndIf Return CaseEq(EVENT_SHOCK_HIT) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) ExecWait(EVS_Enemy_ShockHit) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) ExecWait(EVS_Enemy_Knockback) Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim07) ExecWait(EVS_Enemy_ReturnHome) Call(SetActorJumpGravity, ACTOR_SELF, Float(1.6)) Call(JumpToGoal, ACTOR_SELF, 5, FALSE, TRUE, FALSE) CaseEq(EVENT_SHOCK_DEATH) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) ExecWait(EVS_Enemy_ShockHit) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) ExecWait(EVS_Enemy_Death) Return @@ -298,7 +294,7 @@ EvtScript N(EVS_HandleEvent) = { CaseEq(EVENT_SPIKE_TAUNT) Call(GetStatusFlags, ACTOR_SELF, LVar0) IfNotFlag(LVar0, STATUS_FLAGS_IMMOBILIZED) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim18) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim18) EndIf Wait(10) Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) @@ -321,25 +317,25 @@ EvtScript N(EVS_HandleEvent) = { Else SetConst(LVar1, ANIM_Cleft_Anim02) EndIf - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) ExecWait(EVS_Enemy_NoDamageHit) EndCaseGroup CaseEq(EVENT_DEATH) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) IfEq(LVar0, 1) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim09) ExecWait(EVS_Enemy_Hit) Wait(10) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim09) ExecWait(EVS_Enemy_Death) Else - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) ExecWait(EVS_Enemy_Hit) Wait(10) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) ExecWait(EVS_Enemy_Death) EndIf @@ -347,34 +343,34 @@ EvtScript N(EVS_HandleEvent) = { CaseEq(EVENT_RECOVER_STATUS) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) IfEq(LVar0, 0) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim02) ExecWait(EVS_Enemy_Recover) EndIf CaseEq(EVENT_SCARE_AWAY) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) IfEq(LVar0, 1) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim03) ExecWait(EVS_Enemy_NoDamageHit) Else - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim07) SetConst(LVar2, ANIM_Cleft_Anim08) ExecWait(EVS_Enemy_ScareAway) Return EndIf CaseEq(EVENT_BEGIN_AIR_LIFT) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim0F) ExecWait(EVS_Enemy_AirLift) CaseEq(EVENT_BLOW_AWAY) Call(GetActorVar, ACTOR_SELF, AVAR_Toppled, LVar0) IfEq(LVar0, 1) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim0F) Else - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Cleft_Anim08) EndIf ExecWait(EVS_Enemy_BlowAway) @@ -390,20 +386,20 @@ EvtScript N(EVS_HandleEvent) = { EvtScript N(EVS_TryGettingUp) = { Call(UseIdleAnimation, ACTOR_SELF, FALSE) Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE) - Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(3.0)) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) + Call(AddActorDecoration, ACTOR_SELF, 1, 0, ACTOR_DECORATION_SWEAT) + Call(SetAnimationRate, ACTOR_SELF, 1, Float(3.0)) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim03) Wait(20) - Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0)) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim05) - Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + Call(SetAnimationRate, ACTOR_SELF, 1, Float(1.0)) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim05) + Call(RemoveActorDecoration, ACTOR_SELF, 1, 0) Call(GetActorVar, ACTOR_SELF, AVAR_ToppleTurns, LVar0) IfGt(LVar0, 0) Sub(LVar0, 1) Call(SetActorVar, ACTOR_SELF, AVAR_ToppleTurns, LVar0) Else Call(SetActorRotationOffset, ACTOR_SELF, 0, 16, 0) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim03) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim03) Thread Wait(3) Loop(5) @@ -425,12 +421,12 @@ EvtScript N(EVS_TryGettingUp) = { Call(SetActorRotation, ACTOR_SELF, 0, 0, 0) Call(SetActorPos, ACTOR_SELF, LVar0, 0, LVar2) Call(SetActorVar, ACTOR_SELF, AVAR_Toppled, 0) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) - Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(UprightAnims))) - Call(SetDefenseTable, ACTOR_SELF, PRT_MAIN, Ref(N(UprightDefenseTable))) - Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 22) - Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -10) - Call(SetPartEventBits, ACTOR_SELF, PRT_MAIN, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim02) + Call(SetIdleAnimations, ACTOR_SELF, 1, Ref(N(UprightAnims))) + Call(SetDefenseTable, ACTOR_SELF, 1, Ref(N(UprightDefenseTable))) + Call(SetTargetOffset, ACTOR_SELF, 1, 0, 22) + Call(SetProjectileTargetOffset, ACTOR_SELF, 1, 0, -10) + Call(SetPartEventBits, ACTOR_SELF, 1, ACTOR_EVENT_FLAG_SPIKY_TOP, TRUE) Wait(1) Call(N(SetSpinSmashable), TRUE) Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_FLIPPED, FALSE) @@ -458,15 +454,15 @@ EvtScript N(EVS_Attack_Tackle) = { Wait(5) PlayEffect(EFFECT_SMOKE_IMPACT, 1, LVar0, LVar1, LVar2, 32, 4, 0, 10, 0) EndThread - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim10) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim10) Wait(10) Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim11) Call(SetGoalToTarget, ACTOR_SELF) Call(AddGoalPos, ACTOR_SELF, 50, 0, -5) Call(SetActorSpeed, ACTOR_SELF, Float(4.0)) Call(RunToGoal, ACTOR_SELF, 0, FALSE) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim00) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim00) Wait(8) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CLEFT_TACKLE) Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK, SOUND_NONE, SOUND_NONE) @@ -481,7 +477,7 @@ EvtScript N(EVS_Attack_Tackle) = { Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) EndThread EndIf - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim11) Call(SetGoalToTarget, ACTOR_SELF) Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) Sub(LVar0, 100) @@ -489,29 +485,29 @@ EvtScript N(EVS_Attack_Tackle) = { Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) Call(SetActorSpeed, ACTOR_SELF, Float(8.0)) Call(RunToGoal, ACTOR_SELF, 0, FALSE) - Call(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 45) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim08) + Call(SetPartRotation, ACTOR_SELF, 1, 0, 0, 45) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim08) Wait(15) Wait(8) Call(ResetAllActorSounds, ACTOR_SELF) Call(UseBattleCamPreset, BTL_CAM_DEFAULT) Call(YieldTurn) - Call(SetPartRotation, ACTOR_SELF, PRT_MAIN, 0, 0, 0) + Call(SetPartRotation, ACTOR_SELF, 1, 0, 0, 0) Call(SetActorYaw, ACTOR_SELF, 180) - Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) + Call(AddActorDecoration, ACTOR_SELF, 1, 0, ACTOR_DECORATION_SWEAT) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim07) Call(SetGoalToHome, ACTOR_SELF) Call(SetActorSpeed, ACTOR_SELF, Float(8.0)) Call(RunToGoal, ACTOR_SELF, 0, FALSE) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) - Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim02) + Call(RemoveActorDecoration, ACTOR_SELF, 1, 0) Call(SetActorYaw, ACTOR_SELF, 0) Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) Call(UseIdleAnimation, ACTOR_SELF, TRUE) Return EndCaseGroup EndSwitch - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim11) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim11) Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) Add(LVar0, 20) Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) @@ -521,7 +517,7 @@ EvtScript N(EVS_Attack_Tackle) = { Wait(2) Call(SetGoalToTarget, ACTOR_SELF) Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_TACKLE, BS_FLAGS1_TRIGGER_EVENTS) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim02) Call(UseBattleCamPreset, BTL_CAM_DEFAULT) Switch(LVar0) CaseOrEq(HIT_RESULT_HIT) @@ -533,14 +529,14 @@ EvtScript N(EVS_Attack_Tackle) = { Call(SetActorJumpGravity, ACTOR_SELF, Float(2.4)) Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) Call(JumpToGoal, ACTOR_SELF, 6, FALSE, TRUE, FALSE) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim02) Wait(5) Call(YieldTurn) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim07) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim07) Call(SetActorSpeed, ACTOR_SELF, Float(8.0)) Call(SetGoalToHome, ACTOR_SELF) Call(RunToGoal, ACTOR_SELF, 0, FALSE) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Cleft_Anim02) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Cleft_Anim02) EndCaseGroup EndSwitch Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) diff --git a/src/battle/common/actor/monty_mole.inc.c b/src/battle/common/actor/monty_mole.inc.c index 5cca9ff4f1..a435c413aa 100644 --- a/src/battle/common/actor/monty_mole.inc.c +++ b/src/battle/common/actor/monty_mole.inc.c @@ -11,12 +11,6 @@ extern EvtScript N(EVS_Idle); extern EvtScript N(EVS_TakeTurn); extern EvtScript N(EVS_HandleEvent); -enum N(ActorPartIDs) { - PRT_MAIN = 1, - PRT_TARGET = 2, - PRT_ROCK = 3, -}; - enum N(ActorVars) { AVAR_IN_Hole_Small = 0, }; @@ -58,7 +52,7 @@ s32 N(StatusTable)[] = { ActorPartBlueprint N(ActorParts)[] = { { .flags = ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, + .index = 1, .posOffset = { 0, 0, 0 }, .targetOffset = { -2, 16 }, .opacity = 255, @@ -70,7 +64,7 @@ ActorPartBlueprint N(ActorParts)[] = { }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_PRIMARY_TARGET | ACTOR_PART_FLAG_SKIP_MOVEMENT_ALLOC, - .index = PRT_TARGET, + .index = 2, .posOffset = { 0, 0, -15 }, .targetOffset = { -2, 12 }, .opacity = 255, @@ -82,7 +76,7 @@ ActorPartBlueprint N(ActorParts)[] = { }, { .flags = ACTOR_PART_FLAG_INVISIBLE | ACTOR_PART_FLAG_NO_TARGET | ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION, - .index = PRT_ROCK, + .index = 3, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 0 }, .opacity = 255, @@ -149,7 +143,7 @@ s32 N(LeapAnims)[] = { ActorPartBlueprint N(HoleParts)[] = { { .flags = ACTOR_PART_FLAG_DAMAGE_IMMUNE | ACTOR_PART_FLAG_NO_TARGET, - .index = PRT_MAIN, + .index = 1, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 0 }, .opacity = 255, @@ -164,7 +158,7 @@ ActorPartBlueprint N(HoleParts)[] = { EvtScript N(EVS_Hole_Init) = { Call(GetActorVar, ACTOR_SELF, AVAR_IN_Hole_Small, LVar0) IfEq(LVar0, TRUE) - Call(SetPartScale, ACTOR_SELF, PRT_MAIN, Float(0.4), Float(0.4), Float(0.4)) + Call(SetPartScale, ACTOR_SELF, 1, Float(0.4), Float(0.4), Float(0.4)) EndIf Return End @@ -242,31 +236,31 @@ EvtScript N(EVS_HandleEvent) = { IfFlag(LVarE, DAMAGE_TYPE_SMASH) ChildThread Wait(8) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim07) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim07) EndChildThread - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_MontyMole_Anim06) ExecWait(EVS_Enemy_Hit) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim08) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim08) Wait(10) Else - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_MontyMole_Anim05) ExecWait(EVS_Enemy_Hit) EndIf EndCaseGroup CaseEq(EVENT_BURN_HIT) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_MontyMole_Anim0A) SetConst(LVar2, ANIM_MontyMole_Anim0B) ExecWait(EVS_Enemy_BurnHit) CaseEq(EVENT_BURN_DEATH) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_MontyMole_Anim0A) SetConst(LVar2, ANIM_MontyMole_Anim0B) ExecWait(EVS_Enemy_BurnHit) ExecWait(N(EVS_CreateEmptyHole)) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_MontyMole_Anim0C) ExecWait(EVS_Enemy_Death) Return @@ -275,51 +269,51 @@ EvtScript N(EVS_HandleEvent) = { Call(GetLastElement, LVar0) IfFlag(LVar0, DAMAGE_TYPE_SMASH) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) - Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0)) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim11) + Call(SetAnimationRate, ACTOR_SELF, 1, Float(2.0)) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim11) Wait(80) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) - Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0)) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim10) + Call(SetAnimationRate, ACTOR_SELF, 1, Float(1.0)) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim10) Wait(20) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim14) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim14) Wait(20) Else - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_MontyMole_Anim01) ExecWait(EVS_Enemy_NoDamageHit) EndIf EndCaseGroup CaseEq(EVENT_DEATH) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_MontyMole_Anim05) ExecWait(EVS_Enemy_Hit) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim06) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim06) Wait(10) ExecWait(N(EVS_CreateEmptyHole)) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_MontyMole_Anim09) ExecWait(EVS_Enemy_Death) Return CaseEq(EVENT_RECOVER_STATUS) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim06) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim06) Wait(8) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim07) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim07) Wait(5) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim08) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim08) Wait(8) CaseEq(EVENT_SCARE_AWAY) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim06) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim06) Wait(15) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim07) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim07) Wait(15) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim08) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim08) Wait(15) Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_TARGET_ONLY | ACTOR_FLAG_NO_DMG_APPLY, TRUE) - Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(EmptyHoleAnims))) + Call(SetIdleAnimations, ACTOR_SELF, 1, Ref(N(EmptyHoleAnims))) Return CaseEq(EVENT_BEGIN_AIR_LIFT) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_MontyMole_Anim05) ExecWait(EVS_Enemy_AirLift) CaseEq(EVENT_BLOW_AWAY) @@ -327,27 +321,27 @@ EvtScript N(EVS_HandleEvent) = { Call(GetStatusFlags, ACTOR_SELF, LVar0) IfFlag(LVar0, STATUS_FLAGS_IMMOBILIZED) Call(SetActorDispOffset, ACTOR_SELF, 0, -5, 0) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim19) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim19) Else IfFlag(LVar0, STATUS_FLAG_SHRINK) Call(SetActorDispOffset, ACTOR_SELF, 0, -9, 0) Else Call(SetActorDispOffset, ACTOR_SELF, 0, -23, 0) EndIf - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim09) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim09) EndIf Wait(1000) Return CaseEq(EVENT_AIR_LIFT_FAILED) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) - Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(2.0)) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim11) + Call(SetAnimationRate, ACTOR_SELF, 1, Float(2.0)) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim11) Wait(40) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) - Call(SetAnimationRate, ACTOR_SELF, PRT_MAIN, Float(1.0)) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim10) + Call(SetAnimationRate, ACTOR_SELF, 1, Float(1.0)) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim10) Wait(20) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim14) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim14) Wait(20) CaseEq(EVENT_UP_AND_AWAY) ExecWait(N(EVS_CreateEmptyHole)) @@ -374,21 +368,21 @@ EvtScript N(EVS_TakeTurn) = { Wait(20) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_SURFACE) EndChildThread - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_MontyMole_Anim04) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_MontyMole_Anim04) Wait(37) Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) Add(LVar1, 20) - Call(SetPartPos, ACTOR_SELF, PRT_ROCK, LVar0, LVar1, LVar2) + Call(SetPartPos, ACTOR_SELF, 3, LVar0, LVar1, LVar2) Wait(1) - Call(SetPartFlagBits, ACTOR_SELF, PRT_ROCK, ACTOR_PART_FLAG_INVISIBLE, FALSE) + Call(SetPartFlagBits, ACTOR_SELF, 3, ACTOR_PART_FLAG_INVISIBLE, FALSE) Call(GetStatusFlags, ACTOR_SELF, LVar0) IfFlag(LVar0, STATUS_FLAG_SHRINK) - Call(SetPartScale, ACTOR_SELF, PRT_ROCK, Float(0.4), Float(0.4), Float(0.4)) + Call(SetPartScale, ACTOR_SELF, 3, Float(0.4), Float(0.4), Float(0.4)) Else - Call(SetPartScale, ACTOR_SELF, PRT_ROCK, Float(1.0), Float(1.0), Float(1.0)) + Call(SetPartScale, ACTOR_SELF, 3, Float(1.0), Float(1.0), Float(1.0)) EndIf - Call(PlaySoundAtPart, ACTOR_SELF, PRT_ROCK, SOUND_MOLE_THROW) - Call(SetPartSounds, ACTOR_SELF, PRT_ROCK, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE) + Call(PlaySoundAtPart, ACTOR_SELF, 3, SOUND_MOLE_THROW) + Call(SetPartSounds, ACTOR_SELF, 3, ACTOR_SOUND_FLY, SOUND_NONE, SOUND_NONE) Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 2, BS_FLAGS1_TRIGGER_EVENTS) Switch(LVar0) CaseOrEq(HIT_RESULT_MISS) @@ -399,11 +393,11 @@ EvtScript N(EVS_TakeTurn) = { Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) Sub(LVar0, 100) Set(LVar1, -5) - Call(SetPartMoveSpeed, ACTOR_SELF, PRT_ROCK, Float(12.0)) - Call(SetPartJumpGravity, ACTOR_SELF, PRT_ROCK, Float(0.1)) - Call(SetAnimation, ACTOR_SELF, PRT_ROCK, ANIM_MontyMole_Anim0F) - Call(FlyPartTo, ACTOR_SELF, PRT_ROCK, LVar0, LVar1, LVar2, 0, 30, EASING_LINEAR) - Call(SetPartFlagBits, ACTOR_SELF, PRT_ROCK, ACTOR_PART_FLAG_INVISIBLE, TRUE) + Call(SetPartMoveSpeed, ACTOR_SELF, 3, Float(12.0)) + Call(SetPartJumpGravity, ACTOR_SELF, 3, Float(0.1)) + Call(SetAnimation, ACTOR_SELF, 3, ANIM_MontyMole_Anim0F) + Call(FlyPartTo, ACTOR_SELF, 3, LVar0, LVar1, LVar2, 0, 30, EASING_LINEAR) + Call(SetPartFlagBits, ACTOR_SELF, 3, ACTOR_PART_FLAG_INVISIBLE, TRUE) IfEq(LVarA, HIT_RESULT_LUCKY) Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0) EndIf @@ -416,10 +410,10 @@ EvtScript N(EVS_TakeTurn) = { Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER) Call(SetGoalToTarget, ACTOR_SELF) Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2) - Call(SetPartMoveSpeed, ACTOR_SELF, PRT_ROCK, Float(12.0)) - Call(SetPartJumpGravity, ACTOR_SELF, PRT_ROCK, Float(0.1)) - Call(SetAnimation, ACTOR_SELF, PRT_ROCK, ANIM_MontyMole_Anim0F) - Call(FlyPartTo, ACTOR_SELF, PRT_ROCK, LVar0, LVar1, LVar2, 0, 20, EASING_LINEAR) + Call(SetPartMoveSpeed, ACTOR_SELF, 3, Float(12.0)) + Call(SetPartJumpGravity, ACTOR_SELF, 3, Float(0.1)) + Call(SetAnimation, ACTOR_SELF, 3, ANIM_MontyMole_Anim0F) + Call(FlyPartTo, ACTOR_SELF, 3, LVar0, LVar1, LVar2, 0, 20, EASING_LINEAR) Wait(2) Call(EnemyDamageTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, 0, DMG_TOSS, BS_FLAGS1_TRIGGER_EVENTS) Switch(LVar0) @@ -428,13 +422,13 @@ EvtScript N(EVS_TakeTurn) = { Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2) Sub(LVar0, 55) Set(LVar1, 0) - Call(SetPartMoveSpeed, ACTOR_SELF, PRT_ROCK, Float(6.0)) - Call(SetPartJumpGravity, ACTOR_SELF, PRT_ROCK, Float(0.1)) - Call(FlyPartTo, ACTOR_SELF, PRT_ROCK, LVar0, LVar1, LVar2, 0, 25, EASING_LINEAR) - Call(SetPartMoveSpeed, ACTOR_SELF, PRT_ROCK, Float(4.0)) + Call(SetPartMoveSpeed, ACTOR_SELF, 3, Float(6.0)) + Call(SetPartJumpGravity, ACTOR_SELF, 3, Float(0.1)) + Call(FlyPartTo, ACTOR_SELF, 3, LVar0, LVar1, LVar2, 0, 25, EASING_LINEAR) + Call(SetPartMoveSpeed, ACTOR_SELF, 3, Float(4.0)) Sub(LVar0, 20) - Call(FlyPartTo, ACTOR_SELF, PRT_ROCK, LVar0, LVar1, LVar2, 0, 21, EASING_LINEAR) - Call(SetPartFlagBits, ACTOR_SELF, PRT_ROCK, ACTOR_PART_FLAG_INVISIBLE, TRUE) + Call(FlyPartTo, ACTOR_SELF, 3, LVar0, LVar1, LVar2, 0, 21, EASING_LINEAR) + Call(SetPartFlagBits, ACTOR_SELF, 3, ACTOR_PART_FLAG_INVISIBLE, TRUE) EndCaseGroup EndSwitch Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) diff --git a/src/battle/common/actor/whacka.inc.c b/src/battle/common/actor/whacka.inc.c index f1d47e31c0..4ba8615a32 100644 --- a/src/battle/common/actor/whacka.inc.c +++ b/src/battle/common/actor/whacka.inc.c @@ -11,13 +11,6 @@ extern EvtScript N(EVS_HandleEvent); extern EvtScript N(EVS_MakeWhackaBump); extern EvtScript N(EVS_Death); -enum N(ActorPartIDs) { - PRT_MAIN = 1, -}; - -enum N(ActorVars) { - AVAR_SpawnedBump = 0, -}; s32 N(DefaultAnims)[] = { STATUS_KEY_NORMAL, ANIM_Whacka_Idle, @@ -65,7 +58,7 @@ s32 N(StatusTable)[] = { ActorPartBlueprint N(ActorParts)[] = { { .flags = ACTOR_PART_FLAG_PRIMARY_TARGET, - .index = PRT_MAIN, + .index = 1, .posOffset = { 0, 0, 0 }, .targetOffset = { 0, 30 }, .opacity = 255, @@ -113,11 +106,11 @@ EvtScript N(EVS_Init) = { Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn))) Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle))) Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent))) - Call(SetActorVar, ACTOR_SELF, AVAR_SpawnedBump, FALSE) + Call(SetActorVar, ACTOR_SELF, 0, FALSE) Call(N(IsHitEightTimes)) IfEq(LVar0, 0) Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_INVISIBLE | ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE) - Call(SetPartFlagBits, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_NO_TARGET, TRUE) + Call(SetPartFlagBits, ACTOR_SELF, 1, ACTOR_PART_FLAG_NO_TARGET, TRUE) EndIf Return End @@ -138,11 +131,11 @@ EvtScript N(EVS_HandleEvent) = { Switch(LVar0) CaseEq(EVENT_HIT_COMBO) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_WHACKA) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_Hit) CaseEq(EVENT_HIT) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Hurt) ExecWait(N(EVS_MakeWhackaBump)) ExecWait(EVS_Enemy_Hit) @@ -152,7 +145,7 @@ EvtScript N(EVS_HandleEvent) = { Return EndIf CaseEq(EVENT_BURN_HIT) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar2, ANIM_Whacka_Idle) ExecWait(N(EVS_MakeWhackaBump)) @@ -163,7 +156,7 @@ EvtScript N(EVS_HandleEvent) = { Return EndIf CaseEq(EVENT_BURN_DEATH) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar2, ANIM_Whacka_Idle) ExecWait(N(EVS_MakeWhackaBump)) @@ -172,13 +165,13 @@ EvtScript N(EVS_HandleEvent) = { ExecWait(N(EVS_Death)) Return Else - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_Death) Return EndIf CaseEq(EVENT_SPIN_SMASH_HIT) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_SpinSmashHit) Call(RandInt, 100, LVar0) @@ -187,42 +180,42 @@ EvtScript N(EVS_HandleEvent) = { Return EndIf CaseEq(EVENT_SPIN_SMASH_DEATH) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_SpinSmashHit) IfGe(100, 100) ExecWait(N(EVS_Death)) Return Else - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_Death) Return EndIf CaseEq(EVENT_SHOCK_HIT) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_ShockHit) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_Knockback) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_ReturnHome) CaseEq(EVENT_SHOCK_DEATH) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_ShockHit) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_Death) Return CaseEq(EVENT_ZERO_DAMAGE) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_NoDamageHit) CaseEq(EVENT_IMMUNE) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_NoDamageHit) Call(RandInt, 100, LVar0) @@ -231,7 +224,7 @@ EvtScript N(EVS_HandleEvent) = { Return EndIf CaseEq(EVENT_AIR_LIFT_FAILED) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_NoDamageHit) Call(RandInt, 100, LVar0) @@ -240,7 +233,7 @@ EvtScript N(EVS_HandleEvent) = { Return EndIf CaseEq(EVENT_DEATH) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Hurt) ExecWait(N(EVS_MakeWhackaBump)) ExecWait(EVS_Enemy_Hit) @@ -249,27 +242,27 @@ EvtScript N(EVS_HandleEvent) = { ExecWait(N(EVS_Death)) Return Else - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_Death) Return EndIf CaseEq(EVENT_RECOVER_STATUS) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_Recover) CaseEq(EVENT_SCARE_AWAY) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) SetConst(LVar2, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_ScareAway) Return CaseEq(EVENT_BEGIN_AIR_LIFT) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_AirLift) CaseEq(EVENT_BLOW_AWAY) - SetConst(LVar0, PRT_MAIN) + SetConst(LVar0, 1) SetConst(LVar1, ANIM_Whacka_Idle) ExecWait(EVS_Enemy_BlowAway) Return @@ -292,11 +285,11 @@ EvtScript N(EVS_TakeTurn) = { }; EvtScript N(EVS_MakeWhackaBump) = { - Call(SetActorVar, ACTOR_SELF, AVAR_SpawnedBump, TRUE) + Call(SetActorVar, ACTOR_SELF, 0, TRUE) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_WHACKA) Thread Wait(15) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Whacka_Idle) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Whacka_Idle) Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) Add(LVar0, 5) Add(LVar1, 20) @@ -311,13 +304,13 @@ EvtScript N(EVS_Death) = { Call(UseIdleAnimation, ACTOR_SELF, FALSE) Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE) Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) - Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_Whacka_Burrow) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Whacka_Burrow) Wait(40) - Call(GetActorVar, ACTOR_SELF, AVAR_SpawnedBump, LVar0) + Call(GetActorVar, ACTOR_SELF, 0, LVar0) IfNe(LVar0, FALSE) Call(SetBattleFlagBits2, BS_FLAGS2_DROP_WHACKA_BUMP, TRUE) EndIf - Call(SetPartFlagBits, ACTOR_SELF, PRT_MAIN, ACTOR_PART_FLAG_NO_TARGET, TRUE) + Call(SetPartFlagBits, ACTOR_SELF, 1, ACTOR_PART_FLAG_NO_TARGET, TRUE) Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_INVISIBLE | ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE) Call(RemoveActor, ACTOR_SELF) Return diff --git a/src/battle/common/actor/whacka2.inc.c b/src/battle/common/actor/whacka2.inc.c new file mode 100644 index 0000000000..9e3e4ec6cb --- /dev/null +++ b/src/battle/common/actor/whacka2.inc.c @@ -0,0 +1,310 @@ +#include "battle/battle.h" +#include "script_api/battle.h" +#include "sprite/npc/Whacka.h" + +#define NAMESPACE A(whacka) + +extern EvtScript N(EVS_Init); +extern EvtScript N(EVS_Idle); +extern EvtScript N(EVS_TakeTurn); +extern EvtScript N(EVS_HandleEvent); +extern EvtScript N(EVS_MakeWhackaBump); +extern EvtScript N(EVS_Death); + +API_CALLABLE(N(IsHitEightTimes)); + +s32 N(DefaultAnims)[] = { + STATUS_KEY_NORMAL, ANIM_Whacka_Idle, + STATUS_KEY_STONE, ANIM_Whacka_Still, + STATUS_KEY_SLEEP, ANIM_Whacka_Idle, + STATUS_KEY_POISON, ANIM_Whacka_Idle, + STATUS_KEY_STOP, ANIM_Whacka_Still, + STATUS_KEY_STATIC, ANIM_Whacka_Idle, + STATUS_KEY_PARALYZE, ANIM_Whacka_Still, + STATUS_KEY_DIZZY, ANIM_Whacka_Idle, + STATUS_KEY_FEAR, ANIM_Whacka_Idle, + STATUS_END, +}; + +s32 N(DefenseTable)[] = { + ELEMENT_NORMAL, 0, + ELEMENT_END, +}; + +s32 N(StatusTable)[] = { + STATUS_KEY_NORMAL, 0, + STATUS_KEY_DEFAULT, 0, + STATUS_KEY_SLEEP, 0, + STATUS_KEY_POISON, 0, + STATUS_KEY_FROZEN, 0, + STATUS_KEY_DIZZY, 0, + STATUS_KEY_FEAR, 0, + STATUS_KEY_STATIC, 0, + STATUS_KEY_PARALYZE, 0, + STATUS_KEY_SHRINK, 0, + STATUS_KEY_STOP, 0, + STATUS_TURN_MOD_DEFAULT, 0, + STATUS_TURN_MOD_SLEEP, 0, + STATUS_TURN_MOD_POISON, 0, + STATUS_TURN_MOD_FROZEN, 0, + STATUS_TURN_MOD_DIZZY, 0, + STATUS_TURN_MOD_FEAR, 0, + STATUS_TURN_MOD_STATIC, 0, + STATUS_TURN_MOD_PARALYZE, 0, + STATUS_TURN_MOD_SHRINK, 0, + STATUS_TURN_MOD_STOP, 0, + STATUS_END, +}; + +ActorPartBlueprint N(ActorParts)[] = { + { + .flags = ACTOR_PART_FLAG_PRIMARY_TARGET, + .index = 1, + .posOffset = { 0, 0, 0 }, + .targetOffset = { 0, 30 }, + .opacity = 255, + .idleAnimations = N(DefaultAnims), + .defenseTable = N(DefenseTable), + .eventFlags = ACTOR_EVENT_FLAGS_NONE, + .elementImmunityFlags = 0, + .projectileTargetOffset = { 0, -5 }, + }, +}; + +ActorBlueprint NAMESPACE = { + .flags = ACTOR_FLAG_NO_SHADOW | ACTOR_FLAG_NO_HEALTH_BAR, + .type = ACTOR_TYPE_WHACKA, + .level = ACTOR_LEVEL_WHACKA, + .maxHP = 99, + .partCount = ARRAY_COUNT(N(ActorParts)), + .partsData = N(ActorParts), + .initScript = &N(EVS_Init), + .statusTable = N(StatusTable), + .escapeChance = 0, + .airLiftChance = 0, + .hurricaneChance = 0, + .spookChance = 0, + .upAndAwayChance = 0, + .spinSmashReq = 4, + .powerBounceChance = 50, + .coinReward = 0, + .size = { 47, 32 }, + .healthBarOffset = { 0, 0 }, + .statusIconOffset = { -20, 40 }, + .statusTextOffset = { 10, 30 }, +}; + +EvtScript N(EVS_Init) = { + Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn))) + Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle))) + Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent))) + Call(SetActorVar, ACTOR_SELF, 0, FALSE) + Call(N(IsHitEightTimes)) + IfEq(LVar0, 0) + Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_INVISIBLE | ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE) + Call(SetPartFlagBits, ACTOR_SELF, 1, ACTOR_PART_FLAG_NO_TARGET, TRUE) + EndIf + Return + End +}; + +EvtScript N(EVS_Idle) = { + Label(0) + Wait(1) + Goto(0) + Return + End +}; + +EvtScript N(EVS_HandleEvent) = { + Call(UseIdleAnimation, ACTOR_SELF, FALSE) + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE) + Call(GetLastEvent, ACTOR_SELF, LVar0) + Switch(LVar0) + CaseEq(EVENT_HIT_COMBO) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_WHACKA) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_Hit) + CaseEq(EVENT_HIT) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Hurt) + ExecWait(N(EVS_MakeWhackaBump)) + ExecWait(EVS_Enemy_Hit) + Call(RandInt, 100, LVar0) + IfLe(LVar0, 100) + ExecWait(N(EVS_Death)) + Return + EndIf + CaseEq(EVENT_BURN_HIT) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + SetConst(LVar2, ANIM_Whacka_Idle) + ExecWait(N(EVS_MakeWhackaBump)) + ExecWait(EVS_Enemy_Hit) + Call(RandInt, 100, LVar0) + IfLe(LVar0, 100) + ExecWait(N(EVS_Death)) + Return + EndIf + CaseEq(EVENT_BURN_DEATH) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + SetConst(LVar2, ANIM_Whacka_Idle) + ExecWait(N(EVS_MakeWhackaBump)) + ExecWait(EVS_Enemy_Hit) + IfGe(100, 100) + ExecWait(N(EVS_Death)) + Return + Else + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_Death) + Return + EndIf + CaseEq(EVENT_SPIN_SMASH_HIT) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_SpinSmashHit) + Call(RandInt, 100, LVar0) + IfLe(LVar0, 100) + ExecWait(N(EVS_Death)) + Return + EndIf + CaseEq(EVENT_SPIN_SMASH_DEATH) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_SpinSmashHit) + IfGe(100, 100) + ExecWait(N(EVS_Death)) + Return + Else + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_Death) + Return + EndIf + CaseEq(EVENT_SHOCK_HIT) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_ShockHit) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_Knockback) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_ReturnHome) + CaseEq(EVENT_SHOCK_DEATH) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_ShockHit) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_Death) + Return + CaseEq(EVENT_ZERO_DAMAGE) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_NoDamageHit) + CaseEq(EVENT_IMMUNE) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_NoDamageHit) + Call(RandInt, 100, LVar0) + IfLe(LVar0, 100) + ExecWait(N(EVS_Death)) + Return + EndIf + CaseEq(EVENT_AIR_LIFT_FAILED) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_NoDamageHit) + Call(RandInt, 100, LVar0) + IfLe(LVar0, 100) + ExecWait(N(EVS_Death)) + Return + EndIf + CaseEq(EVENT_DEATH) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Hurt) + ExecWait(N(EVS_MakeWhackaBump)) + ExecWait(EVS_Enemy_Hit) + Wait(10) + IfGe(100, 100) + ExecWait(N(EVS_Death)) + Return + Else + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_Death) + Return + EndIf + CaseEq(EVENT_RECOVER_STATUS) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_Recover) + CaseEq(EVENT_SCARE_AWAY) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + SetConst(LVar2, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_ScareAway) + Return + CaseEq(EVENT_BEGIN_AIR_LIFT) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_AirLift) + CaseEq(EVENT_BLOW_AWAY) + SetConst(LVar0, 1) + SetConst(LVar1, ANIM_Whacka_Idle) + ExecWait(EVS_Enemy_BlowAway) + Return + CaseDefault + EndSwitch + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE) + Call(UseIdleAnimation, ACTOR_SELF, TRUE) + Return + End +}; + +EvtScript N(EVS_TakeTurn) = { + Call(RandInt, 100, LVar0) + IfLe(LVar0, 100) + ExecWait(N(EVS_Death)) + Return + EndIf + Return + End +}; + +EvtScript N(EVS_MakeWhackaBump) = { + Call(SetActorVar, ACTOR_SELF, 0, TRUE) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_HIT_WHACKA) + Thread + Wait(15) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Whacka_Idle) + Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2) + Add(LVar0, 5) + Add(LVar1, 20) + Add(LVar2, 10) + Call(MakeItemEntity, ITEM_WHACKAS_BUMP, LVar0, LVar1, LVar2, ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS, 0) + EndThread + Return + End +}; + +EvtScript N(EVS_Death) = { + Call(UseIdleAnimation, ACTOR_SELF, FALSE) + Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE) + Call(PlaySoundAtActor, ACTOR_SELF, SOUND_BURROW_DIG) + Call(SetAnimation, ACTOR_SELF, 1, ANIM_Whacka_Burrow) + Wait(40) + Call(GetActorVar, ACTOR_SELF, 0, LVar0) + IfNe(LVar0, FALSE) + Call(SetBattleFlagBits2, BS_FLAGS2_DROP_WHACKA_BUMP, TRUE) + EndIf + Call(SetPartFlagBits, ACTOR_SELF, 1, ACTOR_PART_FLAG_NO_TARGET, TRUE) + Call(SetActorFlagBits, ACTOR_SELF, ACTOR_FLAG_INVISIBLE | ACTOR_FLAG_NO_ATTACK | ACTOR_FLAG_NO_DMG_APPLY, TRUE) + Call(RemoveActor, ACTOR_SELF) + Return + End +}; diff --git a/src/battle/common/stage/area_iwa/iwa_01.inc.c b/src/battle/common/stage/area_iwa/iwa_01.inc.c index cf2d782401..519e2184aa 100644 --- a/src/battle/common/stage/area_iwa/iwa_01.inc.c +++ b/src/battle/common/stage/area_iwa/iwa_01.inc.c @@ -47,5 +47,5 @@ Formation N(WhackaFormation) = { // needs to match stage name used while defining NAMESPACE above // the actor include redefines NAMESPACE based on current AREA, so we need to insert the stage name via prefix #define NAME_PREFIX iwa_01_ -#include "battle/common/actor/whacka.inc.c" +#include "battle/common/actor/whacka2.inc.c" #define NAME_PREFIX diff --git a/src/battle/common/stage/area_iwa/iwa_02.inc.c b/src/battle/common/stage/area_iwa/iwa_02.inc.c index 99eca92a2e..569fbcc4ab 100644 --- a/src/battle/common/stage/area_iwa/iwa_02.inc.c +++ b/src/battle/common/stage/area_iwa/iwa_02.inc.c @@ -42,5 +42,5 @@ Formation N(WhackaFormation) = { // needs to match stage name used while defining NAMESPACE above // the actor include redefines NAMESPACE based on current AREA, so we need to insert the stage name via prefix #define NAME_PREFIX iwa_02_ -#include "battle/common/actor/whacka.inc.c" +#include "battle/common/actor/whacka2.inc.c" #define NAME_PREFIX diff --git a/ver/us/splat.yaml b/ver/us/splat.yaml index d2b8314dc6..c070276b70 100644 --- a/ver/us/splat.yaml +++ b/ver/us/splat.yaml @@ -6104,21 +6104,23 @@ segments: type: code start: 0x4D01F0 vram_class: battle_area - subalign: 4 subsegments: - [auto, c, area] - - [auto, c, actor/cleft] - - [auto, c, actor/monty_mole] - - [auto, c, actor/buzzar] - - [auto, c, actor/whacka] - - [auto, c, stage/iwa_01] - - [auto, c, stage/iwa_01b] - - [auto, c, stage/iwa_02] + - [auto, c, more_funcs] + - [auto, c, whacka_funcs] + - [auto, c, iwa_01_funcs] + - [auto, c, iwa_02_funcs] + # - [auto, c, actor/cleft] + # - [auto, c, actor/monty_mole] + # - [auto, c, actor/buzzar] + # - [auto, c, actor/whacka] + # - [auto, c, stage/iwa_01] + # - [auto, c, stage/iwa_01b] + # - [auto, c, stage/iwa_02] - dir: battle/area/sbk type: code start: 0x4DA5E0 vram_class: battle_area - subalign: 16 # BSS alignment hack subsegments: - [auto, c, actor/pokey] - [auto, c, actor/bandit] @@ -6596,7 +6598,6 @@ segments: type: code start: 0x660750 vram_class: battle_area - subalign: 16 # BSS alignment hack subsegments: - [auto, c, actor/crystal_king] - [auto, c, actor/crystal_bit]