using System;
using System.Collections.Generic;
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.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
using MelanieMeliciousFurniture;
using MelanieMeliciousUtilFurniture.NetcodePatcher;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
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(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
static <Module>()
{
}
}
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;
}
}
}
public class FireExitPatch
{
private static GameObject fireEntrance;
private static GameObject fireWarn;
[HarmonyPrefix]
[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
private static void PreLevelLoad()
{
fireEntrance = GameObject.Find("EntranceTeleportShip0");
if ((Object)(object)fireWarn == (Object)null)
{
fireWarn = GameObject.Find("EntranceTeleportWarning");
}
try
{
((Behaviour)fireEntrance.GetComponent<EntranceTeleport>()).enabled = true;
((Behaviour)fireEntrance.GetComponent<InteractTrigger>()).enabled = true;
((Collider)fireEntrance.GetComponent<BoxCollider>()).enabled = true;
fireEntrance.transform.parent.SetParent(GameObject.Find("Environment/Teleports").transform);
((Collider)fireWarn.GetComponent<BoxCollider>()).enabled = false;
}
catch
{
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(StartOfRound), "ShipHasLeft")]
private static void PreShipLeft()
{
if ((Object)(object)fireEntrance != (Object)null)
{
((Behaviour)fireEntrance.GetComponent<EntranceTeleport>()).enabled = false;
((Behaviour)fireEntrance.GetComponent<InteractTrigger>()).enabled = false;
((Collider)fireEntrance.GetComponent<BoxCollider>()).enabled = false;
}
if ((Object)(object)fireWarn != (Object)null)
{
((Collider)fireWarn.GetComponent<BoxCollider>()).enabled = true;
}
}
}
public class HarmonyPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(GameNetworkManager), "Start")]
private static void NetworkPatch(ref GameNetworkManager __instance)
{
((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.unlockList.unlockables[21].prefabObject);
}
}
internal static class MelanieUtilFurnitureConfig
{
internal enum fireExit
{
Both,
Entrance,
Exit
}
internal enum mat
{
Metal,
Wood
}
internal enum chair
{
Industrial,
Victorian
}
internal enum bed
{
Industrial_Single,
Industrial_Double,
Victorian_Single,
Victorian_Double
}
internal enum wall
{
Wall,
Gate,
Window_Door,
Office_Door,
Solid_Door,
Panel_Door
}
internal static ConfigEntry<bool> alwaysStock;
internal static ConfigEntry<bool> fireExit0Enable;
internal static ConfigEntry<bool> wallEnable;
internal static ConfigEntry<bool> xmasEnable;
internal static ConfigEntry<bool> moveEnable;
internal static ConfigEntry<bool> posterEnable;
internal static ConfigEntry<bool> workshop0;
internal static ConfigEntry<bool> workTable0;
internal static ConfigEntry<bool> wideCabinet0;
internal static ConfigEntry<bool> bed0;
internal static ConfigEntry<bool> tree0;
internal static ConfigEntry<bool> benchTable0;
internal static ConfigEntry<bool> fern0;
internal static ConfigEntry<bool> fire0;
internal static ConfigEntry<bool> counter0;
internal static ConfigEntry<bool> lamp0;
internal static ConfigEntry<bool> aquarium0;
internal static ConfigEntry<bool> chair0;
internal static ConfigEntry<bool> shelf0;
internal static ConfigEntry<bool> instrument;
internal static ConfigEntry<fireExit> fireExit0Type;
internal static ConfigEntry<bed> bed0Type;
internal static ConfigEntry<bed> bed1Type;
internal static ConfigEntry<bed> bed2Type;
internal static ConfigEntry<bed> bed3Type;
internal static ConfigEntry<chair> chair0Type;
internal static ConfigEntry<chair> chair1Type;
internal static ConfigEntry<chair> chair2Type;
internal static ConfigEntry<chair> chair3Type;
internal static ConfigEntry<mat> wall0Mat;
internal static ConfigEntry<mat> wall1Mat;
internal static ConfigEntry<mat> wall2Mat;
internal static ConfigEntry<mat> door0Mat;
internal static ConfigEntry<mat> door1Mat;
internal static ConfigEntry<mat> door2Mat;
internal static ConfigEntry<mat> door3Mat;
internal static ConfigEntry<string> wall0Hex;
internal static ConfigEntry<string> wall1Hex;
internal static ConfigEntry<string> door0Hex;
internal static ConfigEntry<string> door1Hex;
internal static ConfigEntry<string> frameHex;
internal static ConfigEntry<wall> wall0Type;
internal static ConfigEntry<wall> wall1Type;
internal static ConfigEntry<wall> wall2Type;
internal static ConfigEntry<wall> wall3Type;
internal static ConfigEntry<wall> wall4Type;
internal static ConfigEntry<wall> wall5Type;
internal static ConfigEntry<wall> wall6Type;
internal static ConfigEntry<wall> wall7Type;
internal static ConfigEntry<wall> wall8Type;
internal static ConfigEntry<wall> wall9Type;
internal static ConfigEntry<wall> wall10Type;
internal static ConfigEntry<wall> wall11Type;
internal static ConfigEntry<wall> wall12Type;
internal static ConfigEntry<wall> wall13Type;
internal static ConfigEntry<wall> wall14Type;
internal static ConfigEntry<int> workshop0Cost;
internal static ConfigEntry<int> workTable0Cost;
internal static ConfigEntry<int> cabinetWide0Cost;
internal static ConfigEntry<int> wall0Cost;
internal static ConfigEntry<int> fireExit0Cost;
internal static ConfigEntry<int> bedTwin0Cost;
internal static ConfigEntry<int> treeBig0Cost;
internal static ConfigEntry<int> benchTable0Cost;
internal static ConfigEntry<int> fern0Cost;
internal static ConfigEntry<int> fireplaceCost;
internal static ConfigEntry<int> lamp0Cost;
internal static ConfigEntry<int> moveCost;
internal static ConfigEntry<int> aqua0Cost;
internal static ConfigEntry<int> posterCost;
internal static ConfigEntry<int> chair0Cost;
internal static ConfigEntry<int> floorPianoCost;
internal static ConfigEntry<int> treeLootChance;
internal static ConfigEntry<int> treeLootMin;
internal static ConfigEntry<int> treeLootMax;
internal static ConfigEntry<int> xmasLootChance;
internal static void SetupConfig(ConfigFile config)
{
alwaysStock = config.Bind<bool>("Store Toggle", "Items Always In Stock", true, "Toggle if furniture is always in stock, or put into rotation.");
fireExit0Enable = config.Bind<bool>("Store Toggle", "Enable Fire Exit", true, "Toggle buyable fire exit.");
wallEnable = config.Bind<bool>("Store Toggle", "Enable Walls", true, "Toggle buyable walls.");
xmasEnable = config.Bind<bool>("Store Toggle", "Enable XMAS Decor", true, "Toggle XMAS decor.");
moveEnable = config.Bind<bool>("Store Toggle", "Enable Moveable Ship Parts", true, "Toggle buyable ability to move certain ship parts. Example, the charger.");
posterEnable = config.Bind<bool>("Store Toggle", "Enable Posters", true, "Toggle moveable posters based on ship posters (affected by poster-changing mods).");
workshop0 = config.Bind<bool>("Store Toggle", "Enable Workshop", true, "Toggle workshop.");
workTable0 = config.Bind<bool>("Store Toggle", "Enable Work Table", true, "Toggle work table.");
wideCabinet0 = config.Bind<bool>("Store Toggle", "Enable Wide Cabinet", true, "Toggle wide cabinet.");
bed0 = config.Bind<bool>("Store Toggle", "Enable Twin Bed", true, "Toggle twin bed.");
tree0 = config.Bind<bool>("Store Toggle", "Enable Trees", true, "Toggle trees.");
benchTable0 = config.Bind<bool>("Store Toggle", "Enable Bench Table", true, "Toggle bench table.");
fern0 = config.Bind<bool>("Store Toggle", "Enable Ferns", true, "Toggle ferns.");
fire0 = config.Bind<bool>("Store Toggle", "Enable Fireplace", true, "Toggle fireplace.");
counter0 = config.Bind<bool>("Store Toggle", "Enable Counter", true, "Toggle counter.");
lamp0 = config.Bind<bool>("Store Toggle", "Enable Lamp", true, "Toggle lamp.");
aquarium0 = config.Bind<bool>("Store Toggle", "Enable Aquarium", true, "Toggle aquarium.");
chair0 = config.Bind<bool>("Store Toggle", "Enable Chairs", true, "Toggle chairs.");
shelf0 = config.Bind<bool>("Store Toggle", "Enable Shelves", true, "Toggle shelves.");
instrument = config.Bind<bool>("Store Toggle", "Enable Instruments", true, "Toggle playable instruments.");
fireExit0Type = config.Bind<fireExit>("Fire Exit", "Fire Exit Type", fireExit.Both, "Toggle fire exit mode, for normal, entrance-only, and exit-only.");
bed0Type = config.Bind<bed>("Style", "Bed0 Type", bed.Victorian_Double, "Toggle bed type.");
bed1Type = config.Bind<bed>("Style", "Bed1 Type", bed.Victorian_Single, "Toggle bed type.");
bed2Type = config.Bind<bed>("Style", "Bed2 Type", bed.Industrial_Double, "Toggle bed type.");
bed3Type = config.Bind<bed>("Style", "Bed3 Type", bed.Industrial_Single, "Toggle bed type.");
chair0Type = config.Bind<chair>("Style", "Chair0 Style", chair.Victorian, "Toggle chair type.");
chair1Type = config.Bind<chair>("Style", "Chair1 Style", chair.Victorian, "Toggle chair type.");
chair2Type = config.Bind<chair>("Style", "Chair2 Style", chair.Victorian, "Toggle chair type.");
chair3Type = config.Bind<chair>("Style", "Chair3 Style", chair.Victorian, "Toggle chair type.");
wall0Mat = config.Bind<mat>("Style", "Walls 0-4 Materials", mat.Metal, "Toggle walls 0-4 materials.");
wall1Mat = config.Bind<mat>("Style", "Walls 5-9 Materials", mat.Metal, "Toggle walls 5-9 materials.");
wall2Mat = config.Bind<mat>("Style", "Walls 10-14 Materials", mat.Metal, "Toggle walls 10-14 materials.");
door0Mat = config.Bind<mat>("Style", "Windowed Door Material", mat.Metal, "Toggle windowed door material.");
door1Mat = config.Bind<mat>("Style", "Office Door Material", mat.Metal, "Toggle office door material.");
door2Mat = config.Bind<mat>("Style", "Solid Door Material", mat.Metal, "Toggle solid door material.");
door3Mat = config.Bind<mat>("Style", "Panel Door Material", mat.Wood, "Toggle panel door material.");
wall0Hex = config.Bind<string>("Style", "Metal Wall Color", "60594F", "Toggle metal wall color.");
wall1Hex = config.Bind<string>("Style", "Wood Wall Color", "FF5A5A", "Toggle wood wall color.");
door0Hex = config.Bind<string>("Style", "Metal Door Color", "6B6555", "Toggle metal door color.");
door1Hex = config.Bind<string>("Style", "Wood Door Color", "735943", "Toggle wood door color.");
frameHex = config.Bind<string>("Style", "Door Frame Color", "2E2E2E", "Toggle door frame color.");
wall0Type = config.Bind<wall>("Style", "Wall0 Type", wall.Wall, "Toggle wall type.");
wall1Type = config.Bind<wall>("Style", "Wall1 Type", wall.Wall, "Toggle wall type.");
wall2Type = config.Bind<wall>("Style", "Wall2 Type", wall.Wall, "Toggle wall type.");
wall3Type = config.Bind<wall>("Style", "Wall3 Type", wall.Wall, "Toggle wall type.");
wall4Type = config.Bind<wall>("Style", "Wall4 Type", wall.Wall, "Toggle wall type.");
wall5Type = config.Bind<wall>("Style", "Wall5 Type", wall.Wall, "Toggle wall type.");
wall6Type = config.Bind<wall>("Style", "Wall6 Type", wall.Wall, "Toggle wall type.");
wall7Type = config.Bind<wall>("Style", "Wall7 Type", wall.Wall, "Toggle wall type.");
wall8Type = config.Bind<wall>("Style", "Wall8 Type", wall.Window_Door, "Toggle wall type.");
wall9Type = config.Bind<wall>("Style", "Wall9 Type", wall.Window_Door, "Toggle wall type.");
wall10Type = config.Bind<wall>("Style", "Wall10 Type", wall.Office_Door, "Toggle wall type.");
wall11Type = config.Bind<wall>("Style", "Wall11 Type", wall.Solid_Door, "Toggle wall type.");
wall12Type = config.Bind<wall>("Style", "Wall12 Type", wall.Panel_Door, "Toggle wall type.");
wall13Type = config.Bind<wall>("Style", "Wall13 Type", wall.Panel_Door, "Toggle wall type.");
wall14Type = config.Bind<wall>("Style", "Wall14 Type", wall.Gate, "Toggle wall type.");
workshop0Cost = config.Bind<int>("Prices", "Workshop 1 Cost", 100, "Modify the price for Workshop 1.");
workTable0Cost = config.Bind<int>("Prices", "Work Table 1 Cost", 60, "Modify the price for Work Table 1.");
cabinetWide0Cost = config.Bind<int>("Prices", "Wide Cabinet Cost", 50, "Modify the price for Wide Cabinet.");
wall0Cost = config.Bind<int>("Prices", "Wall Costs", 35, "Modify the price for the walls.");
fireExit0Cost = config.Bind<int>("Prices", "Fire Exit Cost", 2000, "Modify the price for the fire exit.");
bedTwin0Cost = config.Bind<int>("Prices", "Bed Costs", 150, "Modify the price for the twin bed.");
treeBig0Cost = config.Bind<int>("Prices", "Large Tree", 250, "Modify the price for large trees.");
benchTable0Cost = config.Bind<int>("Prices", "Bench Table", 70, "Modify the price for bench tables.");
fern0Cost = config.Bind<int>("Prices", "Fern", 40, "Modify the price for ferns.");
fireplaceCost = config.Bind<int>("Prices", "Fireplace", 100, "Modify the price for the fireplace.");
lamp0Cost = config.Bind<int>("Prices", "Lamp", 50, "Modify the price for the lamp.");
moveCost = config.Bind<int>("Prices", "Move Ability", 0, "Modify the price for gaining the ability to move each ship object.");
aqua0Cost = config.Bind<int>("Prices", "Aquarium", 100, "Modify the price for the aquarium.");
posterCost = config.Bind<int>("Prices", "Posters", 20, "Modify the price for posters.");
chair0Cost = config.Bind<int>("Prices", "Chair", 40, "Modify the price for chairs.");
floorPianoCost = config.Bind<int>("Prices", "Floor Piano", 100, "Modify the price for floor piano.");
treeLootChance = config.Bind<int>("Loot", "Tree Items Chance", 2, "Modify the percent chance for beehives to fall out of buyable trees.");
treeLootMin = config.Bind<int>("Loot", "Trees Items Minimum", 10, "Modify the minimum value of beehives from trees.");
treeLootMax = config.Bind<int>("Loot", "Trees Items Maximum", 40, "Modify the maximum value of beehives from trees.");
xmasLootChance = config.Bind<int>("Loot", "XMAS Tree Ornament Influence", 1, "Modify how much items placed on the tree increase the percent chance for gifts to spawn under it.");
}
}
public class Reparent : MonoBehaviour
{
public string objName;
public Vector3 objPos;
public Vector3 objRot;
private void Awake()
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
try
{
Transform transform = GameObject.Find(objName).transform;
transform.SetParent(((Component)this).transform);
transform.localPosition = objPos;
transform.localEulerAngles = objRot;
}
catch
{
Plugin.mls.LogError((object)("Failed to reparent " + objName));
}
}
}
public class Retexture : MonoBehaviour
{
public string objName;
public short index;
private void Start()
{
try
{
((Renderer)((Component)this).GetComponent<MeshRenderer>()).SetMaterials(new List<Material>(1) { ((Renderer)GameObject.Find(objName).GetComponent<MeshRenderer>()).materials[index] });
}
catch
{
Plugin.mls.LogError((object)("Failed to retexture " + objName));
}
}
}
public class TreePatch
{
private static int[] itemIndex = new int[2];
private static int ornament;
private static GameObject tree0;
private static GameObject tree1;
private static GameObject xmas0;
[HarmonyPostfix]
[HarmonyPatch(typeof(StartOfRound), "Start")]
[HarmonyAfter(new string[] { "MelanieMelicious.2StoryShip" })]
private static void StartPatch()
{
try
{
foreach (Item items in StartOfRound.Instance.allItemsList.itemsList)
{
if (items.itemName == "Hive")
{
itemIndex = new int[2]
{
StartOfRound.Instance.allItemsList.itemsList.IndexOf(items),
itemIndex[1]
};
}
else if (items.itemName == "Gift")
{
itemIndex = new int[2]
{
itemIndex[0],
StartOfRound.Instance.allItemsList.itemsList.IndexOf(items)
};
}
}
}
catch
{
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
private static void PreLevelPatch()
{
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Expected O, but got Unknown
if ((Object)(object)xmas0 == (Object)null)
{
xmas0 = GameObject.Find("TreeXMAS0(Clone)");
}
if (!((Object)(object)xmas0 != (Object)null))
{
return;
}
ornament = -7;
foreach (Transform item in xmas0.transform)
{
Transform val = item;
ornament++;
}
ornament *= MelanieUtilFurnitureConfig.xmasLootChance.Value;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(TimeOfDay), "OnHourChanged")]
private static void HourPatch()
{
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Expected O, but got Unknown
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_0299: Unknown result type (might be due to invalid IL or missing references)
//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Expected O, but got Unknown
//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
if (!GameNetworkManager.Instance.isHostingGame)
{
return;
}
if ((Object)(object)tree0 == (Object)null)
{
tree0 = GameObject.Find("Tree0ItemSpawn");
}
if ((Object)(object)tree0 != (Object)null)
{
foreach (Transform item in tree0.transform)
{
Transform val = item;
if (Random.Range(0, 99) < MelanieUtilFurnitureConfig.treeLootChance.Value)
{
GameObject val2 = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[itemIndex[0]].spawnPrefab, val.position, val.rotation);
val2.GetComponent<NetworkObject>().Spawn(false);
val2.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieUtilFurnitureConfig.treeLootMin.Value, MelanieUtilFurnitureConfig.treeLootMax.Value));
}
}
}
if ((Object)(object)tree1 == (Object)null)
{
tree1 = GameObject.Find("Tree1ItemSpawn");
}
if ((Object)(object)tree1 != (Object)null)
{
foreach (Transform item2 in tree1.transform)
{
Transform val3 = item2;
if (Random.Range(0, 99) < MelanieUtilFurnitureConfig.treeLootChance.Value)
{
GameObject val4 = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[itemIndex[0]].spawnPrefab, val3.position, val3.rotation);
val4.GetComponent<NetworkObject>().Spawn(false);
val4.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieUtilFurnitureConfig.treeLootMin.Value, MelanieUtilFurnitureConfig.treeLootMax.Value));
}
}
}
if ((Object)(object)xmas0 == (Object)null)
{
xmas0 = GameObject.Find("TreeXMAS0(Clone)");
}
if ((Object)(object)xmas0 != (Object)null && Random.Range(0, 99) < ornament)
{
GameObject val5 = Object.Instantiate<GameObject>(StartOfRound.Instance.allItemsList.itemsList[itemIndex[1]].spawnPrefab, xmas0.transform.Find("TreeXMAS0Spawn").position, new Quaternion(0f, 0f, 0f, 0f));
Transform transform = val5.transform;
transform.localPosition += new Vector3((float)Random.Range(-2, 2), 0f, Random.Range(-2f, 2f));
val5.GetComponent<NetworkObject>().Spawn(false);
val5.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(10, 30));
}
}
}
namespace MelanieMeliciousFurniture
{
[BepInPlugin("MelanieMelicious.furniturePack0", "Melanie Melicious - Furniture Pack 1", "2.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
private const string GUID = "MelanieMelicious.furniturePack0";
private const string NAME = "Melanie Melicious - Furniture Pack 1";
private const string VERSION = "2.0.0";
private readonly Harmony harmony = new Harmony("MelanieMelicious.furniturePack0");
public static ManualLogSource mls;
public static AssetBundle bundle;
public static Plugin instance;
internal static UnlockablesList unlockList;
private void Awake()
{
//IL_0ac4: Unknown result type (might be due to invalid IL or missing references)
//IL_0ac9: Unknown result type (might be due to invalid IL or missing references)
//IL_0ad0: Unknown result type (might be due to invalid IL or missing references)
//IL_0ad5: Unknown result type (might be due to invalid IL or missing references)
//IL_0adc: Unknown result type (might be due to invalid IL or missing references)
//IL_0ae1: Unknown result type (might be due to invalid IL or missing references)
//IL_0ae8: Unknown result type (might be due to invalid IL or missing references)
//IL_0aed: Unknown result type (might be due to invalid IL or missing references)
//IL_0af4: Unknown result type (might be due to invalid IL or missing references)
//IL_0af9: Unknown result type (might be due to invalid IL or missing references)
//IL_0bb1: Unknown result type (might be due to invalid IL or missing references)
//IL_0bc3: Unknown result type (might be due to invalid IL or missing references)
//IL_0bd5: Unknown result type (might be due to invalid IL or missing references)
//IL_0be7: Unknown result type (might be due to invalid IL or missing references)
//IL_0c04: Unknown result type (might be due to invalid IL or missing references)
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;
MelanieUtilFurnitureConfig.SetupConfig(((BaseUnityPlugin)this).Config);
mls = Logger.CreateLogSource("MelanieMelicious - Utility Furniture");
mls = ((BaseUnityPlugin)this).Logger;
harmony.PatchAll(typeof(HarmonyPatches));
if (MelanieUtilFurnitureConfig.treeLootChance.Value != 0 || MelanieUtilFurnitureConfig.xmasLootChance.Value != 0)
{
harmony.PatchAll(typeof(TreePatch));
}
string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
bundle = AssetBundle.LoadFromFile(Path.Combine(directoryName, "melaniemeliciousfurniturepack0"));
unlockList = bundle.LoadAsset<UnlockablesList>("Assets/MelanieFurniture/Asset/Furniture.asset");
ushort num = 1;
if (!MelanieUtilFurnitureConfig.alwaysStock.Value)
{
num = 2;
foreach (UnlockableItem unlockable in unlockList.unlockables)
{
unlockable.alwaysInStock = false;
}
}
if (MelanieUtilFurnitureConfig.workshop0.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[0].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[0], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.workshop0Cost.Value);
}
if (MelanieUtilFurnitureConfig.workTable0.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[1].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[1], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.workTable0Cost.Value);
}
if (MelanieUtilFurnitureConfig.wideCabinet0.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[2].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[2], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.cabinetWide0Cost.Value);
}
if (MelanieUtilFurnitureConfig.bed0.Value)
{
GameObject[] array3 = (GameObject[])(object)new GameObject[4]
{
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Bed/Bed0.0.prefab"),
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Bed/Bed1.0.prefab"),
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Bed/Bed0.1.prefab"),
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Bed/Bed1.1.prefab")
};
EditPrefab(array3[(int)MelanieUtilFurnitureConfig.bed0Type.Value], 12);
EditPlacement(unlockList.unlockables[12].prefabObject, new string[2] { "Model0/Drawer0/Shelf/Placement", "Model0/Drawer1/Shelf/Placement" });
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[12].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[12], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.bedTwin0Cost.Value);
EditPrefab(array3[(int)MelanieUtilFurnitureConfig.bed1Type.Value], 50);
EditPlacement(unlockList.unlockables[50].prefabObject, new string[2] { "Model0/Drawer0/Shelf/Placement", "Model0/Drawer1/Shelf/Placement" });
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[50].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[50], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.bedTwin0Cost.Value);
EditPrefab(array3[(int)MelanieUtilFurnitureConfig.bed2Type.Value], 51);
EditPlacement(unlockList.unlockables[51].prefabObject, new string[2] { "Model0/Drawer0/Shelf/Placement", "Model0/Drawer1/Shelf/Placement" });
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[51].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[51], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.bedTwin0Cost.Value);
EditPrefab(array3[(int)MelanieUtilFurnitureConfig.bed3Type.Value], 52);
EditPlacement(unlockList.unlockables[52].prefabObject, new string[2] { "Model0/Drawer0/Shelf/Placement", "Model0/Drawer1/Shelf/Placement" });
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[52].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[52], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.bedTwin0Cost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[53].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[53], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.bedTwin0Cost.Value);
}
if (MelanieUtilFurnitureConfig.tree0.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[13].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[13], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.treeBig0Cost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[14].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[14], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.treeBig0Cost.Value);
}
if (MelanieUtilFurnitureConfig.benchTable0.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[15].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[15], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.benchTable0Cost.Value);
}
if (MelanieUtilFurnitureConfig.fern0.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[16].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[16], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.fern0Cost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[17].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[17], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.fern0Cost.Value);
}
if (MelanieUtilFurnitureConfig.fire0.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[19].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[19], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.fireplaceCost.Value);
}
if (MelanieUtilFurnitureConfig.counter0.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[20].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[20], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.workTable0Cost.Value);
}
if (MelanieUtilFurnitureConfig.lamp0.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[21].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[21], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.lamp0Cost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[49].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[49], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.lamp0Cost.Value);
}
if (MelanieUtilFurnitureConfig.aquarium0.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[26].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[26], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.aqua0Cost.Value);
}
if (MelanieUtilFurnitureConfig.fireExit0Enable.Value)
{
switch (MelanieUtilFurnitureConfig.fireExit0Type.Value)
{
case MelanieUtilFurnitureConfig.fireExit.Entrance:
unlockList.unlockables[3].prefabObject = bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/FireExit0/Entrance/FireExit0.prefab");
break;
case MelanieUtilFurnitureConfig.fireExit.Exit:
unlockList.unlockables[3].prefabObject = bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/FireExit0/Exit/FireExit0.prefab");
break;
}
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[3].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[3], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.fireExit0Cost.Value);
harmony.PatchAll(typeof(FireExitPatch));
}
if (MelanieUtilFurnitureConfig.wallEnable.Value)
{
Material[] array4 = (Material[])(object)new Material[2]
{
bundle.LoadAsset<Material>("Assets/MelanieFurniture/Material/Door0.mat"),
bundle.LoadAsset<Material>("Assets/MelanieFurniture/Material/Door1.mat")
};
Material[] array5 = (Material[])(object)new Material[2]
{
bundle.LoadAsset<Material>("Assets/MelanieFurniture/Material/Wall0.mat"),
bundle.LoadAsset<Material>("Assets/MelanieFurniture/Material/Wall1.mat")
};
GameObject[] array6 = (GameObject[])(object)new GameObject[6]
{
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Wall/Wall0.prefab"),
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Wall/Gate0.prefab"),
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Wall/Door0.prefab"),
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Wall/Door1.prefab"),
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Wall/Door2.prefab"),
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Wall/Door3.prefab")
};
EditMat(((Component)array6[2].transform.Find("Door")).GetComponent<MeshRenderer>(), (int)MelanieUtilFurnitureConfig.door0Mat.Value, array4);
EditMat(((Component)array6[3].transform.Find("Door")).GetComponent<MeshRenderer>(), (int)MelanieUtilFurnitureConfig.door1Mat.Value, array4);
EditMat(((Component)array6[4].transform.Find("Door")).GetComponent<MeshRenderer>(), (int)MelanieUtilFurnitureConfig.door2Mat.Value, array4);
EditMat(((Component)array6[5].transform.Find("Door")).GetComponent<MeshRenderer>(), (int)MelanieUtilFurnitureConfig.door3Mat.Value, array4);
Color[] array7 = (Color[])(object)new Color[5]
{
Color.clear,
Color.clear,
Color.clear,
Color.clear,
Color.clear
};
ColorUtility.TryParseHtmlString("#" + MelanieUtilFurnitureConfig.door0Hex.Value, ref array7[0]);
ColorUtility.TryParseHtmlString("#" + MelanieUtilFurnitureConfig.door1Hex.Value, ref array7[1]);
ColorUtility.TryParseHtmlString("#" + MelanieUtilFurnitureConfig.wall0Hex.Value, ref array7[2]);
ColorUtility.TryParseHtmlString("#" + MelanieUtilFurnitureConfig.wall1Hex.Value, ref array7[3]);
ColorUtility.TryParseHtmlString("#" + MelanieUtilFurnitureConfig.frameHex.Value, ref array7[4]);
array4[0].color = array7[0];
array4[1].color = array7[1];
array5[0].color = array7[2];
array5[1].color = array7[3];
bundle.LoadAsset<Material>("Assets/MelanieFurniture/Material/Frame0.mat").color = array7[4];
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall0Type.Value], 4, (int)MelanieUtilFurnitureConfig.wall0Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[4].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[4], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall1Type.Value], 5, (int)MelanieUtilFurnitureConfig.wall0Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[5].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[5], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall2Type.Value], 6, (int)MelanieUtilFurnitureConfig.wall0Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[6].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[6], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall3Type.Value], 7, (int)MelanieUtilFurnitureConfig.wall0Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[7].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[7], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall4Type.Value], 8, (int)MelanieUtilFurnitureConfig.wall0Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[8].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[8], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall5Type.Value], 9, (int)MelanieUtilFurnitureConfig.wall1Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[9].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[9], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall6Type.Value], 10, (int)MelanieUtilFurnitureConfig.wall1Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[10].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[10], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall7Type.Value], 11, (int)MelanieUtilFurnitureConfig.wall1Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[11].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[11], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall8Type.Value], 42, (int)MelanieUtilFurnitureConfig.wall1Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[42].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[42], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall9Type.Value], 43, (int)MelanieUtilFurnitureConfig.wall1Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[43].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[43], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall10Type.Value], 44, (int)MelanieUtilFurnitureConfig.wall2Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[44].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[44], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall11Type.Value], 45, (int)MelanieUtilFurnitureConfig.wall2Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[45].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[45], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall12Type.Value], 46, (int)MelanieUtilFurnitureConfig.wall2Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[46].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[46], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall13Type.Value], 47, (int)MelanieUtilFurnitureConfig.wall2Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[47].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[47], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
EditPrefab(array6[(int)MelanieUtilFurnitureConfig.wall14Type.Value], 48, (int)MelanieUtilFurnitureConfig.wall2Mat.Value, array5);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[48].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[48], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.wall0Cost.Value);
}
if (MelanieUtilFurnitureConfig.xmasEnable.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[18].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[18], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.treeBig0Cost.Value);
}
if (MelanieUtilFurnitureConfig.moveEnable.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[22].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[22], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.moveCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[23].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[23], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.moveCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[24].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[24], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.moveCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[25].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[25], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.moveCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[27].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[27], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.moveCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[28].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[28], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.moveCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[29].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[29], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.moveCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[30].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[30], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.moveCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[31].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[31], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.moveCost.Value);
}
if (MelanieUtilFurnitureConfig.posterEnable.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[32].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[32], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.posterCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[33].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[33], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.posterCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[34].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[34], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.posterCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[35].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[35], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.posterCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[36].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[36], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.posterCost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[37].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[37], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.posterCost.Value);
}
if (MelanieUtilFurnitureConfig.chair0.Value)
{
GameObject[] array8 = (GameObject[])(object)new GameObject[2]
{
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Chair/Chair0.0.prefab"),
bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/Chair/Chair0.1.prefab")
};
EditPrefab(array8[(int)MelanieUtilFurnitureConfig.chair0Type.Value], 38);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[38].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[38], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.chair0Cost.Value);
EditPrefab(array8[(int)MelanieUtilFurnitureConfig.chair1Type.Value], 39);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[39].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[39], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.chair0Cost.Value);
EditPrefab(array8[(int)MelanieUtilFurnitureConfig.chair2Type.Value], 40);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[40].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[40], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.chair0Cost.Value);
EditPrefab(array8[(int)MelanieUtilFurnitureConfig.chair3Type.Value], 41);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[41].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[41], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.chair0Cost.Value);
}
if (MelanieUtilFurnitureConfig.shelf0.Value)
{
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[54].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[54], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.cabinetWide0Cost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[55].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[55], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.cabinetWide0Cost.Value);
NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[56].prefabObject);
Unlockables.RegisterUnlockable(unlockList.unlockables[56], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.cabinetWide0Cost.Value);
}
if (MelanieUtilFurnitureConfig.instrument.Value)
{
AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(directoryName, "melaniemeliciousinstrument"));
UnlockablesList val2 = val.LoadAsset<UnlockablesList>("Assets/MelanieFurniture/Asset/Instrument.asset");
NetworkPrefabs.RegisterNetworkPrefab(val2.unlockables[0].prefabObject);
Unlockables.RegisterUnlockable(val2.unlockables[0], (StoreType)num, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieUtilFurnitureConfig.floorPianoCost.Value);
}
}
private static void EditPrefab(GameObject spawn, int index, int mat = 0, Material[] mats = null)
{
GameObject val = Object.Instantiate<GameObject>(spawn);
((Object)val).name = "Model0";
val.transform.SetParent(unlockList.unlockables[index].prefabObject.transform);
if (mats != null)
{
((Renderer)((Component)val.transform).GetComponent<MeshRenderer>()).SetSharedMaterials(new List<Material>(1) { mats[mat] });
}
}
private static void EditMat(MeshRenderer ren, int mat, Material[] mats)
{
Material[] sharedMaterials = ((Renderer)ren).sharedMaterials;
sharedMaterials[0] = mats[mat];
((Renderer)ren).sharedMaterials = sharedMaterials;
}
private static void EditPlacement(GameObject obj, string[] paths)
{
foreach (string text in paths)
{
((Component)obj.transform.Find(text)).GetComponent<PlaceableObjectsSurface>().parentTo = ((Component)obj.transform).GetComponent<NetworkObject>();
}
}
}
}
namespace MelanieMeliciousFurniturePack0
{
public class ParentItems : NetworkBehaviour
{
public Transform oldParent;
public Transform newParent;
public void ParentItem()
{
ParentItemServerRpc();
}
[ServerRpc(RequireOwnership = false)]
public void ParentItemServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: 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_007c: 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(3429374815u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3429374815u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
ParentItemClientRpc();
}
}
}
[ClientRpc]
public void ParentItemClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: 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_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Expected O, but got Unknown
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3722584432u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3722584432u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
foreach (Transform item in oldParent.parent)
{
Transform val3 = item;
if (((Component)val3).gameObject.layer != 26 && ((Object)val3).name != "ObjectPlacements")
{
val3.parent = newParent;
}
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_ParentItems()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(3429374815u, new RpcReceiveHandler(__rpc_handler_3429374815));
NetworkManager.__rpc_func_table.Add(3722584432u, new RpcReceiveHandler(__rpc_handler_3722584432));
}
private static void __rpc_handler_3429374815(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((ParentItems)(object)target).ParentItemServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3722584432(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((ParentItems)(object)target).ParentItemClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "ParentItems";
}
}
}
namespace MelanieMeliciousUtilFurniture.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}