diff --git a/README.md b/README.md index 84c3e4c..4c8fb14 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ A config file is automatically generated on first launch. You can customize: - Input keys (keyboard & controller) - Enable/disable charge system +- Increase/Decrease the push force > This config file can be found at: > `Peak/BepInEx/config/com.github.boxofbiscuits97.PushMod.cfg` diff --git a/src/PushMod/ConfigurationHandler.cs b/src/PushMod/ConfigurationHandler.cs index 0792f53..b0f22b9 100644 --- a/src/PushMod/ConfigurationHandler.cs +++ b/src/PushMod/ConfigurationHandler.cs @@ -11,10 +11,12 @@ public class ConfigurationHandler { private ConfigEntry _configPushKey; private ConfigEntry _configSelfPushKey; private ConfigEntry _configcanCharge; + private ConfigEntry _configPushForce; public KeyCode SelfPushKey => _configSelfPushKey.Value; public KeyCode PushKey => _configPushKey.Value; public bool CanCharge => _configcanCharge.Value; + public float PushForce => _configPushForce.Value; public ConfigurationHandler(Plugin instance) { Plugin.Log.LogInfo("PushMod ConfigurationHandler initialising"); @@ -36,6 +38,12 @@ public ConfigurationHandler(Plugin instance) { defaultValue: true, description: "The setting includes charging force when pushed" ); + _configPushForce = instance.Config.Bind( + section: "Push Settigns", + key: "PushForce", + defaultValue: 500f, + description: "The setting used to determine how powerful the push will be" + ); Plugin.Log.LogInfo("PushMod Configuration loaded:"); Plugin.Log.LogInfo($" PushKey: {PushKey}"); diff --git a/src/PushMod/Plugin.cs b/src/PushMod/Plugin.cs index bb95f12..26a78aa 100644 --- a/src/PushMod/Plugin.cs +++ b/src/PushMod/Plugin.cs @@ -60,7 +60,6 @@ public class PushManager : MonoBehaviour { // ============================== Configuration Constants =================================================== private const float PUSH_RANGE = 2.5f; // Maximum distance for push interaction private const float PUSH_COOLDOWN = 1f; // Cooldown time between successful pushes - private const float PUSH_FORCE_BASE = 500f; // Base push force applied private const float BINGBONG_MULTIPLIER = 10f; // Force multiplier when holding "BingBong" item private const float STAMINA_COST = 0.1f; // Stamina consumed per push @@ -232,7 +231,7 @@ private void TryPushTarget(bool self) { float chargeMultiplier = 1f + ((currentCharge / MAX_CHARGE) * CHARGE_FORCE_MULTIPLIER); float bingBongMultiplier = bingBong ? BINGBONG_MULTIPLIER : 1f; float totalMultiplier = bingBongMultiplier * chargeMultiplier; - Vector3 forceDirection = mainCamera.transform.forward * PUSH_FORCE_BASE * totalMultiplier; + Vector3 forceDirection = mainCamera.transform.forward * Plugin.PConfig.PushForce * totalMultiplier; Plugin.Log.LogInfo($"Push force direction: {forceDirection}");