Decompiled source of InfiniteDeadHead Fixed v1.1.0

build/InfiniteDeadHead.Fixed.dll

Decompiled 2 weeks 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("InfiniteDeadHead.Fixed")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("InfiniteDeadHead.Fixed")]
[assembly: AssemblyTitle("InfiniteDeadHead.Fixed")]
[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 BridgeGPT.InfiniteDeadHeadFixed
{
	[BepInPlugin("BridgeGPT.InfiniteDeadHead.Fixed", "Infinite Dead Head (Fixed)", "1.1.0")]
	public sealed class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "BridgeGPT.InfiniteDeadHead.Fixed";

		public const string PluginName = "Infinite Dead Head (Fixed)";

		public const string PluginVersion = "1.1.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("BridgeGPT.InfiniteDeadHead.Fixed");
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Infinite Dead Head Fixed loaded: head energy is restored after the game's energy logic.");
		}

		private void OnDestroy()
		{
			if (_harmony != null)
			{
				_harmony.UnpatchSelf();
				_harmony = null;
			}
		}
	}
	[HarmonyPatch(typeof(SpectateCamera), "HeadEnergyLogic")]
	internal static class SpectateCameraHeadEnergyPatch
	{
		private static readonly FieldInfo HeadEnergy = AccessTools.Field(typeof(SpectateCamera), "headEnergy");

		private static readonly FieldInfo HeadEnergyEnough = AccessTools.Field(typeof(SpectateCamera), "headEnergyEnough");

		[HarmonyPostfix]
		private static void Postfix(SpectateCamera __instance)
		{
			if (!((Object)(object)__instance == (Object)null))
			{
				if (HeadEnergy != null)
				{
					HeadEnergy.SetValue(__instance, 1f);
				}
				if (HeadEnergyEnough != null)
				{
					HeadEnergyEnough.SetValue(__instance, true);
				}
			}
		}
	}
}

src/obj/Release/netstandard2.1/InfiniteDeadHead.Fixed.dll

Decompiled 2 weeks 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("InfiniteDeadHead.Fixed")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("InfiniteDeadHead.Fixed")]
[assembly: AssemblyTitle("InfiniteDeadHead.Fixed")]
[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 BridgeGPT.InfiniteDeadHeadFixed
{
	[BepInPlugin("BridgeGPT.InfiniteDeadHead.Fixed", "Infinite Dead Head (Fixed)", "1.1.0")]
	public sealed class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "BridgeGPT.InfiniteDeadHead.Fixed";

		public const string PluginName = "Infinite Dead Head (Fixed)";

		public const string PluginVersion = "1.1.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("BridgeGPT.InfiniteDeadHead.Fixed");
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Infinite Dead Head Fixed loaded: head energy is restored after the game's energy logic.");
		}

		private void OnDestroy()
		{
			if (_harmony != null)
			{
				_harmony.UnpatchSelf();
				_harmony = null;
			}
		}
	}
	[HarmonyPatch(typeof(SpectateCamera), "HeadEnergyLogic")]
	internal static class SpectateCameraHeadEnergyPatch
	{
		private static readonly FieldInfo HeadEnergy = AccessTools.Field(typeof(SpectateCamera), "headEnergy");

		private static readonly FieldInfo HeadEnergyEnough = AccessTools.Field(typeof(SpectateCamera), "headEnergyEnough");

		[HarmonyPostfix]
		private static void Postfix(SpectateCamera __instance)
		{
			if (!((Object)(object)__instance == (Object)null))
			{
				if (HeadEnergy != null)
				{
					HeadEnergy.SetValue(__instance, 1f);
				}
				if (HeadEnergyEnough != null)
				{
					HeadEnergyEnough.SetValue(__instance, true);
				}
			}
		}
	}
}