Decompiled source of NoStaminaSneakingTheoretically v1.1.1

plugins/NoStaminaSneakingTheoretically.dll

Decompiled 4 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
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: AssemblyCompany("NoStaminaSneak")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: AssemblyProduct("NoStaminaSneak")]
[assembly: AssemblyTitle("NoStaminaSneak")]
[assembly: AssemblyVersion("2.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 NoStaminaSneak
{
	[BepInPlugin("local.nostaminasneak.plugin", "No Stamina Sneak", "2.0.0")]
	public sealed class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "local.nostaminasneak.plugin";

		public const string PluginName = "No Stamina Sneak";

		public const string PluginVersion = "2.0.0";

		private Harmony _harmony;

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			_harmony = new Harmony("local.nostaminasneak.plugin");
			_harmony.PatchAll(typeof(Plugin).Assembly);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"No Stamina Sneak 2.0.0 loaded.");
		}

		private void OnDestroy()
		{
			Harmony harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
		}
	}
	[HarmonyPatch(typeof(SEMan), "ModifySneakStaminaUsage")]
	internal static class SneakStaminaPatch
	{
		private static void Postfix(ref float staminaUse, bool minZero, Character ___m_character)
		{
			Player val = (Player)(object)((___m_character is Player) ? ___m_character : null);
			if (val != null && (Object)(object)val == (Object)(object)Player.m_localPlayer)
			{
				staminaUse = 0f;
			}
		}
	}
}