Decompiled source of Invincible Bridge v1.0.0

InvincibleBridge.dll

Decompiled 10 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using InvincibleBridge.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("InvincibleBridge")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("InvincibleBridge")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("15aa5b61-cd70-4444-8aae-38d93259392e")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace InvincibleBridge
{
	[BepInPlugin("SpiralMods.InvincibleBridge", "Invincible Bridge", "1.0.0")]
	public class InvincibleBridgeBase : BaseUnityPlugin
	{
		private const string modGUID = "SpiralMods.InvincibleBridge";

		private const string modName = "Invincible Bridge";

		private const string modVersion = "1.0.0";

		public static ConfigEntry<bool> ModActivated;

		private readonly Harmony harmony = new Harmony("SpiralMods.InvincibleBridge");

		private static InvincibleBridgeBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("SpiralMods.InvincibleBridge");
			mls.LogInfo((object)"Invincible Bridge has loaded.");
			SetBindings();
			harmony.PatchAll(typeof(InvincibleBridgeBase));
			harmony.PatchAll(typeof(BridgePatch));
			harmony.PatchAll(typeof(BridgeTrigger));
		}

		private void SetBindings()
		{
			ModActivated = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Enable Invincible Bridge", true, "If true, the bridge on Vow will never collapse!");
		}
	}
}
namespace InvincibleBridge.Patches
{
	[HarmonyPatch(typeof(BridgeTrigger))]
	internal class BridgePatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate(ref float ___bridgeDurability)
		{
			bool flag = true;
			if (InvincibleBridgeBase.ModActivated.Value)
			{
				___bridgeDurability = 1f;
			}
		}
	}
}