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 Potuzhnyy.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: 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+e26360f7c96fa668bb8320c512c7b0f93350c8c4")]
[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 void Awake()
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Potuzhnyy is loaded!");
harmony.PatchAll(typeof(Plugin));
harmony.PatchAll(typeof(StartOfRoundPatch));
RegisterItem();
}
private void RegisterItem()
{
string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "itemmod");
AssetBundle val = AssetBundle.LoadFromFile(text);
Item val2 = val.LoadAsset<Item>("Assets/MaxonPillowItem.asset");
NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
Utilities.FixMixerGroups(val2.spawnPrefab);
Items.RegisterScrap(val2, 35, (LevelTypes)(-1));
((BaseUnityPlugin)this).Logger.LogInfo((object)"MaxonPillow 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<InteractTrigger>(ref val2) && ((Component)val.transform.GetChild(1).GetChild(0)).TryGetComponent<InteractTrigger>(ref val2))
{
Object.Destroy((Object)(object)((Component)val.transform.GetChild(0)).gameObject);
}
}
}
}