diff --git a/soh/soh/Enhancements/accessible-actors/AccessibleActorList.cpp b/soh/soh/Enhancements/accessible-actors/AccessibleActorList.cpp index df27fef97..5e5b5649d 100644 --- a/soh/soh/Enhancements/accessible-actors/AccessibleActorList.cpp +++ b/soh/soh/Enhancements/accessible-actors/AccessibleActorList.cpp @@ -91,7 +91,7 @@ void accessible_switch(AccessibleActor* actor) { return; } if (scale.y >= 33.0f / 200.0f) { - if (actor->play->sceneNum == 0 && actor->play->roomCtx.curRoom.num == 5 && actor->xzDistToPlayer < 20) { + if (actor->play->sceneNum == SCENE_DEKU_TREE && actor->play->roomCtx.curRoom.num == 5 && actor->xzDistToPlayer < 20) { ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_EV_DIAMOND_SWITCH); } if ((actor->frameCount & 31) != 0) { @@ -106,10 +106,15 @@ void accessible_switch(AccessibleActor* actor) { ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_IT_HAMMER_HIT); } } else if ((actor->actor->params & 7) == OBJSWITCH_TYPE_EYE) { - if (sw->eyeTexIndex == 0) { + s32 subType = (actor->actor->params >> 4) & 7; + if (subType != 0 || sw->eyeTexIndex == 0) { actor->policy.aimAssist.isProvider = AIM_SHOOT; actor->policy.ydist = 1000; - ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_EV_FOOT_SWITCH); + // prevent hearing yellow eye in forest temple block puzzle heard on top floor + if (!(actor->play->sceneNum == SCENE_FOREST_TEMPLE && actor->play->roomCtx.curRoom.num == 11 && + actor->pos.y < player->actor.world.pos.y - 100)) { + ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_EV_FOOT_SWITCH); + } } } else if (actor->xyzDistToPlayer < 1000) { actor->policy.aimAssist.isProvider = AIM_ALL; @@ -726,12 +731,17 @@ void ActorAccessibility_InitActors() { if ((actor->frameCount & 31) == 0) { ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_EV_TRAP_BOUND); } - } else if (po->index == sBgPoEventPuzzleState && (actor->frameCount & 63) == 0) { - ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_EN_PO_CRY); + } else if (po->index == sBgPoEventPuzzleState) { + actor->policy.aimAssist.isProvider = AIM_BOW; + if ((actor->frameCount & 63) == 0) { + ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_EN_PO_CRY); + } + } else { + actor->policy.aimAssist.isProvider = 0; } }); policy.aimAssist.isProvider = AIM_BOW; - policy.aimAssist.tolerance = 50.0f; + policy.aimAssist.tolerance = 40.0f; policy.n = 1; policy.ydist = 1000; policy.distance = 1000; @@ -969,7 +979,7 @@ void ActorAccessibility_InitActors() { policy.pitch = 1.3; ActorAccessibility_AddSupportedActor(VA_CLIMB, policy); ActorAccessibility_InitPolicy(&policy, "Door", [](AccessibleActor* actor) { - if (((actor->actor->params >> 7) & 7) == DOOR_LOCKED) { + if (((actor->actor->params >> 7) & 7) == DOOR_LOCKED && !Flags_GetSwitch(actor->play, actor->actor->params & 0x3F)) { ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_EV_CHAIN_KEY_UNLOCK_B); } else { ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_OC_DOOR_OPEN); diff --git a/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp b/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp index 24053c037..c4b70f55d 100644 --- a/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp +++ b/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp @@ -517,7 +517,7 @@ void ActorAccessibility_GeneralHelper(PlayState* play) { bool compassOn = false; if (aa->prevPos.x == player->actor.world.pos.x && aa->prevPos.z == player->actor.world.pos.z) { - if (aa->prevYaw != player->yaw) { + if (ABS(aa->prevYaw - player->yaw) > 0x400) { compassOn = true; aa->prevYaw = player->yaw; } @@ -722,7 +722,7 @@ AimAssistProps ActorAccessibility_ProvideAimAssistForActor(AccessibleActor* acto s32 angle = player->actor.focus.rot.x; angle = angle / -14000.0 * 16384; f32 cos_angle = Math_CosS(angle); - f32 slope = cos_angle <= 0.01 ? 1.0f : std::max(Math_SinS(angle) / cos_angle, 1.0f); + f32 slope = cos_angle == 0.0f ? 0.0f : Math_SinS(angle) / cos_angle; s32 yIntercept = slope * actor->xzDistToPlayer + player->actor.focus.pos.y; s32 yHeight = actor->pos.y + 25; AimAssistProps aimAssistProps; @@ -735,7 +735,7 @@ AimAssistProps ActorAccessibility_ProvideAimAssistForActor(AccessibleActor* acto } s32 yDiff = fabs(yIntercept - yHeight); if (yIntercept - yHeight > 0) { - s32 correction = (1 - 1 / slope) * 100; + s32 correction = 100.0f - 100.0f / std::max(slope, 1.0f); yDiff = std::max(yDiff - correction, 0); } if (yDiff > 300) {