using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")] [assembly: AssemblyCompany("SpeedyBoi")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SpeedyBoi")] [assembly: AssemblyTitle("SpeedyBoi")] [assembly: AssemblyVersion("1.0.0.0")] [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 SpeedyBoi { [BepInPlugin("saltgaming.valheim.speedyboi", "SpeedyBoi", "1.0.0")] public class SpeedyBoiPlugin : BaseUnityPlugin { private const string PluginGuid = "saltgaming.valheim.speedyboi"; private const string PluginName = "SpeedyBoi"; private const string PluginVersion = "1.0.0"; public static ConfigEntry MaxSpeedMultiplier; private void Awake() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown MaxSpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind("General", "MaxSpeedMultiplier", 1.6f, "Crouch speed multiplier applied at 100 Sneak skill. Scales linearly from 1.0x at skill 0."); Harmony val = new Harmony("saltgaming.valheim.speedyboi"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"SpeedyBoi v1.0.0 loaded."); } } [HarmonyPatch(typeof(Character), "UpdateWalking")] internal static class Character_UpdateWalking_SpeedyBoiPatch { private static void Prefix(Character __instance, out float __state) { __state = __instance.m_crouchSpeed; if (__instance.IsPlayer() && __instance.IsCrouching()) { float skillFactor = __instance.GetSkillFactor((SkillType)101); float num = Mathf.Lerp(1f, SpeedyBoiPlugin.MaxSpeedMultiplier.Value, skillFactor); __instance.m_crouchSpeed = __state * num; } } private static Exception Finalizer(Character __instance, float __state, Exception __exception) { __instance.m_crouchSpeed = __state; return __exception; } } }