Decompiled source of Erenshor Walking Speed Adjust Mod v1.0.0

BepInEx/plugins/Erenshor-Walking-Speed-Adjust-Mod.dll

Decompiled a month ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("Erenshor-Walking-Speed-Adjust-Mod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+2569ad4220406e01bc9dc5facc4f9c11ba8efcc1")]
[assembly: AssemblyProduct("Erenshor-Walking-Speed-Adjust-Mod")]
[assembly: AssemblyTitle("Erenshor-Walking-Speed-Adjust-Mod")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Erenshor_Walking_Speed_Adjust_Mod;

[BepInPlugin("org.lenzork.walkingspeedadjustmod", "Walking Speed Adjust Mod", "1.0.0")]
public class Mod : BaseUnityPlugin
{
	[HarmonyPatch(typeof(Stats), "CalcStats")]
	public static class StatsPatch
	{
		[HarmonyPrefix]
		public static void Postfix(Stats __instance)
		{
			__instance.RunSpeed = walkingSpeed.Value;
		}
	}

	public static ConfigEntry<int> walkingSpeed;

	public void Awake()
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Expected O, but got Unknown
		Debug.Log((object)"Walking Speed Adjust Mod loaded");
		CreateConfig();
		Harmony val = new Harmony("org.lenzork.walkingspeedadjustmod");
		val.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"All Patches have been loaded!");
	}

	public void CreateConfig()
	{
		walkingSpeed = ((BaseUnityPlugin)this).Config.Bind<int>("Walking Speed", "walkingSpeed", 6, "The speed at which the player walks");
	}
}