Some mods target the Mono version of the game, which is available by opting into the Steam beta branch "alternate"
Decompiled source of PropertyOverhaul v1.1.7
PropetyOverhaul-1.1.7.dll
Decompiled 2 weeks agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using HarmonyLib; using Il2CppFluffyUnderware.DevTools.Extensions; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppScheduleOne.Dialogue; using Il2CppScheduleOne.Economy; using Il2CppScheduleOne.EntityFramework; using Il2CppScheduleOne.ItemFramework; using Il2CppScheduleOne.NPCs.CharacterClasses; using Il2CppScheduleOne.NPCs.Relation; using Il2CppScheduleOne.ObjectScripts; using Il2CppScheduleOne.PlayerScripts; using Il2CppScheduleOne.Property; using Il2CppScheduleOne.Quests; using Il2CppScheduleOne.Tiles; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Il2CppSystem.Reflection; using MelonLoader; using MelonLoader.Preferences; using Microsoft.CodeAnalysis; using ProperPropertyProgression; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(global::ProperPropertyProgression.ProperPropertyProgression), "ProperPropertyProgression", "1.1.3", "Soul", null)] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("ProperPropertyProgression")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ProperPropertyProgression")] [assembly: AssemblyTitle("ProperPropertyProgression")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ProperPropertyProgression { public class ProperPropertyProgression : MelonMod { [HarmonyPatch(typeof(RV), "ShouldSave")] public class RV_ShouldSave_ForceTrue { private static bool Prefix(ref bool __result) { __result = true; return false; } } public static class ModConfig { private static MelonPreferences_Category PropertyChanges; public static MelonPreferences_Entry<bool> ChangeHousePrices; public static MelonPreferences_Entry<int> MotelPrice; public static MelonPreferences_Entry<int> SweatshopPrice; public static MelonPreferences_Entry<int> BungalowPrice; public static MelonPreferences_Entry<int> BarnPrice; public static MelonPreferences_Entry<int> WarehousePrice; public static MelonPreferences_Entry<int> ManorPrice; private static MelonPreferences_Category RVChanges; public static MelonPreferences_Entry<bool> StartRVEmpty; public static MelonPreferences_Entry<int> RVPrice; private static MelonPreferences_Category BusinessChanges; public static MelonPreferences_Entry<bool> ChangeBusinessPrices; public static MelonPreferences_Entry<int> LaundromatPrice; public static MelonPreferences_Entry<int> PostOfficePrice; public static MelonPreferences_Entry<int> CarWashPrice; public static MelonPreferences_Entry<int> TacoTicklersPrice; public static MelonPreferences_Entry<bool> ChangeBusinessLaunder; public static MelonPreferences_Entry<int> LaundromatLaunder; public static MelonPreferences_Entry<int> PostOfficeLaunder; public static MelonPreferences_Entry<int> CarWashLaunder; public static MelonPreferences_Entry<int> TacoTicklersLaunder; public static void Setup() { PropertyChanges = MelonPreferences.CreateCategory("ProperPropertyProgression", "Proper Property Progression Changes", true, true); ChangeHousePrices = PropertyChanges.CreateEntry<bool>("ChangeHousePrices", true, "Change house prices.", "Changes the prices of all the properties.", false, false, (ValueValidator)null, (string)null); MotelPrice = PropertyChanges.CreateEntry<int>("MotelPrice", 2500, "Hotel Price ", "GAME DEFAULT = 75", false, false, (ValueValidator)null, (string)null); SweatshopPrice = PropertyChanges.CreateEntry<int>("SweatshopPrice", 8000, "Sweatshop Price ", "GAME DEFAULT = 500 (idk why its not 800, i think the price you pay is separate from its ingame price)", false, false, (ValueValidator)null, (string)null); BungalowPrice = PropertyChanges.CreateEntry<int>("BungalowPrice", 35000, "Bungalow Price", " GAME DEFAULT = 6000", false, false, (ValueValidator)null, (string)null); BarnPrice = PropertyChanges.CreateEntry<int>("BarnPrice", 80000, "Barn Price", " GAME DEFAULT = 25000", false, false, (ValueValidator)null, (string)null); WarehousePrice = PropertyChanges.CreateEntry<int>("WarehousePrice", 100000, "Docks Warehouse Price", " GAME DEFAULT = 50000", false, false, (ValueValidator)null, (string)null); ManorPrice = PropertyChanges.CreateEntry<int>("ManorPrice", 150000, "Manor Price", " GAME DEFAULT = 50000", false, false, (ValueValidator)null, (string)null); RVChanges = MelonPreferences.CreateCategory("ProperPropertyProgression", "RVChanges", true, true); StartRVEmpty = RVChanges.CreateEntry<bool>("StartRVEmpty", true, "Start RV Empty", "Deletes everything in the RV at the start. (Note, after the RV is destroyed everything is still deleted before you repair it. This just ensure you can't cheese by picking everything up before.)", false, false, (ValueValidator)null, (string)null); RVPrice = RVChanges.CreateEntry<int>("RVPrice", 500, "RV Price", (string)null, false, false, (ValueValidator)null, (string)null); BusinessChanges = MelonPreferences.CreateCategory("ProperPropertyProgression", "Business Changes", true, true); ChangeBusinessPrices = BusinessChanges.CreateEntry<bool>("ChangeBusinessPrices", true, "Change house prices.", "Changes the prices of all the businesses.", false, false, (ValueValidator)null, (string)null); LaundromatPrice = BusinessChanges.CreateEntry<int>("LaundromatPrice", 10000, "Laundromat Price ", "GAME DEFAULT = 4000", false, false, (ValueValidator)null, (string)null); PostOfficePrice = BusinessChanges.CreateEntry<int>("PostOfficePrice", 20000, "Post Office Price ", "GAME DEFAULT = 10000", false, false, (ValueValidator)null, (string)null); CarWashPrice = BusinessChanges.CreateEntry<int>("CarWashPrice", 40000, "Car Wash Price ", "GAME DEFAULT = 20000", false, false, (ValueValidator)null, (string)null); TacoTicklersPrice = BusinessChanges.CreateEntry<int>("TacoTicklersPrice", 70000, "TacoTicklers Price ", "GAME DEFAULT = 50000", false, false, (ValueValidator)null, (string)null); ChangeBusinessLaunder = BusinessChanges.CreateEntry<bool>("ChangeBusinessLaunder", true, "Change house prices.", "Changes the launderamount of all the businesses.", false, false, (ValueValidator)null, (string)null); LaundromatLaunder = BusinessChanges.CreateEntry<int>("LaundromatLaunder", 5000, "Laundromat Launder Capacity ", "GAME DEFAULT = 2000", false, false, (ValueValidator)null, (string)null); PostOfficeLaunder = BusinessChanges.CreateEntry<int>("PostOfficeLaunder", 5000, "Post Office Launder Capacity ", "GAME DEFAULT = 4000", false, false, (ValueValidator)null, (string)null); CarWashLaunder = BusinessChanges.CreateEntry<int>("CarWashLaunder", 5000, "Car Wash Launder Capacity", "GAME DEFAULT = 6000", false, false, (ValueValidator)null, (string)null); TacoTicklersLaunder = BusinessChanges.CreateEntry<int>("TacoTicklersLaunder", 5000, "TacoTicklers Launder Capacity", " GAME DEFAULT = 8000", false, false, (ValueValidator)null, (string)null); PropertyChanges.SaveToFile(false); RVChanges.SaveToFile(false); BusinessChanges.SaveToFile(false); } } public static class DialogueModifier { private static Dictionary<string, int> PriceMap = new Dictionary<string, int> { { "Donna", ModConfig.MotelPrice.Value }, { "Ming", ModConfig.SweatshopPrice.Value } }; private static bool completedRV = false; public static void ApplyPatch() { Il2CppArrayBase<DialogueController_Ming> val = Object.FindObjectsOfType<DialogueController_Ming>(); foreach (DialogueController_Ming item in val) { Transform parent = ((Component)item).gameObject.transform.parent; string text = ((parent != null) ? ((Object)parent).name : null); if (text != null && PriceMap.TryGetValue(text, out var value)) { item.Price = value; } } } public static void SetQuestActive(string questTitle) { foreach (QuestEntry item in Object.FindObjectsOfType<QuestEntry>()) { if (item.Title == questTitle) { item.state = (EQuestState)1; break; } } } public static void SetQuestInactive(string questTitle) { foreach (QuestEntry item in Object.FindObjectsOfType<QuestEntry>()) { if (item.Title == questTitle) { item.state = (EQuestState)0; break; } } } public static void SetMappedPropertyPrices() { Dictionary<string, (Type, int)> dictionary = new Dictionary<string, (Type, int)> { { "Bungalow", (Il2CppType.Of<Bungalow>(), ModConfig.BungalowPrice.Value) }, { "MotelRoom", (Il2CppType.Of<MotelRoom>(), ModConfig.MotelPrice.Value) }, { "Sweatshop", (Il2CppType.Of<Sweatshop>(), ModConfig.SweatshopPrice.Value) }, { "Barn", (Il2CppType.Of<Property>(), ModConfig.BarnPrice.Value) }, { "DocksWarehouse", (Il2CppType.Of<Property>(), ModConfig.WarehousePrice.Value) }, { "Manor", (Il2CppType.Of<Property>(), ModConfig.ManorPrice.Value) } }; foreach (KeyValuePair<string, (Type, int)> item3 in dictionary) { string key = item3.Key; Type item = item3.Value.Item1; int item2 = item3.Value.Item2; foreach (Object item4 in (Il2CppArrayBase<Object>)(object)Object.FindObjectsOfType(item)) { Object val = ((Il2CppObjectBase)item4).Cast<Object>(); Component val2 = ((Il2CppObjectBase)val).TryCast<Component>(); if ((Object)(object)val2 != (Object)null && ((Object)val2.gameObject).name == key) { FieldInfo field = item.GetField("Price"); if (field != (FieldInfo)null) { field.SetValue(val, Object.op_Implicit(item2)); } } } } Melon<ProperPropertyProgression>.Logger.Msg("Property prices updated from config."); } public static void SetBusinessPricesAndCapacities() { Dictionary<string, (int, int)> dictionary = new Dictionary<string, (int, int)> { { "Laundromat", (ModConfig.LaundromatPrice.Value, ModConfig.LaundromatLaunder.Value) }, { "PostOffice", (ModConfig.PostOfficePrice.Value, ModConfig.PostOfficeLaunder.Value) }, { "CarWash", (ModConfig.CarWashPrice.Value, ModConfig.CarWashLaunder.Value) }, { "TacoTicklers", (ModConfig.TacoTicklersPrice.Value, ModConfig.TacoTicklersLaunder.Value) } }; foreach (Business item in Object.FindObjectsOfType<Business>()) { string text = ((Object)((Component)item).gameObject).name.Replace(" ", "").Replace("(Clone)", "").Trim(); foreach (KeyValuePair<string, (int, int)> item2 in dictionary) { string value = item2.Key.ToLowerInvariant(); string text2 = text.ToLowerInvariant(); if (text2.Contains(value)) { if (ModConfig.ChangeBusinessPrices.Value) { ((Property)item).Price = item2.Value.Item1; Melon<ProperPropertyProgression>.Logger.Msg($"Set {((Object)((Component)item).gameObject).name} to Price {item2.Value.Item1}"); } if (ModConfig.ChangeBusinessLaunder.Value) { item.LaunderCapacity = item2.Value.Item2; Melon<ProperPropertyProgression>.Logger.Msg($"Set {((Object)((Component)item).gameObject).name} to Launder Amount: {item2.Value.Item2}"); } break; } } } Melon<ProperPropertyProgression>.Logger.Msg("Business prices and launder capacities set from dictionary."); } public static void SetupMarcoRentRoomChoice() { //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Expected O, but got Unknown //IL_01e4: Expected O, but got Unknown GameObject val = null; GameObject val2 = null; foreach (GameObject item in Object.FindObjectsOfType<GameObject>()) { if (((Object)item).name == "Dialogue" && (Object)(object)item.transform.parent != (Object)null) { string name = ((Object)item.transform.parent).name; if (name == "Donna") { val = item; } else if (name == "Marco") { val2 = item; } } } if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { Melon<ProperPropertyProgression>.Logger.Warning("Could not find Donna or Marco Dialogue objects."); return; } DialogueController marcoController = val2.GetComponent<DialogueController>(); DialogueController_Ming component = val.GetComponent<DialogueController_Ming>(); if ((Object)(object)marcoController == (Object)null || (Object)(object)component == (Object)null) { Melon<ProperPropertyProgression>.Logger.Warning("Missing dialogue controllers on Donna or Marco."); return; } DialogueChoice val3 = ((DialogueController)component).Choices[3]; if (val3 == null) { Melon<ProperPropertyProgression>.Logger.Warning("Source choice not found on Donna's dialogue controller."); return; } DialogueContainer val4 = Object.Instantiate<DialogueContainer>(val3.Conversation); ((Object)val4).name = "Marco_RentRoom_Conversation"; DialogueChoice newChoice = new DialogueChoice { ChoiceText = $"Hey, could you fix my RV? It uh, had an accident... [${ModConfig.RVPrice.Value} cash REQUIRED]", Conversation = val4, Enabled = false, Priority = 99, onChoosen = new UnityEvent() }; val4.DialogueNodeData[0].DialogueText = "I bet. You can try the motel if you want a decent place to stay, talk to Donna. It's pretty pricy though."; val4.DialogueNodeData[1].DialogueText = "Uh sure... I can fix the body but I don't think she'll ever run again"; ((Il2CppArrayBase<DialogueChoiceData>)(object)val4.DialogueNodeData[1].choices)[0].ChoiceText = "Yeah, I don't think I'm going anywhere for a while..."; if (((Il2CppArrayBase<DialogueChoiceData>)(object)val4.DialogueNodeData[1].choices).Count > 1) { ArrayExt.RemoveAt<DialogueChoiceData>((Il2CppArrayBase<DialogueChoiceData>)(object)val4.DialogueNodeData[1].choices, 1); } newChoice.onChoosen.AddListener(UnityAction.op_Implicit((Action)MarcoRentRoomAction)); marcoController.Choices.Add(newChoice); MelonCoroutines.Start(FindQuestEntryWhenAvailable(delegate(QuestEntry rentQuest) { MelonCoroutines.Start(FindQuestEntryWhenAvailable(delegate(QuestEntry firstQuest) { if ((Object)(object)rentQuest != (Object)null && (Object)(object)firstQuest != (Object)null) { MelonCoroutines.Start(WaitForQuestCompletionAndEnableChoice(rentQuest, firstQuest, marcoController, newChoice)); } })); })); Melon<ProperPropertyProgression>.Logger.Msg("Added rent-room choice to Marco with a cloned conversation."); } private static IEnumerator FindQuestEntryWhenAvailable(Action<QuestEntry> onFound) { QuestEntry quest = null; int attempts = 0; List<string> possibleTitles = new string[3] { "Investigate the explosion", "Open your phone (press Tab) and read your messages", "Open your phone and read your messages" }.Select(NormalizeTitle).ToList(); while ((Object)(object)quest == (Object)null && attempts < 30) { Il2CppArrayBase<QuestEntry> quests = Resources.FindObjectsOfTypeAll<QuestEntry>(); foreach (QuestEntry q in quests) { if (((q != null) ? q.Title : null) != null) { string normalizedQuestTitle = NormalizeTitle(q.Title); if (possibleTitles.Any((string target) => target == normalizedQuestTitle)) { quest = q; break; } } } if ((Object)(object)quest != (Object)null) { break; } attempts++; yield return (object)new WaitForSeconds(1f); } if ((Object)(object)quest != (Object)null) { Melon<ProperPropertyProgression>.Logger.Msg($"Quest '{quest.Title}' matched one of possible titles after {attempts} seconds."); onFound?.Invoke(quest); } else { Melon<ProperPropertyProgression>.Logger.Warning($"Quest matching Investigate or Open Phone not found after {attempts} seconds of searching."); } } public static bool CheckFirstQuest() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Invalid comparison between Unknown and I4 //IL_00e8: Unknown result type (might be due to invalid IL or missing references) List<string> source = new string[2] { "Open your phone (press Tab) and read your messages", "Open your phone and read your messages" }.Select(NormalizeTitle).ToList(); foreach (QuestEntry item in Resources.FindObjectsOfTypeAll<QuestEntry>()) { if (((item != null) ? item.Title : null) != null) { string normalizedEntryTitle = NormalizeTitle(item.Title); if (source.Any((string target) => target == normalizedEntryTitle)) { bool flag = (int)item.state != 2; Melon<ProperPropertyProgression>.Logger.Msg($"Quest '{item.Title}' is {item.state} => shouldClear = {flag}"); return flag; } } } Melon<ProperPropertyProgression>.Logger.Warning("First quest not found — defaulting to shouldClear = true"); return true; } private static string NormalizeTitle(string title) { return title.ToLowerInvariant().Replace(" ", "").Replace("\t", "") .Replace("\n", "") .Trim(); } private static IEnumerator WaitForQuestCompletionAndEnableChoice(QuestEntry rentQuest, QuestEntry firstQuest, DialogueController controller, DialogueChoice choice) { FieldInfo shownChoicesField = typeof(DialogueController).GetField("shownChoices", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); (GameObject, GameObject) tuple = FindRVObjects(); GameObject intactRV = tuple.Item1; GameObject destroyedRV = tuple.Item2; EQuestState initialState = rentQuest.state; bool choiceEnabled = false; bool rvCurrentlyDestroyed = (Object)(object)intactRV != (Object)null && (Object)(object)destroyedRV != (Object)null && !intactRV.activeSelf && destroyedRV.activeSelf; int frameCounter = 0; while (true) { bool questNowCompleted = (int)initialState != 2 && (int)rentQuest.state == 2; if (frameCounter % 10 == 0 && (Object)(object)intactRV != (Object)null && (Object)(object)destroyedRV != (Object)null) { rvCurrentlyDestroyed = !intactRV.activeSelf && destroyedRV.activeSelf; } if (!choiceEnabled && (questNowCompleted || rvCurrentlyDestroyed)) { choice.Enabled = true; List<DialogueChoice> filtered2 = new List<DialogueChoice>(); Enumerator<DialogueChoice> enumerator = controller.Choices.GetEnumerator(); while (enumerator.MoveNext()) { DialogueChoice c2 = enumerator.Current; if (c2.Enabled) { filtered2.Add(c2); } } shownChoicesField?.SetValue(controller, filtered2); if (questNowCompleted) { Melon<ProperPropertyProgression>.Logger.Msg($"Rent quest '{rentQuest.Title}' transitioned from {initialState} to Completed. Enabled dialogue choice."); } else if (rvCurrentlyDestroyed) { Melon<ProperPropertyProgression>.Logger.Msg("RV is currently destroyed. Enabled dialogue choice."); } choiceEnabled = true; } if (completedRV) { break; } frameCounter++; yield return null; } choice.Enabled = false; List<DialogueChoice> filtered = new List<DialogueChoice>(); Enumerator<DialogueChoice> enumerator2 = controller.Choices.GetEnumerator(); while (enumerator2.MoveNext()) { DialogueChoice c = enumerator2.Current; if (c.Enabled) { filtered.Add(c); } } shownChoicesField?.SetValue(controller, filtered); Melon<ProperPropertyProgression>.Logger.Msg("RV repaired. Disabled rent-room choice and exiting coroutine."); } public static void MarcoRentRoomAction() { GameObject npc = GameObject.Find("Marco"); CashInstance closestPlayersCashInstance = GetClosestPlayersCashInstance(npc); if (closestPlayersCashInstance != null && closestPlayersCashInstance.Balance >= (float)ModConfig.RVPrice.Value) { closestPlayersCashInstance.ChangeBalance((float)(-ModConfig.RVPrice.Value)); SetQuestInactive("Head back to the RV"); SetQuestInactive("Investigate the explosion"); SetQuestInactive("Read the note"); if (!ModConfig.StartRVEmpty.Value) { ClearRVItemContainers(); } SetRVActive(); UnlockAlbertNow(); Melon<ProperPropertyProgression>.Logger.Msg($"${ModConfig.RVPrice.Value} deducted and RV restored."); completedRV = true; } } } public override void OnInitializeMelon() { ModConfig.Setup(); ((MelonBase)this).LoggerInstance.Msg("Config initialized."); Melon<ProperPropertyProgression>.Logger.Msg("Initialized!"); SceneManager.sceneLoaded += UnityAction<Scene, LoadSceneMode>.op_Implicit((Action<Scene, LoadSceneMode>)OnSceneLoaded); } public static void UnlockAlbertNow() { foreach (Albert item in Object.FindObjectsOfType<Albert>()) { object obj; if (item == null) { obj = null; } else { GameObject gameObject = ((Component)item).gameObject; obj = ((gameObject != null) ? ((Object)gameObject).name : null); } if ((string?)obj == "Albert") { ((Supplier)item).SupplierUnlocked((EUnlockType)0, true); break; } } } private static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (((Scene)(ref scene)).name.Equals("Main")) { MelonCoroutines.Start(Load()); } } private static IEnumerator Load() { for (int i = 0; i < 40; i++) { yield return (object)new WaitForEndOfFrame(); } Melon<ProperPropertyProgression>.Logger.Msg("Finally! *I* can start!"); if (ModConfig.ChangeHousePrices.Value) { DialogueModifier.ApplyPatch(); DialogueModifier.SetMappedPropertyPrices(); } DialogueModifier.SetBusinessPricesAndCapacities(); DisableQuestExplosions(); DialogueModifier.SetQuestActive("Talk to the manager in the motel office"); DialogueModifier.SetQuestActive("Talk to Mrs. Ming at the Chinese restaurant"); if (DialogueModifier.CheckFirstQuest() && ModConfig.StartRVEmpty.Value) { ClearRVItemContainers(); } DialogueModifier.SetupMarcoRentRoomChoice(); } public static void DisableQuestExplosions() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown foreach (Object item in (Il2CppArrayBase<Object>)(object)Resources.FindObjectsOfTypeAll(Il2CppType.Of<Quest_WelcomeToHylandPoint>())) { Quest_WelcomeToHylandPoint val = ((Il2CppObjectBase)item).TryCast<Quest_WelcomeToHylandPoint>(); if ((Object)(object)val != (Object)null && val.onExplode != null) { val.onExplode = new UnityEvent(); Melon<ProperPropertyProgression>.Logger.Msg("onExplode disabled for Quest_WelcomeToHylandPoint."); } } } public static void SetRVActive() { GameObject val = null; GameObject val2 = null; GameObject val3 = null; foreach (GameObject item in Resources.FindObjectsOfTypeAll<GameObject>()) { if (((Object)item).name == "RV") { Transform transform = item.transform; object obj; if (transform == null) { obj = null; } else { Transform parent = transform.parent; obj = ((parent != null) ? ((Object)parent).name : null); } if ((string?)obj == "@Properties") { val = item; break; } } } if ((Object)(object)val == (Object)null) { return; } foreach (Transform componentsInChild in val.GetComponentsInChildren<Transform>(true)) { if (((Object)componentsInChild).name == "RV" && (Object)(object)((Component)componentsInChild).gameObject != (Object)(object)val) { val2 = ((Component)componentsInChild).gameObject; } else if (((Object)componentsInChild).name == "Destroyed RV") { val3 = ((Component)componentsInChild).gameObject; } } if ((Object)(object)val2 != (Object)null && (Object)(object)val3 != (Object)null) { val3.SetActive(false); val2.SetActive(true); } Melon<ProperPropertyProgression>.Logger.Msg("RV is now visible."); } public static (GameObject intactRV, GameObject destroyedRV) FindRVObjects() { GameObject val = null; GameObject item = null; GameObject item2 = null; foreach (GameObject item3 in Resources.FindObjectsOfTypeAll<GameObject>()) { if (((Object)item3).name == "RV") { Transform transform = item3.transform; object obj; if (transform == null) { obj = null; } else { Transform parent = transform.parent; obj = ((parent != null) ? ((Object)parent).name : null); } if ((string?)obj == "@Properties") { val = item3; break; } } } if ((Object)(object)val == (Object)null) { return (null, null); } foreach (Transform componentsInChild in val.GetComponentsInChildren<Transform>(true)) { if (!((Object)(object)((Component)componentsInChild).gameObject == (Object)(object)val)) { if (((Object)componentsInChild).name == "RV") { item = ((Component)componentsInChild).gameObject; } else if (((Object)componentsInChild).name == "Destroyed RV") { item2 = ((Component)componentsInChild).gameObject; } } } return (item, item2); } public static void ClearRVItemContainers() { GameObject val = null; foreach (GameObject item in Resources.FindObjectsOfTypeAll<GameObject>()) { if (!(((Object)item).name == "RV")) { continue; } Transform transform = item.transform; object obj; if (transform == null) { obj = null; } else { Transform parent = transform.parent; obj = ((parent != null) ? ((Object)parent).name : null); } if (!((string?)obj == "RV")) { continue; } Transform transform2 = item.transform; object obj2; if (transform2 == null) { obj2 = null; } else { Transform parent2 = transform2.parent; if (parent2 == null) { obj2 = null; } else { Transform parent3 = parent2.parent; obj2 = ((parent3 != null) ? ((Object)parent3).name : null); } } if ((string?)obj2 == "@Properties") { Transform val2 = item.transform.Find("Container"); if ((Object)(object)val2 != (Object)null) { val = ((Component)val2).gameObject; break; } } } if ((Object)(object)val == (Object)null) { return; } int num = 0; foreach (Transform componentsInChild in val.GetComponentsInChildren<Transform>(true)) { if ((Object)(object)((Component)componentsInChild.parent).gameObject != (Object)(object)val || (!(((Object)componentsInChild).name == "Grid") && !(((Object)componentsInChild).name == "Grid (1)"))) { continue; } GameObject gameObject = ((Component)componentsInChild).gameObject; foreach (GameObject item2 in Resources.FindObjectsOfTypeAll<GameObject>()) { if (!(((Object)item2).name == "LEDLight(Clone)")) { continue; } Transform val3 = item2.transform; while ((Object)(object)val3 != (Object)null) { if ((Object)(object)((Component)val3).gameObject == (Object)(object)gameObject) { GrowLight component = item2.GetComponent<GrowLight>(); if ((Object)(object)component != (Object)null) { ((BuildableItem)component).DestroyItem(true); } break; } val3 = val3.parent; } } Grid component2 = gameObject.GetComponent<Grid>(); if ((Object)(object)component2 != (Object)null) { component2.DestroyGrid(); num++; } } } public static CashInstance GetClosestPlayersCashInstance(GameObject npc) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) Il2CppArrayBase<Player> val = Object.FindObjectsOfType<Player>(); Player val2 = null; float num = float.MaxValue; Transform component = npc.GetComponent<Transform>(); Vector3 val3 = ((component != null) ? component.position : Vector3.zero); foreach (Player item in val) { Component obj = ((Il2CppObjectBase)item).TryCast<Component>(); GameObject val4 = ((obj != null) ? obj.gameObject : null); if (!((Object)(object)val4 == (Object)null)) { Transform component2 = val4.GetComponent<Transform>(); Vector3 val5 = ((component2 != null) ? component2.position : Vector3.zero); float num2 = Vector3.Distance(val5, val3); if (num2 < num) { num = num2; val2 = item; } } } if ((Object)(object)val2 == (Object)null) { return null; } Component obj2 = ((Il2CppObjectBase)val2).TryCast<Component>(); GameObject val6 = ((obj2 != null) ? obj2.gameObject : null); if ((Object)(object)val6 == (Object)null) { return null; } PlayerInventory val7 = ((IEnumerable<PlayerInventory>)val6.GetComponentsInChildren<PlayerInventory>(true)).FirstOrDefault(); return (val7 != null) ? val7.cashInstance : null; } } }