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 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("Potuzhnyy")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("A template for Lethal Company")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+bd76df7a988bca887406379f90525ae737068798")] [assembly: AssemblyProduct("Potuzhnyy")] [assembly: AssemblyTitle("Potuzhnyy")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.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 Potuzhnyy { [BepInPlugin("Potuzhnyy", "Potuzhnyy", "1.0.0")] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("Potuzhnyy"); private AssetBundle bundle; private void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Potuzhnyy is loading..."); harmony.PatchAll(typeof(Plugin)); RegisterItems(); } private void RegisterItems() { string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "itemmod"); bundle = AssetBundle.LoadFromFile(text); RegisterItem("Assets/MaxonPillowItem.asset", 10); RegisterItem("Assets/ValikPillowItem.asset", 10); } private void RegisterItem(string path, int rarity) { Item val = bundle.LoadAsset(path); NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); Utilities.FixMixerGroups(val.spawnPrefab); Items.RegisterScrap(val, rarity, (LevelTypes)(-1)); ((BaseUnityPlugin)this).Logger.LogInfo((object)(path + " registered")); } } public static class PluginInfo { public const string PLUGIN_GUID = "Potuzhnyy"; public const string PLUGIN_NAME = "Potuzhnyy"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace Potuzhnyy.Patches { internal static class StartOfRoundPatch { [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyPostfix] [HarmonyPriority(600)] private static void Start(StartOfRound __instance) { GameObject val = GameObject.Find("StorageCloset"); InteractTrigger val2 = default(InteractTrigger); if (Object.op_Implicit((Object)(object)val) && val.transform.childCount > 1 && val.transform.GetChild(0).childCount > 0 && val.transform.GetChild(1).childCount > 0 && ((Component)val.transform.GetChild(0).GetChild(0)).TryGetComponent(ref val2) && ((Component)val.transform.GetChild(1).GetChild(0)).TryGetComponent(ref val2)) { Object.Destroy((Object)(object)((Component)val.transform.GetChild(0)).gameObject); } } } }