Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
8 changes: 8 additions & 0 deletions src/PushMod/ConfigurationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ public class ConfigurationHandler {
private ConfigEntry<KeyCode> _configPushKey;
private ConfigEntry<KeyCode> _configSelfPushKey;
private ConfigEntry<bool> _configcanCharge;
private ConfigEntry<float> _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");
Expand All @@ -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}");
Expand Down
3 changes: 1 addition & 2 deletions src/PushMod/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}");

Expand Down