From 2dc7638514fbff44c08b2724a00d822acf7f0e15 Mon Sep 17 00:00:00 2001 From: Itsusinn Date: Sat, 28 Jan 2023 22:56:06 +0800 Subject: [PATCH] chore: add a switch for sense --- src/Tanya.Game.Apex.Feature.Sense/Config.cs | 2 ++ src/Tanya.Game.Apex.Feature.Sense/Feature.cs | 3 +++ src/Tanya/appsettings.json | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Tanya.Game.Apex.Feature.Sense/Config.cs b/src/Tanya.Game.Apex.Feature.Sense/Config.cs index e9afc43..1d689f8 100644 --- a/src/Tanya.Game.Apex.Feature.Sense/Config.cs +++ b/src/Tanya.Game.Apex.Feature.Sense/Config.cs @@ -18,6 +18,8 @@ public Config(IConfiguration config) #endregion #region Properties + [JsonPropertyName("enable")] + public bool Enable => _config.GetProperty(); [JsonPropertyName("distance")] public int Distance => _config.GetProperty(); diff --git a/src/Tanya.Game.Apex.Feature.Sense/Feature.cs b/src/Tanya.Game.Apex.Feature.Sense/Feature.cs index 383f842..b6af179 100644 --- a/src/Tanya.Game.Apex.Feature.Sense/Feature.cs +++ b/src/Tanya.Game.Apex.Feature.Sense/Feature.cs @@ -20,6 +20,9 @@ public Feature(Config config) public void Tick(DateTime frameTime, State state) { + if (!_config.Enable){ + return; + } if (state.Players.TryGetValue(state.LocalPlayer, out var localPlayer)) { foreach (var (_, player) in state.Players) diff --git a/src/Tanya/appsettings.json b/src/Tanya/appsettings.json index ddf4410..940457d 100644 --- a/src/Tanya/appsettings.json +++ b/src/Tanya/appsettings.json @@ -7,9 +7,9 @@ "processRefresh": 15000 }, "Tanya.Game.Apex.Feature.Aim": { - "distance": 200, + "distance": 150, "lockTime": 150, - "recoil": 0.85, + "recoil": 0.80, "releaseTime": 250, "friendlyLock": false, "pitchAngle": 12, @@ -20,6 +20,7 @@ "yawSpeed": 0.21 }, "Tanya.Game.Apex.Feature.Sense": { + "enable": false, "distance": 250 } } \ No newline at end of file