Decompiled source of Pocket Rooms MelanieMelicious v1.0.3

MelanieMeliciousPocketRoom.dll

Decompiled 6 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Dawn;
using GameNetcodeStuff;
using HarmonyLib;
using MelanieMeliciousPocketRoom.NetcodePatcher;
using MelaniePocketRoom;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MelaniePocketRoom")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("MelanieMelicious")]
[assembly: AssemblyProduct("MelaniePocketRoom")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
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;
		}
	}
}
public class HarmonyPatches
{
	internal static HashSet<EnemyType> blacklist = new HashSet<EnemyType>();

	internal static bool walkWarp;

	[HarmonyPrefix]
	[HarmonyPatch(typeof(StartOfRound), "Start")]
	[HarmonyAfter(new string[] { "MelanieMelicious.2StoryShip" })]
	private static void PreStart(StartOfRound __instance)
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Object.Instantiate<GameObject>(Plugin.bundle.LoadAsset<GameObject>("Assets/MelaniePocketRoom/Prefab/ShipBound.prefab"), new Vector3(1.3f, 0.3f, -7.5f), Quaternion.identity, __instance.elevatorTransform);
		__instance.shipBounds = (Collider)(object)val.GetComponent<BoxCollider>();
		walkWarp = PocketRoomCfg.walkWarp.Value;
	}

	[HarmonyPostfix]
	[HarmonyPatch(typeof(StartOfRound), "Start")]
	[HarmonyAfter(new string[] { "MelanieMelicious.2StoryShip", "mborsh.WiderShipMod" })]
	private static void PostStart(StartOfRound __instance)
	{
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		Transform val = __instance.elevatorTransform.Find("ShipBoundsTrigger");
		Collider[] array = (Collider[])(object)new Collider[3]
		{
			(Collider)((Component)val).GetComponent<BoxCollider>(),
			__instance.shipInnerRoomBounds,
			__instance.shipStrictInnerRoomBounds
		};
		Collider[] array2 = array;
		foreach (Collider val2 in array2)
		{
			Transform transform = ((Component)val2).transform;
			transform.localPosition += new Vector3(0f, 150f, 0f);
			Transform transform2 = ((Component)val2).transform;
			transform2.localScale += new Vector3(2f, 300f, 2f);
		}
		EnemyType[] array3 = Resources.FindObjectsOfTypeAll<EnemyType>();
		foreach (EnemyType val3 in array3)
		{
			string[] array4 = PocketRoomCfg.warpBlacklist.Value.Split(new char[1] { ',' });
			foreach (string text in array4)
			{
				if (val3.enemyName == text)
				{
					blacklist.Add(val3);
					Plugin.mls.LogInfo((object)$"Found and added {val3} to door teleport blacklist.");
				}
			}
		}
		__instance.shipBounds = (Collider)(object)((Component)__instance.elevatorTransform.Find("ShipBoundsTrigger")).GetComponent<BoxCollider>();
	}

	[HarmonyPostfix]
	[HarmonyPatch(typeof(GameNetworkManager), "Start")]
	private static void NetworkPatch(ref GameNetworkManager __instance)
	{
		((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.unlockList.unlockables[0].prefabObject);
		((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.unlockList.unlockables[1].prefabObject);
		((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.unlockList.unlockables[2].prefabObject);
	}
}
internal static class PocketRoomCfg
{
	internal enum mat
	{
		Wood,
		WoodPlank,
		MetalFlat,
		Glass,
		Blank
	}

	internal static ConfigEntry<bool> stockRoom0;

	internal static ConfigEntry<int> stockRoom0Cost;

	internal static ConfigEntry<bool> bedRoom0;

	internal static ConfigEntry<bool> bedRoom1;

	internal static ConfigEntry<int> bedRoom0Cost;

	internal static ConfigEntry<bool> walkWarp;

	internal static ConfigEntry<string> warpBlacklist;

	internal static ConfigEntry<mat> stockRoom0Floor;

	internal static ConfigEntry<string> stockRoom0FloorHex;

	internal static ConfigEntry<mat> stockRoom0Wall;

	internal static ConfigEntry<string> stockRoom0WallHex;

	internal static ConfigEntry<mat> bedRoom0Floor;

	internal static ConfigEntry<string> bedRoom0FloorHex;

	internal static ConfigEntry<mat> bedRoom0Wall;

	internal static ConfigEntry<string> bedRoom0WallHex;

	internal static ConfigEntry<mat> bedRoom1Floor;

	internal static ConfigEntry<string> bedRoom1FloorHex;

	internal static ConfigEntry<mat> bedRoom1Wall;

	internal static ConfigEntry<string> bedRoom1WallHex;

	internal static void SetupConfig(ConfigFile config)
	{
		stockRoom0 = config.Bind<bool>("Store Toggle", "Enable Stock Room 0", true, "Toggle StockRoom0");
		stockRoom0Cost = config.Bind<int>("Store Toggle", "Stock Room 0 Cost", 500, "Modify the price for StockRoom0.");
		bedRoom0 = config.Bind<bool>("Store Toggle", "Enable Bed Room 0", true, "Toggle BedRoom0");
		bedRoom1 = config.Bind<bool>("Store Toggle", "Enable Bed Room 1", true, "Toggle BedRoom1");
		bedRoom0Cost = config.Bind<int>("Store Toggle", "Small Bed Room Costs", 300, "Modify the prices for Small bedrooms.");
		walkWarp = config.Bind<bool>("Customization", "Walk-In Teleport.", true, "Toggle walk-in teleports when not in build mode.");
		warpBlacklist = config.Bind<string>("Customization", "Enemy Door Warp Blacklist.", "SandWorm,ForestGiant,RadMech,Tornado,Guardsman,Cactus Budling,Driftwood Menace,Redwood Titan,Carnivorous Plant,Elder,Ogopogo,T-rex,Stegosaurus", "Prevent most listed enemies from using doors to pocket rooms.");
		stockRoom0Floor = config.Bind<mat>("Customization", "StockRoom0 Floor Material.", mat.MetalFlat, "Modify material for StockRoom0 floor.");
		stockRoom0FloorHex = config.Bind<string>("Customization", "StockRoom0 Floor Color.", "847A66", "Modify color for StockRoom0 floor.");
		stockRoom0Wall = config.Bind<mat>("Customization", "StockRoom0 Wall Material.", mat.MetalFlat, "Modify material for StockRoom0 wall.");
		stockRoom0WallHex = config.Bind<string>("Customization", "StockRoom0 Wall Color.", "60594F", "Modify color for StockRoom0 wall.");
		bedRoom0Floor = config.Bind<mat>("Customization", "BedRoom0 Floor Material.", mat.WoodPlank, "Modify material for BedRoom0 floor.");
		bedRoom0FloorHex = config.Bind<string>("Customization", "BedRoom0 Floor Color.", "955B25", "Modify color for BedRoom0 floor.");
		bedRoom0Wall = config.Bind<mat>("Customization", "BedRoom0 Wall Material.", mat.Wood, "Modify material for BedRoom0 wall.");
		bedRoom0WallHex = config.Bind<string>("Customization", "BedRoom0 Wall Color.", "F5BFC5", "Modify color for BedRoom0 wall.");
		bedRoom1Floor = config.Bind<mat>("Customization", "BedRoom1 Floor Material.", mat.WoodPlank, "Modify material for BedRoom1 floor.");
		bedRoom1FloorHex = config.Bind<string>("Customization", "BedRoom1 Floor Color.", "594949", "Modify color for BedRoom1 floor.");
		bedRoom1Wall = config.Bind<mat>("Customization", "BedRoom1 Wall Material.", mat.Wood, "Modify material for BedRoom1 wall.");
		bedRoom1WallHex = config.Bind<string>("Customization", "BedRoom1 Wall Color.", "1D4D1F", "Modify color for BedRoom1 wall.");
	}
}
public class RoomTeleport : NetworkBehaviour
{
	[CompilerGenerated]
	private sealed class <TeleportTrigger>d__9 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public NavMeshAgent agent;

		public RoomTeleport <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <TeleportTrigger>d__9(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds((float)<>4__this.teleportTime);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				if (<>4__this.teleport || agent.isOnOffMeshLink)
				{
					agent.Warp(<>4__this.exitPoint.position);
				}
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	public Transform entrancePoint;

	public Transform exitPoint;

	public StartOfRound playersManager;

	public short teleportTime;

	private bool teleport = false;

	private void Awake()
	{
		playersManager = Object.FindObjectOfType<StartOfRound>();
	}

	private void OnTriggerEnter(Collider other)
	{
		EnemyAICollisionDetect val = default(EnemyAICollisionDetect);
		NavMeshAgent agent = default(NavMeshAgent);
		if (((Component)other).gameObject.CompareTag("Player") && Object.op_Implicit((Object)(object)((Component)other).gameObject.GetComponent<PlayerControllerB>()) && (HarmonyPatches.walkWarp || ShipBuildModeManager.Instance.InBuildMode))
		{
			TeleportPlayer();
		}
		else if (((Component)other).gameObject.layer == 19 && ((Component)other).TryGetComponent<EnemyAICollisionDetect>(ref val) && !HarmonyPatches.blacklist.Contains(val.mainScript.enemyType) && ((Component)val.mainScript).TryGetComponent<NavMeshAgent>(ref agent))
		{
			((MonoBehaviour)this).StartCoroutine(TeleportTrigger(agent));
		}
	}

	private void OnTriggerStay(Collider other)
	{
		if (((Component)other).gameObject.layer == 19)
		{
			teleport = true;
		}
	}

	private void OnTriggerExit(Collider other)
	{
		if (((Component)other).gameObject.layer == 19)
		{
			teleport = false;
		}
	}

	[IteratorStateMachine(typeof(<TeleportTrigger>d__9))]
	private IEnumerator TeleportTrigger(NavMeshAgent agent)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <TeleportTrigger>d__9(0)
		{
			<>4__this = this,
			agent = agent
		};
	}

	public void TeleportPlayer()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		Transform thisPlayerBody = GameNetworkManager.Instance.localPlayerController.thisPlayerBody;
		GameNetworkManager.Instance.localPlayerController.TeleportPlayer(exitPoint.position, false, 0f, false, true);
		thisPlayerBody.eulerAngles = new Vector3(thisPlayerBody.eulerAngles.x, exitPoint.eulerAngles.y, thisPlayerBody.eulerAngles.z);
		TeleportPlayerServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId);
	}

	[ServerRpc(RequireOwnership = false)]
	public void TeleportPlayerServerRpc(int playerObj)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2937166773u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerObj);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2937166773u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				base.__rpc_exec_stage = (__RpcExecStage)0;
				TeleportPlayerClientRpc(playerObj);
			}
		}
	}

	[ClientRpc]
	public void TeleportPlayerClientRpc(int playerObj)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Invalid comparison between Unknown and I4
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Invalid comparison between Unknown and I4
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
		if (networkManager == null || !networkManager.IsListening)
		{
			return;
		}
		if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
		{
			ClientRpcParams val = default(ClientRpcParams);
			FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3008848113u, val, (RpcDelivery)0);
			BytePacker.WriteValueBitPacked(val2, playerObj);
			((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3008848113u, val, (RpcDelivery)0);
		}
		if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
		{
			base.__rpc_exec_stage = (__RpcExecStage)0;
			if (!((Object)(object)playersManager.allPlayerScripts[playerObj] == (Object)(object)GameNetworkManager.Instance.localPlayerController))
			{
				playersManager.allPlayerScripts[playerObj].TeleportPlayer(exitPoint.position, true, exitPoint.eulerAngles.y, false, true);
			}
		}
	}

	protected override void __initializeVariables()
	{
		((NetworkBehaviour)this).__initializeVariables();
	}

	protected override void __initializeRpcs()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Expected O, but got Unknown
		((NetworkBehaviour)this).__registerRpc(2937166773u, new RpcReceiveHandler(__rpc_handler_2937166773), "TeleportPlayerServerRpc");
		((NetworkBehaviour)this).__registerRpc(3008848113u, new RpcReceiveHandler(__rpc_handler_3008848113), "TeleportPlayerClientRpc");
		((NetworkBehaviour)this).__initializeRpcs();
	}

	private static void __rpc_handler_2937166773(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			int playerObj = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref playerObj);
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((RoomTeleport)(object)target).TeleportPlayerServerRpc(playerObj);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	private static void __rpc_handler_3008848113(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		NetworkManager networkManager = target.NetworkManager;
		if (networkManager != null && networkManager.IsListening)
		{
			int playerObj = default(int);
			ByteUnpacker.ReadValueBitPacked(reader, ref playerObj);
			target.__rpc_exec_stage = (__RpcExecStage)1;
			((RoomTeleport)(object)target).TeleportPlayerClientRpc(playerObj);
			target.__rpc_exec_stage = (__RpcExecStage)0;
		}
	}

	protected internal override string __getTypeName()
	{
		return "RoomTeleport";
	}
}
namespace MelaniePocketRoom
{
	[BepInPlugin("MelanieMelicious.pocketRoom", "Melanie Melicious - Pocket Rooms", "1.0.3")]
	public class Plugin : BaseUnityPlugin
	{
		private const string GUID = "MelanieMelicious.pocketRoom";

