Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of MelanieMelicious Utility Furniture Pack v2.0.5
MelanieMeliciousUtilFurniture.dll
Decompiled 2 days agousing 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.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using Dawn; using HarmonyLib; using LethalLevelLoader; 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] 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 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; } } } 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 { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("MelanieMelicious.furniturePack0", "Melanie Melicious - Furniture Pack 1", "2.0.5")] 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.5"; private const string NAMESPACE = "MelanieMeliciousFurniture"; private const string KEY = "MelM"; private readonly Harmony harmony = new Harmony("MelanieMelicious.furniturePack0"); public static ManualLogSource mls; public static AssetBundle bundle; internal UnlockableItem[] unlockList; internal static ExtendedMod extMod; private bool alt = false; private void Awake() { //IL_0698: Unknown result type (might be due to invalid IL or missing references) //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06a4: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Unknown result type (might be due to invalid IL or missing references) //IL_0785: Unknown result type (might be due to invalid IL or missing references) //IL_0797: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07bb: Unknown result type (might be due to invalid IL or missing references) //IL_07d8: Unknown result type (might be due to invalid IL or missing references) MelanieUtilFurnitureConfig.SetupConfig(((BaseUnityPlugin)this).Config); mls = Logger.CreateLogSource("MelanieMelicious.furniturePack0"); mls = ((BaseUnityPlugin)this).Logger; 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")); extMod = bundle.LoadAsset<ExtendedMod>("Assets/MelanieFurniture/MelanieFurniture.asset"); if (Chainloader.PluginInfos.ContainsKey("com.github.teamxiaolan.dawnlib")) { alt = true; unlockList = bundle.LoadAsset<UnlockablesList>("Assets/MelanieFurniture/Asset/FurnitureAlt.asset").unlockables.ToArray(); } else { unlockList = bundle.LoadAsset<UnlockablesList>("Assets/MelanieFurniture/Asset/Furniture.asset").unlockables.ToArray(); harmony.PatchAll(typeof(TerminalPatch)); } if (!MelanieUtilFurnitureConfig.alwaysStock.Value) { UnlockableItem[] array = unlockList; foreach (UnlockableItem val in array) { val.alwaysInStock = false; } } if (MelanieUtilFurnitureConfig.workshop0.Value) { Unlock(unlockList[0], MelanieUtilFurnitureConfig.workshop0Cost.Value); } if (MelanieUtilFurnitureConfig.workTable0.Value) { Unlock(unlockList[1], MelanieUtilFurnitureConfig.workTable0Cost.Value); } if (MelanieUtilFurnitureConfig.wideCabinet0.Value) { Unlock(unlockList[2], MelanieUtilFurnitureConfig.cabinetWide0Cost.Value); } if (MelanieUtilFurnitureConfig.bed0.Value) { GameObject[] array2 = (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") }; int value = MelanieUtilFurnitureConfig.bedTwin0Cost.Value; EditPrefab(array2[(int)MelanieUtilFurnitureConfig.bed0Type.Value], 12); Unlock(unlockList[12], value); EditPrefab(array2[(int)MelanieUtilFurnitureConfig.bed1Type.Value], 50); Unlock(unlockList[50], value); EditPrefab(array2[(int)MelanieUtilFurnitureConfig.bed2Type.Value], 51); Unlock(unlockList[51], value); EditPrefab(array2[(int)MelanieUtilFurnitureConfig.bed3Type.Value], 52); Unlock(unlockList[52], value); Unlock(unlockList[53], value); } if (MelanieUtilFurnitureConfig.tree0.Value) { int value2 = MelanieUtilFurnitureConfig.treeBig0Cost.Value; Unlock(unlockList[13], value2); Unlock(unlockList[14], value2); } if (MelanieUtilFurnitureConfig.benchTable0.Value) { Unlock(unlockList[15], MelanieUtilFurnitureConfig.benchTable0Cost.Value); } if (MelanieUtilFurnitureConfig.fern0.Value) { int value3 = MelanieUtilFurnitureConfig.fern0Cost.Value; Unlock(unlockList[16], value3); Unlock(unlockList[17], value3); } if (MelanieUtilFurnitureConfig.fire0.Value) { Unlock(unlockList[19], MelanieUtilFurnitureConfig.fireplaceCost.Value); } if (MelanieUtilFurnitureConfig.counter0.Value) { Unlock(unlockList[20], MelanieUtilFurnitureConfig.workTable0Cost.Value); } if (MelanieUtilFurnitureConfig.lamp0.Value) { int value4 = MelanieUtilFurnitureConfig.lamp0Cost.Value; Unlock(unlockList[21], value4); Unlock(unlockList[49], value4); } if (MelanieUtilFurnitureConfig.aquarium0.Value) { Unlock(unlockList[26], MelanieUtilFurnitureConfig.aqua0Cost.Value); } if (MelanieUtilFurnitureConfig.fireExit0Enable.Value) { switch (MelanieUtilFurnitureConfig.fireExit0Type.Value) { case MelanieUtilFurnitureConfig.fireExit.Entrance: unlockList[3].prefabObject = bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/FireExit0/Entrance/FireExit0.prefab"); break; case MelanieUtilFurnitureConfig.fireExit.Exit: unlockList[3].prefabObject = bundle.LoadAsset<GameObject>("Assets/MelanieFurniture/Prefab/FireExit0/Exit/FireExit0.prefab"); break; } Unlock(unlockList[3], MelanieUtilFurnitureConfig.fireExit0Cost.Value); harmony.PatchAll(typeof(FireExitPatch)); } if (MelanieUtilFurnitureConfig.wallEnable.Value) { Material[] array3 = (Material[])(object)new Material[2] { bundle.LoadAsset<Material>("Assets/MelanieFurniture/Material/Door0.mat"), bundle.LoadAsset<Material>("Assets/MelanieFurniture/Material/Door1.mat") }; Material[] array4 = (Material[])(object)new Material[2] { bundle.LoadAsset<Material>("Assets/MelanieFurniture/Material/Wall0.mat"), bundle.LoadAsset<Material>("Assets/MelanieFurniture/Material/Wall1.mat") }; GameObject[] array5 = (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") }; int value5 = MelanieUtilFurnitureConfig.wall0Cost.Value; EditMat(((Component)array5[2].transform.Find("Door")).GetComponent<MeshRenderer>(), (int)MelanieUtilFurnitureConfig.door0Mat.Value, array3); EditMat(((Component)array5[3].transform.Find("Door")).GetComponent<MeshRenderer>(), (int)MelanieUtilFurnitureConfig.door1Mat.Value, array3); EditMat(((Component)array5[4].transform.Find("Door")).GetComponent<MeshRenderer>(), (int)MelanieUtilFurnitureConfig.door2Mat.Value, array3); EditMat(((Component)array5[5].transform.Find("Door")).GetComponent<MeshRenderer>(), (int)MelanieUtilFurnitureConfig.door3Mat.Value, array3); Color[] array6 = (Color[])(object)new Color[5] { Color.clear, Color.clear, Color.clear, Color.clear, Color.clear }; ColorUtility.TryParseHtmlString("#" + MelanieUtilFurnitureConfig.door0Hex.Value, ref array6[0]); ColorUtility.TryParseHtmlString("#" + MelanieUtilFurnitureConfig.door1Hex.Value, ref array6[1]); ColorUtility.TryParseHtmlString("#" + MelanieUtilFurnitureConfig.wall0Hex.Value, ref array6[2]); ColorUtility.TryParseHtmlString("#" + MelanieUtilFurnitureConfig.wall1Hex.Value, ref array6[3]); ColorUtility.TryParseHtmlString("#" + MelanieUtilFurnitureConfig.frameHex.Value, ref array6[4]); array3[0].color = array6[0]; array3[1].color = array6[1]; array4[0].color = array6[2]; array4[1].color = array6[3]; bundle.LoadAsset<Material>("Assets/MelanieFurniture/Material/Frame0.mat").color = array6[4]; EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall0Type.Value], 4, (int)MelanieUtilFurnitureConfig.wall0Mat.Value, array4); Unlock(unlockList[4], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall1Type.Value], 5, (int)MelanieUtilFurnitureConfig.wall0Mat.Value, array4); Unlock(unlockList[5], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall2Type.Value], 6, (int)MelanieUtilFurnitureConfig.wall0Mat.Value, array4); Unlock(unlockList[6], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall3Type.Value], 7, (int)MelanieUtilFurnitureConfig.wall0Mat.Value, array4); Unlock(unlockList[7], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall4Type.Value], 8, (int)MelanieUtilFurnitureConfig.wall0Mat.Value, array4); Unlock(unlockList[8], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall5Type.Value], 9, (int)MelanieUtilFurnitureConfig.wall1Mat.Value, array4); Unlock(unlockList[9], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall6Type.Value], 10, (int)MelanieUtilFurnitureConfig.wall1Mat.Value, array4); Unlock(unlockList[10], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall7Type.Value], 11, (int)MelanieUtilFurnitureConfig.wall1Mat.Value, array4); Unlock(unlockList[11], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall8Type.Value], 42, (int)MelanieUtilFurnitureConfig.wall1Mat.Value, array4); Unlock(unlockList[42], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall9Type.Value], 43, (int)MelanieUtilFurnitureConfig.wall1Mat.Value, array4); Unlock(unlockList[43], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall10Type.Value], 44, (int)MelanieUtilFurnitureConfig.wall2Mat.Value, array4); Unlock(unlockList[44], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall11Type.Value], 45, (int)MelanieUtilFurnitureConfig.wall2Mat.Value, array4); Unlock(unlockList[45], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall12Type.Value], 46, (int)MelanieUtilFurnitureConfig.wall2Mat.Value, array4); Unlock(unlockList[46], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall13Type.Value], 47, (int)MelanieUtilFurnitureConfig.wall2Mat.Value, array4); Unlock(unlockList[47], value5); EditPrefab(array5[(int)MelanieUtilFurnitureConfig.wall14Type.Value], 48, (int)MelanieUtilFurnitureConfig.wall2Mat.Value, array4); Unlock(unlockList[48], value5); } if (MelanieUtilFurnitureConfig.xmasEnable.Value) { Unlock(unlockList[18], MelanieUtilFurnitureConfig.treeBig0Cost.Value); } if (MelanieUtilFurnitureConfig.moveEnable.Value) { int value6 = MelanieUtilFurnitureConfig.moveCost.Value; Unlock(unlockList[22], value6); Unlock(unlockList[23], value6); Unlock(unlockList[25], value6); Unlock(unlockList[24], value6); Unlock(unlockList[27], value6); Unlock(unlockList[28], value6); Unlock(unlockList[29], value6); Unlock(unlockList[30], value6); Unlock(unlockList[31], value6); } if (MelanieUtilFurnitureConfig.posterEnable.Value) { int value7 = MelanieUtilFurnitureConfig.posterCost.Value; Unlock(unlockList[32], value7); Unlock(unlockList[33], value7); Unlock(unlockList[34], value7); Unlock(unlockList[35], value7); Unlock(unlockList[36], value7); Unlock(unlockList[37], value7); } if (MelanieUtilFurnitureConfig.chair0.Value) { GameObject[] array7 = (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") }; int value8 = MelanieUtilFurnitureConfig.chair0Cost.Value; EditPrefab(array7[(int)MelanieUtilFurnitureConfig.chair0Type.Value], 38); Unlock(unlockList[38], value8); EditPrefab(array7[(int)MelanieUtilFurnitureConfig.chair1Type.Value], 39); Unlock(unlockList[39], value8); EditPrefab(array7[(int)MelanieUtilFurnitureConfig.chair2Type.Value], 40); Unlock(unlockList[40], value8); EditPrefab(array7[(int)MelanieUtilFurnitureConfig.chair0Type.Value], 41); Unlock(unlockList[41], value8); } if (MelanieUtilFurnitureConfig.shelf0.Value) { int value9 = MelanieUtilFurnitureConfig.cabinetWide0Cost.Value; Unlock(unlockList[54], value9); Unlock(unlockList[55], value9); Unlock(unlockList[56], value9); } if (MelanieUtilFurnitureConfig.instrument.Value) { AssetBundle val2 = AssetBundle.LoadFromFile(Path.Combine(directoryName, "melaniemeliciousinstrument")); UnlockableItem[] array8 = val2.LoadAsset<UnlockablesList>("Assets/MelanieFurniture/Asset/Instrument.asset").unlockables.ToArray(); Unlock(array8[0], MelanieUtilFurnitureConfig.floorPianoCost.Value); } if (!alt) { PatchedContent.RegisterExtendedMod(extMod); } } private void Unlock(UnlockableItem unlock, int cost) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown if (!alt) { extMod.ExtendedUnlockableItems.Add(new ExtendedUnlockableItem { UnlockableItem = unlock, ItemCost = cost }); } else { UnlockAlt(unlock, cost); } } private void UnlockAlt(UnlockableItem unlock, int cost) { DawnLib.RegisterNetworkPrefab(unlock.prefabObject); DawnLib.DefineUnlockable(NamespacedKey<DawnUnlockableItemInfo>.From("MelanieMeliciousFurniture", "MelM" + unlock.unlockableName), unlock, (Action<UnlockableInfoBuilder>)delegate(UnlockableInfoBuilder builder) { builder.SetCost(cost); }); } private 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[index].prefabObject.transform); if (mats != null) { ((Renderer)((Component)val.transform).GetComponent<MeshRenderer>()).SetSharedMaterials(new List<Material>(1) { mats[mat] }); } } private void EditMat(MeshRenderer ren, int mat, Material[] mats) { Material[] sharedMaterials = ((Renderer)ren).sharedMaterials; sharedMaterials[0] = mats[mat]; ((Renderer)ren).sharedMaterials = sharedMaterials; } } public class TerminalPatch { private static bool added; [HarmonyPostfix] [HarmonyPatch(typeof(Terminal), "Awake")] private static void PostText(Terminal __instance) { try { TerminalNode specialKeywordResult = __instance.terminalNodes.allKeywords[7].specialKeywordResult; if (added || !specialKeywordResult.displayText.Contains("SHIP UPGRADES:")) { return; } string text = string.Empty; foreach (ExtendedUnlockableItem extendedUnlockableItem in Plugin.extMod.ExtendedUnlockableItems) { if (!specialKeywordResult.displayText.Contains(extendedUnlockableItem.UnlockableItem.unlockableName)) { text += $"\n* {extendedUnlockableItem.UnlockableItem.unlockableName} // Price: ${extendedUnlockableItem.ItemCost}"; } } specialKeywordResult.displayText = specialKeywordResult.displayText.Insert(specialKeywordResult.displayText.IndexOf(":") + 1, text); added = true; } catch { Plugin.mls.LogError((object)"Could not find vanilla store terminal node!"); } } } } 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) //IL_00c1: 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)) { base.__rpc_exec_stage = (__RpcExecStage)0; 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown 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(3722584432u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3722584432u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; 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(); } 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(3429374815u, new RpcReceiveHandler(__rpc_handler_3429374815), "ParentItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(3722584432u, new RpcReceiveHandler(__rpc_handler_3722584432), "ParentItemClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } 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)1; ((ParentItems)(object)target).ParentItemClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ParentItems"; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace MelanieMeliciousUtilFurniture.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }