Decompiled source of NoGordionDeathPenalty v1.0.0

NoGordionDeathPenalty.dll

Decompiled 7 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using NoGordionDeathPenalty.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("NoGordionDeathPenalty")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NoGordionDeathPenalty")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f6f89b27-367f-4054-891c-eb4873e23b2e")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NoGordionDeathPenalty
{
	[BepInPlugin("NoGordionDeathPenalty", "NoGordionDeathPenalty", "1.0.0")]
	public class NoGordionDeathPenaltyPlugin : BaseUnityPlugin
	{
		public Harmony harmony;

		internal static NoGordionDeathPenaltyPlugin Instance;

		internal ManualLogSource mls;

		internal bool allPlayersDeadPreviously;

		private void Awake()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("NoGordionDeathPenalty");
			mls.LogInfo((object)"NoGordionDeathPenalty has awakened");
			harmony = new Harmony("NoGordionDeathPenalty");
			mls.LogInfo((object)"Trying to patch this");
			harmony.PatchAll(typeof(NoGordionDeathPenaltyPlugin));
			mls.LogInfo((object)"Trying to patch gameover");
			harmony.PatchAll(typeof(GameOverPatches));
			mls.LogInfo((object)"patched ");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "NoGordionDeathPenalty";

		public const string PLUGIN_NAME = "NoGordionDeathPenalty";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace NoGordionDeathPenalty.Patches
{
	[HarmonyPatch]
	internal class GameOverPatches
	{
		[HarmonyPatch(typeof(HUDManager), "ApplyPenalty")]
		[HarmonyPrefix]
		public static void PatchGameOverPre(HUDManager __instance, ref int playersDead, ref int bodiesInsured)
		{
			NoGordionDeathPenaltyPlugin.Instance.mls.LogInfo((object)"ApplyPenalty started");
			string sceneName = RoundManager.Instance.currentLevel.sceneName;
			NoGordionDeathPenaltyPlugin.Instance.mls.LogInfo((object)(playersDead + " " + bodiesInsured));
			if (sceneName == "CompanyBuilding")
			{
				playersDead = 0;
				bodiesInsured = 0;
			}
			NoGordionDeathPenaltyPlugin.Instance.mls.LogInfo((object)(playersDead + " " + bodiesInsured));
			NoGordionDeathPenaltyPlugin.Instance.mls.LogInfo((object)("Level: " + sceneName));
			NoGordionDeathPenaltyPlugin.Instance.mls.LogInfo((object)"Crashed?");
		}
	}
}