using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace MovementTuner { [BepInPlugin("benjamin.movementtuner", "MovementTuner", "1.0.0")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.movementtuner"; public const string Name = "MovementTuner"; public const string Version = "1.0.0"; internal static ManualLogSource Log; internal static ConfigEntry Enabled; internal static ConfigEntry WalkSpeed; internal static ConfigEntry SprintSpeed; internal static ConfigEntry CrouchSpeed; internal static ConfigEntry JumpForce; internal static ConfigEntry Verbose; private void Awake() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind("General", "Enabled", true, "Master switch. Turn off to restore vanilla movement immediately - baselines are restored, not just left alone."); WalkSpeed = ((BaseUnityPlugin)this).Config.Bind("Movement", "WalkSpeed", 1f, new ConfigDescription("Multiplier on base walk speed. 1.0 is vanilla.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 2.5f), Array.Empty())); SprintSpeed = ((BaseUnityPlugin)this).Config.Bind("Movement", "SprintSpeed", 1f, new ConfigDescription("Multiplier on base sprint speed. Applied to the base value, so speed upgrades still stack on top normally.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 2.5f), Array.Empty())); CrouchSpeed = ((BaseUnityPlugin)this).Config.Bind("Movement", "CrouchSpeed", 1f, new ConfigDescription("Multiplier on crouch speed.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 3f), Array.Empty())); JumpForce = ((BaseUnityPlugin)this).Config.Bind("Movement", "JumpForce", 1f, new ConfigDescription("Multiplier on jump force. Above about 1.4 you will start clipping into geometry.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 2f), Array.Empty())); Verbose = ((BaseUnityPlugin)this).Config.Bind("Debug", "Verbose", false, "Log the captured baselines once per player."); ((Component)this).gameObject.AddComponent(); Log.LogInfo((object)"MovementTuner v1.0.0 loaded."); } } internal class Tuner : MonoBehaviour { private PlayerController _controller; private bool _captured; private bool _wasEnabled = true; private float _walk; private float _sprint; private float _crouch; private float _jump; private void LateUpdate() { PlayerController instance = PlayerController.instance; if ((Object)(object)instance == (Object)null) { _captured = false; return; } if (instance != _controller) { _controller = instance; _captured = false; } if (!_captured) { _walk = instance.MoveSpeed; _sprint = instance.SprintSpeed; _crouch = instance.CrouchSpeed; _jump = instance.JumpForce; _captured = true; if (Plugin.Verbose.Value) { Plugin.Log.LogInfo((object)$"[MovementTuner] Baselines walk={_walk} sprint={_sprint} crouch={_crouch} jump={_jump}"); } } if (!Plugin.Enabled.Value) { if (_wasEnabled) { instance.MoveSpeed = _walk; instance.SprintSpeed = _sprint; instance.CrouchSpeed = _crouch; instance.JumpForce = _jump; _wasEnabled = false; } } else { _wasEnabled = true; instance.MoveSpeed = _walk * Plugin.WalkSpeed.Value; instance.SprintSpeed = _sprint * Plugin.SprintSpeed.Value; instance.CrouchSpeed = _crouch * Plugin.CrouchSpeed.Value; instance.JumpForce = _jump * Plugin.JumpForce.Value; } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "MovementTuner"; public const string PLUGIN_NAME = "MovementTuner"; public const string PLUGIN_VERSION = "1.0.0"; } }