Some mods target the Mono version of the game, which is available by opting into the Steam beta branch "alternate"
Decompiled source of ProperPropertyProgression v1.1.0
Property Overhaul-1.1.0.dll
Decompiled a year 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 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.0.0", "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 { 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<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); 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 } }; 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)) { ((Property)item).Price = item2.Value.Item1; item.LaunderCapacity = item2.Value.Item2; Melon<ProperPropertyProgression>.Logger.Msg($"Set {((Object)((Component)item).gameObject).name} to Price {item2.Value.Item1}, Launder {item2.Value.Item2}"); break; } } } Melon<ProperPropertyProgression>.Logger.Msg("Business prices and launder capacities set from dictionary."); } public static void SetupMarcoRentRoomChoice() { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown //IL_0151: 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; } } } DialogueController component = val2.GetComponent<DialogueController>(); DialogueController_Ming component2 = val.GetComponent<DialogueController_Ming>(); DialogueChoice val3 = ((DialogueController)component2).Choices[3]; DialogueContainer val4 = Object.Instantiate<DialogueContainer>(val3.Conversation); ((Object)val4).name = "Marco_RentRoom_Conversation"; DialogueChoice val5 = 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. Its 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); } val5.onChoosen.AddListener(UnityAction.op_Implicit((Action)MarcoRentRoomAction)); component.Choices.Add(val5); MelonCoroutines.Start(WaitForQuestCompletionAndEnableChoice("Investigate the explosion", component, val5)); Melon<ProperPropertyProgression>.Logger.Msg("Added rent-room choice to Marco with a cloned conversation."); } private static IEnumerator WaitForQuestCompletionAndEnableChoice(string questTitle, DialogueController controller, DialogueChoice choice) { EQuestState? previousState = null; while (true) { QuestEntry quest = ((IEnumerable<QuestEntry>)Object.FindObjectsOfType<QuestEntry>()).FirstOrDefault((Func<QuestEntry, bool>)((QuestEntry q) => q.Title == questTitle)); if ((Object)(object)quest != (Object)null && (EQuestState?)quest.state != previousState) { previousState = quest.state; choice.Enabled = (int)quest.state == 2; List<DialogueChoice> filtered = new List<DialogueChoice>(); Enumerator<DialogueChoice> enumerator = controller.Choices.GetEnumerator(); while (enumerator.MoveNext()) { DialogueChoice c = enumerator.Current; if (c.Enabled) { filtered.Add(c); } } typeof(DialogueController).GetField("shownChoices", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.SetValue(controller, filtered); } yield return (object)new WaitForSeconds(1f); } } 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"); ClearRVItemContainers(); SetRVActive(); UnlockAlbertNow(); Melon<ProperPropertyProgression>.Logger.Msg($"${ModConfig.RVPrice.Value} deducted and RV restored."); } } } 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(); } if (ModConfig.ChangeBusinessPrices.Value) { DialogueModifier.SetBusinessPricesAndCapacities(); } DialogueModifier.SetQuestActive("Talk to the manager in the motel office"); DialogueModifier.SetQuestActive("Talk to Mrs. Ming at the Chinese restaurant"); if (CheckFirstQuest()) { ClearRVItemContainers(); } DialogueModifier.SetupMarcoRentRoomChoice(); } 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 bool CheckFirstQuest() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_0087: Unknown result type (might be due to invalid IL or missing references) foreach (QuestEntry item in Object.FindObjectsOfType<QuestEntry>()) { if (((item == null) ? null : item.Title?.Trim()) == "Open your phone and read your messages") { bool flag = (int)item.state != 2; Melon<ProperPropertyProgression>.Logger.Msg($"Quest '{"Open your phone and read your messages"}' is {item.state} => shouldClear = {flag}"); return flag; } } Melon<ProperPropertyProgression>.Logger.Warning("First quest not found — defaulting to shouldClear = true"); return true; } 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++; } } Melon<ProperPropertyProgression>.Logger.Msg($"Called DestroyGrid() on {num} Grid objects."); } 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; } } }