Decompiled source of FirebrandModTest v0.1.0

FierbrandModTest.dll

Decompiled 9 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using FirebrandModTest.Patches;
using FirebrandModTest.Utils;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("FierbrandModTest")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Im Making Mods Now")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("FierbrandModTest")]
[assembly: AssemblyTitle("FierbrandModTest")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 FirebrandModTest
{
	[BepInPlugin("com.LayEpicFirebrand.FirebrandModTest", "FirebrandModTest", "0.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string modGUID = "com.LayEpicFirebrand.FirebrandModTest";

		public const string modName = "FirebrandModTest";

		public const string modVersion = "0.1.0";

		private static Harmony _harmony = new Harmony("com.LayEpicFirebrand.FirebrandModTest");

		internal static ManualLogSource mls = Logger.CreateLogSource("com.LayEpicFirebrand.FirebrandModTest");

		private void Awake()
		{
			mls.LogInfo((object)"FIREBRAND MOD LOADED");
			LCConfig.AllConfigs(((BaseUnityPlugin)this).Config);
			PatchAllStuff();
		}

		private static void PatchAllStuff()
		{
			_harmony.PatchAll(typeof(PlayerControllerBPatch));
			_harmony.PatchAll(typeof(ShipLightsPatch));
			_harmony.PatchAll(typeof(HangarShipDoorPatch));
			_harmony.PatchAll(typeof(InteractTriggerPatch));
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "FierbrandModTest";

		public const string PLUGIN_NAME = "FierbrandModTest";

		public const string PLUGIN_VERSION = "0.1.0";
	}
}
namespace FirebrandModTest.Utils
{
	internal class LCConfig
	{
		public static ConfigEntry<string> chatMsg;

		public static void AllConfigs(ConfigFile cfg)
		{
			chatMsg = cfg.Bind<string>("Player Controls", "Chat Msg", "4", (ConfigDescription)null);
		}
	}
}
namespace FirebrandModTest.Patches
{
	[HarmonyPatch(typeof(HangarShipDoor))]
	internal class HangarShipDoorPatch
	{
		[HarmonyPatch("SetDoorOpen")]
		[HarmonyPostfix]
		private static void SetDoorOpenPatch()
		{
		}
	}
	[HarmonyPatch(typeof(InteractTrigger))]
	internal class InteractTriggerPatch
	{
		[HarmonyPatch("Interact")]
		[HarmonyPostfix]
		private static void InteractPatch(InteractTrigger __instance)
		{
			if (!GameNetworkManager.Instance.gameHasStarted)
			{
				if (((Object)__instance).name.Contains("Cube (2)"))
				{
					HUDManager.Instance.DisplayTip("YOU SOLD", "You ong just killed everyone", true, false, "LC_Tip1");
					StartOfRound.Instance.ManuallyEjectPlayersServerRpc();
				}
				Plugin.mls.LogInfo((object)((Object)__instance).name);
			}
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void UpdatePatch(PlayerControllerB __instance)
		{
		}

		[HarmonyPatch("DamagePlayer")]
		[HarmonyPrefix]
		private static bool DamagePatch()
		{
			return true;
		}
	}
	[HarmonyPatch(typeof(ShipLights))]
	internal class ShipLightsPatch
	{
		[HarmonyPatch("ToggleShipLights")]
		[HarmonyPostfix]
		private static void ToggleShipLightsPatch(ShipLights __instance)
		{
			if (!__instance.areLightsOn)
			{
				HUDManager.Instance.DisplayTip("Warning:", "Stop turning off lights", true, false, "LC_Tip1");
				__instance.ToggleShipLights();
			}
		}
	}
}