diff --git a/soh/soh/Enhancements/accessible-actors/AccessibleActorList.cpp b/soh/soh/Enhancements/accessible-actors/AccessibleActorList.cpp index 9a03efaa2..830dd80d3 100644 --- a/soh/soh/Enhancements/accessible-actors/AccessibleActorList.cpp +++ b/soh/soh/Enhancements/accessible-actors/AccessibleActorList.cpp @@ -442,6 +442,19 @@ void ActorAccessibility_InitActors() { }); policy.distance = 1000; ActorAccessibility_AddSupportedActor(ACTOR_EN_WOOD02, policy); + ActorAccessibility_InitPolicy(&policy, "Lake Hylia Sun", [](AccessibleActor* actor) { + s32 params = actor->actor->params & 0xFF; + if (params != 0x40 && params != 0x41 && gSaveContext.dayTime >= 0x4555 && gSaveContext.dayTime < 0x5000) { + if (actor->xzDistToPlayer <= 120 && (actor->frameCount & 31) == 0) { + ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_IT_BOW_FLICK); + } + actor->policy.aimAssist.isProvider = AIM_BOW; + } else { + actor->policy.aimAssist.isProvider = 0; + } + }); + policy.runsAlways = true; + ActorAccessibility_AddSupportedActor(ACTOR_SHOT_SUN, policy); ActorAccessibility_InitPolicy(&policy, "Hookshot Pillar", NA_SE_IT_HOOKSHOT_STICK_OBJ); policy.distance = 1000; policy.ydist = 1000; diff --git a/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp b/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp index d7a3197d2..67348a8d8 100644 --- a/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp +++ b/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp @@ -18,6 +18,7 @@ #include "soh/ObjectExtension/ObjectExtension.h" extern "C" { +#include "overlays/actors/ovl_Shot_Sun/z_shot_sun.h" extern PlayState* gPlayState; extern bool freezeGame; extern bool freezeActors; @@ -410,7 +411,7 @@ void ActorAccessibility_RunAccessibilityForActor(PlayState* play, AccessibleActo return; } else if (actor->isDrawn == 0 && actor->id != ACTOR_EN_HOLL && actor->id != ACTOR_EN_KAKASI2 && actor->id != ACTOR_EN_IT && actor->id != ACTOR_EN_OKARINA_TAG && actor->id != ACTOR_EN_WONDER_ITEM && - !aa->glossary->GlossaryStarted) { + actor->id != ACTOR_SHOT_SUN && !aa->glossary->GlossaryStarted) { return; } @@ -746,6 +747,12 @@ AimAssistProps ActorAccessibility_ProvideAimAssistForActor(AccessibleActor* acto x += Math_SinS(actor->actor->shape.rot.y) * 50; z += Math_CosS(actor->actor->shape.rot.y) * 50; xzDist = sqrtf(SQ(player->actor.world.pos.x - x) + SQ(player->actor.world.pos.z - z)); + } else if (actor->id == ACTOR_SHOT_SUN) { + ShotSun* sun = (ShotSun*)actor->actor; + x = sun->hitboxPos.x; + z = sun->hitboxPos.z; + yHeight = sun->hitboxPos.y + 55; + xzDist = sqrtf(SQ(player->actor.world.pos.x - x) + SQ(player->actor.world.pos.z - z)); } s32 yIntercept = slope * xzDist + player->actor.focus.pos.y; AimAssistProps aimAssistProps;