From 08cdcd6610cf57d7c2f4c1da00e19ee3d482ff98 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 18 Jan 2024 19:59:42 -0500 Subject: [PATCH] adds frequncy and pitch to aim assist --- .../accessible-actors/ActorAccessibility.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp b/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp index f6e589c2c..397f59ecb 100644 --- a/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp +++ b/soh/soh/Enhancements/accessible-actors/ActorAccessibility.cpp @@ -578,7 +578,23 @@ int ActorAccessibility_GetRandomStartingFrameCount(int min, int max) { //Aim cue support. void ActorAccessibility_ProvideAimAssistForActor(AccessibleActor* actor) { - + Player* player = GET_PLAYER(actor->play); + // 16384 + s32 angle = player->actor.focus.rot.x; + angle = angle / -14000.0 * 16384; + s32 yIntercept = ((Math_SinS(angle) / Math_CosS(angle)) * actor->xzDistToPlayer)+player->actor.focus.pos.y; + s32 yHight = actor->actor->world.pos.y + 30; + if ((yIntercept) > yHight + 30) { + actor->aimAssist.pitch = 1.5; + } else if ((yIntercept) < yHight - 30) { + actor->aimAssist.pitch = 0.5; + } + s32 yDiff = fabs(yIntercept-yHight); + if (yDiff > 300) { + actor->aimAssist.frequency = 30; + } else { + actor->aimAssist.frequency = 1 + (uint8_t)(yDiff / 5); + } } //External audio engine stuff.