		private const string NAME = "Melanie Melicious - Pocket Rooms";

		private const string VERSION = "1.0.3";

		private readonly Harmony harmony = new Harmony("MelanieMelicious.pocketRoom");

		public static ManualLogSource mls;

		public static AssetBundle bundle;

		public static Plugin instance;

		internal static UnlockablesList unlockList;

		private void Awake()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
			instance = this;
			PocketRoomCfg.SetupConfig(((BaseUnityPlugin)this).Config);
			mls = Logger.CreateLogSource("MelanieMelicious - Pocket Rooms");
			mls = ((BaseUnityPlugin)this).Logger;
			harmony.PatchAll(typeof(HarmonyPatches));
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "melaniepocketroom");
			bundle = AssetBundle.LoadFromFile(text);
			unlockList = bundle.LoadAsset<UnlockablesList>("Assets/MelaniePocketRoom/Asset/Room.asset");
			Material[] array3 = (Material[])(object)new Material[5]
			{
				bundle.LoadAsset<Material>("Assets/MelaniePocketRoom/Material/Wood0.mat"),
				bundle.LoadAsset<Material>("Assets/MelaniePocketRoom/Material/Plank0.mat"),
				bundle.LoadAsset<Material>("Assets/MelaniePocketRoom/Material/MetalFlat0.mat"),
				bundle.LoadAsset<Material>("Assets/MelaniePocketRoom/Material/Glass.mat"),
				bundle.LoadAsset<Material>("Assets/MelaniePocketRoom/Material/Blank.mat")
			};
			if (PocketRoomCfg.stockRoom0.Value)
			{
				Material((Material[])(object)new Material[2]
				{
					array3[(short)PocketRoomCfg.stockRoom0Floor.Value],
					array3[(short)PocketRoomCfg.stockRoom0Wall.Value]
				}, new string[3]
				{
					PocketRoomCfg.stockRoom0FloorHex.Value,
					PocketRoomCfg.stockRoom0WallHex.Value,
					"StockRoom0.1/Model0"
				}, 0);
				NamespacedKey<DawnUnlockableItemInfo> val = NamespacedKey<DawnUnlockableItemInfo>.From("MelaniePocketRoom", "MelMStockRoom0");
				DawnLib.RegisterNetworkPrefab(unlockList.unlockables[0].prefabObject);
				DawnLib.DefineUnlockable(val, unlockList.unlockables[0], (Action<UnlockableInfoBuilder>)delegate(UnlockableInfoBuilder builder)
				{
					builder.SetCost(PocketRoomCfg.stockRoom0Cost.Value);
				});
			}
			if (PocketRoomCfg.bedRoom0.Value)
			{
				Material((Material[])(object)new Material[3]
				{
					array3[(short)PocketRoomCfg.bedRoom0Floor.Value],
					array3[(short)PocketRoomCfg.bedRoom0Wall.Value],
					array3[3]
				}, new string[3]
				{
					PocketRoomCfg.bedRoom0FloorHex.Value,
					PocketRoomCfg.bedRoom0WallHex.Value,
					"BedRoom0.1/Model0"
				}, 1);
				NamespacedKey<DawnUnlockableItemInfo> val2 = NamespacedKey<DawnUnlockableItemInfo>.From("MelaniePocketRoom", "MelMBedRoom0");
				DawnLib.RegisterNetworkPrefab(unlockList.unlockables[1].prefabObject);
				DawnLib.DefineUnlockable(val2, unlockList.unlockables[1], (Action<UnlockableInfoBuilder>)delegate(UnlockableInfoBuilder builder)
				{
					builder.SetCost(PocketRoomCfg.bedRoom0Cost.Value);
				});
			}
			if (PocketRoomCfg.bedRoom1.Value)
			{
				Material((Material[])(object)new Material[3]
				{
					array3[(short)PocketRoomCfg.bedRoom1Floor.Value],
					array3[(short)PocketRoomCfg.bedRoom1Wall.Value],
					array3[3]
				}, new string[3]
				{
					PocketRoomCfg.bedRoom1FloorHex.Value,
					PocketRoomCfg.bedRoom1WallHex.Value,
					"BedRoom1.1/Model0"
				}, 2);
				NamespacedKey<DawnUnlockableItemInfo> val3 = NamespacedKey<DawnUnlockableItemInfo>.From("MelaniePocketRoom", "MelMBedRoom1");
				DawnLib.RegisterNetworkPrefab(unlockList.unlockables[2].prefabObject);
				DawnLib.DefineUnlockable(val3, unlockList.unlockables[2], (Action<UnlockableInfoBuilder>)delegate(UnlockableInfoBuilder builder)
				{
					builder.SetCost(PocketRoomCfg.bedRoom0Cost.Value);
				});
			}
		}

		private static void Material(Material[] mat, string[] hex, short id)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			MeshRenderer component = ((Component)unlockList.unlockables[id].prefabObject.transform.Find(hex[2])).GetComponent<MeshRenderer>();
			((Renderer)component).materials = mat;
			Material[] materials = ((Renderer)component).materials;
			Color[] array = (Color[])(object)new Color[2]
			{
				Color.clear,
				Color.clear
			};
			ColorUtility.TryParseHtmlString("#" + hex[0], ref array[0]);
			ColorUtility.TryParseHtmlString("#" + hex[1], ref array[1]);
			materials[0].color = array[0];
			materials[1].color = array[1];
		}
	}
}
namespace __GEN
{
	internal class NetworkVariableSerializationHelper
	{
		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeSerialization()
		{
		}
	}
}
namespace MelanieMeliciousPocketRoom.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}