Decompiled source of LethalSnooteam v1.1.0

LethalSnooteam.dll

Decompiled 16 hours ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
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("LethalSnooteam")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1")]
[assembly: AssemblyProduct("LethalSnooteam")]
[assembly: AssemblyTitle("LethalSnooteam")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 LethalSnooteam
{
	[BepInPlugin("LethalSnooteam", "LethalSnooteam", "0.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class LethalSnooteam : BaseUnityPlugin
	{
		public static AssetBundle LethalSnooteamCustomAssets;

		public static AssetBundle LethalSnooteamBigMommyAssets;

		public static AssetBundle LethalSnooteamEggBoxAssets;

		public static LethalSnooteam Instance { get; private set; }

		internal static ManualLogSource Logger { get; private set; }

		internal static Harmony? Harmony { get; set; }

		private void Awake()
		{
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			LethalSnooteamCustomAssets = AssetBundle.LoadFromFile(Path.Combine(directoryName, "dagothurpillowscrap"));
			if ((Object)(object)LethalSnooteamCustomAssets == (Object)null)
			{
				Logger.LogError((object)"Assets (dagoth ur) pas chargé");
				return;
			}
			LethalSnooteamBigMommyAssets = AssetBundle.LoadFromFile(Path.Combine(directoryName, "bigmommyscrap"));
			if ((Object)(object)LethalSnooteamBigMommyAssets == (Object)null)
			{
				Logger.LogError((object)"Assets (big mommy) pas chargé");
				return;
			}
			LethalSnooteamEggBoxAssets = AssetBundle.LoadFromFile(Path.Combine(directoryName, "eggboxscrap"));
			if ((Object)(object)LethalSnooteamEggBoxAssets == (Object)null)
			{
				Logger.LogError((object)"Assets (egg box casino label rouge) pas chargé");
				return;
			}
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			int num = 15;
			Item val = LethalSnooteamCustomAssets.LoadAsset<Item>("Assets/DagothUrPillow.asset");
			if ((Object)(object)val == (Object)null)
			{
				Logger.LogError((object)"DagothUrBodyPillow pas chargé, what a fool you are!");
				return;
			}
			Logger.LogInfo((object)"DagothUrBodyPillow chargé, I have prepared a place for you my sweet Nerevar...");
			NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
			Items.RegisterScrap(val, num, (LevelTypes)(-1));
			int num2 = 12;
			Item val2 = LethalSnooteamBigMommyAssets.LoadAsset<Item>("Assets/BigMommy.asset");
			if ((Object)(object)val2 == (Object)null)
			{
				Logger.LogError((object)"Big Mommy Nuke pas chargée...");
				return;
			}
			Logger.LogInfo((object)"Big Mommy chargée.");
			NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
			Items.RegisterScrap(val2, num2, (LevelTypes)(-1));
			int num3 = 25;
			Item val3 = LethalSnooteamEggBoxAssets.LoadAsset<Item>("Assets/EggBox.asset");
			if ((Object)(object)val3 == (Object)null)
			{
				Logger.LogError((object)"Egg box casino label rouge pas chargée...");
				return;
			}
			Logger.LogInfo((object)"Egg box casino label rouge chargée.");
			NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab);
			Items.RegisterScrap(val3, num3, (LevelTypes)(-1));
			Patch();
			Logger.LogInfo((object)"LethalSnooteam v0.1 has FINALLY loaded! YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEES!!");
		}

		internal static void Patch()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			if (Harmony == null)
			{
				Harmony = new Harmony("LethalSnooteam");
			}
			Logger.LogDebug((object)"Patching...");
			Harmony.PatchAll();
			Logger.LogDebug((object)"Finished patching! (It's a lie we don't patch anything but I'm too scared for taking out this line of code.");
		}

		internal static void Unpatch()
		{
			Logger.LogDebug((object)"Unpatching...");
			Harmony? harmony = Harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			Logger.LogDebug((object)"Finished unpatching! Same here.");
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "LethalSnooteam";

		public const string PLUGIN_NAME = "LethalSnooteam";

		public const string PLUGIN_VERSION = "0.1";
	}
}
namespace LethalSnooteam.Patches
{
	[HarmonyPatch(typeof(TVScript))]
	public class ExampleTVPatch
	{
		[HarmonyPatch("SwitchTVLocalClient")]
		[HarmonyPrefix]
		private static void SwitchTVPrefix(TVScript __instance)
		{
			StartOfRound.Instance.shipRoomLights.SetShipLightsBoolean(__instance.tvOn);
		}
	}
}