Decompiled source of BetterSMT v2.2.0
BepInEx/plugins/BetterSMT.dll
Decompiled 17 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Cinemachine; using HarmonyLib; using HighlightPlus; using HutongGames.PlayMaker; using HutongGames.PlayMaker.Actions; using Microsoft.CodeAnalysis; using Mirror; using StarterAssets; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Mirror")] [assembly: IgnoresAccessChecksTo("PlayMaker")] [assembly: IgnoresAccessChecksTo("Rewired_Core")] [assembly: AssemblyCompany("BetterSMT")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("BetterSMT")] [assembly: AssemblyFileVersion("2.2.0.0")] [assembly: AssemblyInformationalVersion("2.2.0+9998ddb72e17931980928c869ef6cbc1331afc5c")] [assembly: AssemblyProduct("BetterSMT")] [assembly: AssemblyTitle("BetterSMT")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.2.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 BetterSMT { [BepInPlugin("BetterSMT", "BetterSMT", "2.2.0")] public class BetterSMT : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("BetterSMT"); public static BetterSMT Instance; public static ConfigEntry<bool> AutoPayAllInvoices; public static ConfigEntry<int> SalesActiveAmount; public static ConfigEntry<bool> AutoSaveEnabled; public static ConfigEntry<int> AutoSaveTimer; public static ConfigEntry<bool> AutoSaveDuringDay; public static ConfigEntry<int> CustomersPerPerk; public static ConfigEntry<int> MaxCustomerInStore; public static ConfigEntry<int> BaseCustomerSpawns; public static ConfigEntry<int> BaseCustomerCart; public static ConfigEntry<int> MaxCustomerCart; public static ConfigEntry<int> EmployeesLevel; public static ConfigEntry<bool> EmployeesEnabled; public static ConfigEntry<float> EmployeeSpeedPerPerk; public static ConfigEntry<float> EmployeeRestockPerPerk; public static ConfigEntry<float> EmployeeCheckoutPerPerk1; public static ConfigEntry<float> EmployeeCheckoutPerPerk2; public static ConfigEntry<float> EmployeeCheckoutPerPerk3; public static ConfigEntry<float> EmployeExtraCheckoutMoney; public static ConfigEntry<float> LightCostMod; public static ConfigEntry<float> RentCostMod; public static ConfigEntry<float> EmployeeCostMod; public static ConfigEntry<bool> OneHitThief; public static ConfigEntry<bool> SelfCheckoutTheft; public static ConfigEntry<bool> DisableAllThieves; public static ConfigEntry<bool> AllNPCAreThieves; public static ConfigEntry<bool> FasterCheckout; public static ConfigEntry<bool> ShowFPS; public static ConfigEntry<bool> ShowPing; public static ConfigEntry<bool> DisableAllTrash; public static ConfigEntry<bool> AlwaysAbleToDeleteMode; public static ConfigEntry<bool> DeleteAllCheckouts; public static ConfigEntry<bool> AllTrashToRecyclers; public static ConfigEntry<bool> roundDown; public static ConfigEntry<bool> NearestFive; public static ConfigEntry<bool> NearestTen; public static bool doublePrice = true; public static ConfigEntry<bool> ToggleDoublePrice; public static ConfigEntry<bool> AutoAdjustPriceDaily; public static ConfigEntry<float> AutoAdjustPriceDailyValue; public static bool notify = false; public static string notificationType; public static ConfigEntry<bool> AllowFreePlacement; public static ConfigEntry<bool> ProductStacking; public static ConfigEntry<bool> EnablePalletDisplaysPerk; public static ConfigEntry<bool> ReplaceCommasWithPeriods; public static ConfigEntry<string> CurrencyTypeToAny; public static ConfigEntry<bool> StorageHighlighting; public static ConfigEntry<bool> SalesToggle; public static ConfigEntry<KeyboardShortcut> SalesHotkey; public static ConfigEntry<bool> ThirdPersonToggle; public static ConfigEntry<KeyboardShortcut> ThirdPersonHotkey; public static ConfigEntry<KeyboardShortcut> KeyboardShortcutDoublePrice; public static ConfigEntry<KeyboardShortcut> KeyboardShortcutRoundDownSwitch; public static ConfigEntry<KeyboardShortcut> KeyboardShortcutRoundDownToggle; public static ConfigEntry<KeyboardShortcut> EmptyBoxHotkey; public static ConfigEntry<bool> EmptyBoxToggle; public static ConfigEntry<KeyboardShortcut> PricingGunHotkey; public static ConfigEntry<bool> PricingGunToggle; public static ConfigEntry<KeyboardShortcut> BroomHotkey; public static ConfigEntry<bool> BroomToggle; public static ConfigEntry<KeyboardShortcut> DLCTabletHotkey; public static ConfigEntry<bool> DLCTabletToggle; public static ConfigEntry<KeyboardShortcut> EmptyHandsHotkey; public static ConfigEntry<bool> SledgeToggle; public static ConfigEntry<KeyboardShortcut> SledgeHotkey; public static ConfigEntry<bool> OsMartToggle; public static ConfigEntry<KeyboardShortcut> OsMartHotkey; public static ConfigEntry<bool> TrayToggle; public static ConfigEntry<KeyboardShortcut> TrayHotkey; public static ConfigEntry<KeyboardShortcut> LadderHotkey; public static ConfigEntry<bool> LadderToggle; public static ConfigEntry<KeyboardShortcut> ClockHotkey; public static ConfigEntry<bool> ClockToggle; public static ConfigEntry<bool> Tutorial; public static ConfigEntry<bool> NumberKeys; public static ConfigEntry<float> SprintMoveSpeed; public static ConfigEntry<float> MoveSpeed; public static ConfigEntry<int> SelfCheckoutLimit; public static ConfigEntry<bool> TooExpensiveNotifications; public static ConfigEntry<bool> MissingProductNotifications; public static ConfigEntry<int> MaxBoxSize; public static ConfigEntry<bool> DisableBoxCollisions; public static ConfigEntry<bool> FastBoxSpawns; public static ConfigEntry<float> ClockSpeed; public static ConfigEntry<bool> ClockMorning; public static ConfigEntry<bool> AutoOrdering; public static ConfigEntry<bool> QuickStocking; public static ConfigEntry<int> CardboardBalerValue; internal static ManualLogSource Logger { get; private set; } = null; private void Awake() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Expected O, but got Unknown //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Expected O, but got Unknown //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Expected O, but got Unknown //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Expected O, but got Unknown //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Expected O, but got Unknown //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Expected O, but got Unknown //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Expected O, but got Unknown //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Expected O, but got Unknown //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Expected O, but got Unknown //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Expected O, but got Unknown //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Expected O, but got Unknown //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Expected O, but got Unknown //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Expected O, but got Unknown //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Expected O, but got Unknown //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Expected O, but got Unknown //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Expected O, but got Unknown //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Expected O, but got Unknown //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Expected O, but got Unknown //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Expected O, but got Unknown //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Expected O, but got Unknown //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Expected O, but got Unknown //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Expected O, but got Unknown //IL_0698: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Expected O, but got Unknown //IL_06c3: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Expected O, but got Unknown //IL_06ee: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Expected O, but got Unknown //IL_071d: Unknown result type (might be due to invalid IL or missing references) //IL_0727: Expected O, but got Unknown //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_0753: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Expected O, but got Unknown //IL_077e: Unknown result type (might be due to invalid IL or missing references) //IL_0788: Expected O, but got Unknown //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07be: Expected O, but got Unknown //IL_07df: Unknown result type (might be due to invalid IL or missing references) //IL_07e9: Expected O, but got Unknown //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_081f: Expected O, but got Unknown //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_084a: Expected O, but got Unknown //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_0876: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Expected O, but got Unknown //IL_08a1: Unknown result type (might be due to invalid IL or missing references) //IL_08ab: Expected O, but got Unknown //IL_08c7: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: Unknown result type (might be due to invalid IL or missing references) //IL_08e1: Expected O, but got Unknown //IL_0902: Unknown result type (might be due to invalid IL or missing references) //IL_090c: Expected O, but got Unknown //IL_092d: Unknown result type (might be due to invalid IL or missing references) //IL_0937: Expected O, but got Unknown //IL_0953: Unknown result type (might be due to invalid IL or missing references) //IL_0963: Unknown result type (might be due to invalid IL or missing references) //IL_096d: Expected O, but got Unknown //IL_0989: Unknown result type (might be due to invalid IL or missing references) //IL_0999: Unknown result type (might be due to invalid IL or missing references) //IL_09a3: Expected O, but got Unknown //IL_09c4: Unknown result type (might be due to invalid IL or missing references) //IL_09ce: Expected O, but got Unknown //IL_09ef: Unknown result type (might be due to invalid IL or missing references) //IL_09f9: Expected O, but got Unknown //IL_0a15: Unknown result type (might be due to invalid IL or missing references) //IL_0a25: Unknown result type (might be due to invalid IL or missing references) //IL_0a2f: Expected O, but got Unknown //IL_0a50: Unknown result type (might be due to invalid IL or missing references) //IL_0a5a: Expected O, but got Unknown //IL_0a76: Unknown result type (might be due to invalid IL or missing references) //IL_0a86: Unknown result type (might be due to invalid IL or missing references) //IL_0a90: Expected O, but got Unknown //IL_0ab1: Unknown result type (might be due to invalid IL or missing references) //IL_0abb: Expected O, but got Unknown //IL_0ad7: Unknown result type (might be due to invalid IL or missing references) //IL_0ae7: Unknown result type (might be due to invalid IL or missing references) //IL_0af1: Expected O, but got Unknown //IL_0b12: Unknown result type (might be due to invalid IL or missing references) //IL_0b1c: Expected O, but got Unknown //IL_0b38: Unknown result type (might be due to invalid IL or missing references) //IL_0b48: Unknown result type (might be due to invalid IL or missing references) //IL_0b52: Expected O, but got Unknown //IL_0b6e: Unknown result type (might be due to invalid IL or missing references) //IL_0b7e: Unknown result type (might be due to invalid IL or missing references) //IL_0b88: Expected O, but got Unknown //IL_0ba9: Unknown result type (might be due to invalid IL or missing references) //IL_0bb3: Expected O, but got Unknown //IL_0be6: Unknown result type (might be due to invalid IL or missing references) //IL_0bf0: Expected O, but got Unknown //IL_0c11: Unknown result type (might be due to invalid IL or missing references) //IL_0c1b: Expected O, but got Unknown //IL_0c37: Unknown result type (might be due to invalid IL or missing references) //IL_0c47: Unknown result type (might be due to invalid IL or missing references) //IL_0c51: Expected O, but got Unknown //IL_0c72: Unknown result type (might be due to invalid IL or missing references) //IL_0c7c: Expected O, but got Unknown //IL_0c9d: Unknown result type (might be due to invalid IL or missing references) //IL_0ca7: Expected O, but got Unknown //IL_0cc8: Unknown result type (might be due to invalid IL or missing references) //IL_0cd2: Expected O, but got Unknown //IL_0cf7: Unknown result type (might be due to invalid IL or missing references) //IL_0d07: Unknown result type (might be due to invalid IL or missing references) //IL_0d11: Expected O, but got Unknown //IL_0d3e: Unknown result type (might be due to invalid IL or missing references) //IL_0d4e: Unknown result type (might be due to invalid IL or missing references) //IL_0d58: Expected O, but got Unknown //IL_0d79: Unknown result type (might be due to invalid IL or missing references) //IL_0d83: Expected O, but got Unknown //IL_0da4: Unknown result type (might be due to invalid IL or missing references) //IL_0dae: Expected O, but got Unknown //IL_0dd7: Unknown result type (might be due to invalid IL or missing references) //IL_0de1: Expected O, but got Unknown //IL_0e02: Unknown result type (might be due to invalid IL or missing references) //IL_0e0c: Expected O, but got Unknown //IL_0e2d: Unknown result type (might be due to invalid IL or missing references) //IL_0e37: Expected O, but got Unknown //IL_0e58: Unknown result type (might be due to invalid IL or missing references) //IL_0e62: Expected O, but got Unknown //IL_0e95: Unknown result type (might be due to invalid IL or missing references) //IL_0e9f: Expected O, but got Unknown //IL_0ec0: Unknown result type (might be due to invalid IL or missing references) //IL_0eca: Expected O, but got Unknown //IL_0eeb: Unknown result type (might be due to invalid IL or missing references) //IL_0ef5: Expected O, but got Unknown //IL_0f16: Unknown result type (might be due to invalid IL or missing references) //IL_0f20: Expected O, but got Unknown //IL_0f41: Unknown result type (might be due to invalid IL or missing references) //IL_0f4b: Expected O, but got Unknown //IL_0f73: Unknown result type (might be due to invalid IL or missing references) //IL_0f7d: Expected O, but got Unknown //IL_0fa5: Unknown result type (might be due to invalid IL or missing references) //IL_0faf: Expected O, but got Unknown AutoPayAllInvoices = ((BaseUnityPlugin)this).Config.Bind<bool>("Debt", "Enables or disables automatic invoice payment", false, new ConfigDescription("Enables or disables paying for invoices automatically", (AcceptableValueBase)null, Array.Empty<object>())); SalesActiveAmount = ((BaseUnityPlugin)this).Config.Bind<int>("Sales Settings", "Amount of sales unlocked each perk", 2, new ConfigDescription("Adjusts the amount of sales you unlock for each perk", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100), Array.Empty<object>())); AutoSaveEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Save Settings", "Enables Auto Saving", false, new ConfigDescription("Enables or disables automatic saving", (AcceptableValueBase)null, Array.Empty<object>())); AutoSaveTimer = ((BaseUnityPlugin)this).Config.Bind<int>("Auto Saving Settings", "Amount of time between saves", 120, new ConfigDescription("Adjusts the amount of time between auto saves in seconds, default is 120seconds or 2minutes", (AcceptableValueBase)(object)new AcceptableValueRange<int>(30, 900), Array.Empty<object>())); AutoSaveDuringDay = ((BaseUnityPlugin)this).Config.Bind<bool>("Auto Saving Settings", "Enables Auto Saving during the day", false, new ConfigDescription("Enables or disables saving while the store is open, default only autosaves while closed", (AcceptableValueBase)null, Array.Empty<object>())); EmployeExtraCheckoutMoney = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employe Increased Income While Checking Customer Out Perk", 0.1f, new ConfigDescription("Adjust the amount of extra income you receive when an employee checks out a customer (Higher = more income)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.3f), Array.Empty<object>())); EmployeeCheckoutPerPerk1 = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Checkout Time Reduction Perk 1", 0.15f, new ConfigDescription("Adjust the amount of time employees wait to scan items in checkout (Perk 1) (Lower = slower)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.45f), Array.Empty<object>())); EmployeeCheckoutPerPerk2 = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Checkout Time Reduction Perk 2", 0.2f, new ConfigDescription("Adjust the amount of time employees wait to scan items in checkout (Perk 2) (Lower = slower)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.6f), Array.Empty<object>())); EmployeeCheckoutPerPerk3 = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Checkout Time Reduction Perk 3", 0.15f, new ConfigDescription("Adjust the amount of time employees wait to scan items in checkout (Perk 3) (Lower = slower)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.45f), Array.Empty<object>())); MaxCustomerCart = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Maximum amount of product customers will buy", 25, new ConfigDescription("Adjust the maximum amount of product customers will buy", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 75), Array.Empty<object>())); BaseCustomerCart = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Minimum amount of product customers will buy", 5, new ConfigDescription("Adjust the minimum amount of product customers will buy", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 15), Array.Empty<object>())); BaseCustomerSpawns = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Minimum amount of customers that will spawn", 3, new ConfigDescription("Adjust the minimum amount of customer's that can spawn", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 9), Array.Empty<object>())); MaxCustomerInStore = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Max amount of customers in store", 70, new ConfigDescription("Adjust the amount of customers that can spawn at one time", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 210), Array.Empty<object>())); CustomersPerPerk = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Extra Customers per perk", 1, new ConfigDescription("Adjust the amount of customers you gain per perk (Higher number = more customers)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 5), Array.Empty<object>())); EmployeesLevel = ((BaseUnityPlugin)this).Config.Bind<int>("Employee & Customer Settings", "Employees Level", 0, new ConfigDescription("Adjust the level of employee's that spawn (1 sets all of their stats to minimum, 30 sets them all to max)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 30), Array.Empty<object>())); EmployeesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Employee & Customer Settings", "Employees Level Toggle", false, new ConfigDescription("Enables modifying employee levels", (AcceptableValueBase)null, Array.Empty<object>())); EmployeeSpeedPerPerk = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Speed Per Perk", 0.2f, new ConfigDescription("Adjust the amount of speed employees gain per perk (Higher = faster)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.6f), Array.Empty<object>())); EmployeeRestockPerPerk = ((BaseUnityPlugin)this).Config.Bind<float>("Employee & Customer Settings", "Employee Restock Time Reduction Per Perk", 0.05f, new ConfigDescription("Adjust the amount of time it takes for employees to restock per perk (Lower = faster)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 0.15f), Array.Empty<object>())); LightCostMod = ((BaseUnityPlugin)this).Config.Bind<float>("Cost Modifiers", "Adjust the cost of Lights at the end of the day", 10f, new ConfigDescription("Adjust the cost of lights at the end of the day (Higher = more expensive)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 30f), Array.Empty<object>())); EmployeeCostMod = ((BaseUnityPlugin)this).Config.Bind<float>("Cost Modifiers", "Adjust the cost of Employee at the end of the day", 10f, new ConfigDescription("Adjust the cost of Employee at the end of the day (Higher = more expensive)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 30f), Array.Empty<object>())); RentCostMod = ((BaseUnityPlugin)this).Config.Bind<float>("Cost Modifiers", "Adjust the cost of Rent at the end of the day", 10f, new ConfigDescription("Adjust the cost of Rent at the end of the day (Higher = more expensive)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 30f), Array.Empty<object>())); AllNPCAreThieves = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "All Thieves", false, new ConfigDescription("Causes every NPC to be a thief", (AcceptableValueBase)null, Array.Empty<object>())); SelfCheckoutTheft = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "Self-Checkout Theft", true, new ConfigDescription("Enables or disables default game's theft from self checkout", (AcceptableValueBase)null, Array.Empty<object>())); DisableAllThieves = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "Disable Thieves", false, new ConfigDescription("Prevent thieves from spawning (Does not stop checkout-related thieves)", (AcceptableValueBase)null, Array.Empty<object>())); OneHitThief = ((BaseUnityPlugin)this).Config.Bind<bool>("Thieves & Crime Settings", "Thiefs Drop Everything On Hit", false, new ConfigDescription("Thiefs Drop Everything On Hit", (AcceptableValueBase)null, Array.Empty<object>())); FasterCheckout = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Faster Checkout", false, new ConfigDescription("Customers place all items instantly on to the checkout", (AcceptableValueBase)null, Array.Empty<object>())); ShowFPS = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Show FPS Counter", false, (ConfigDescription)null); ShowPing = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Show Ping Counter", false, (ConfigDescription)null); DisableAllTrash = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Despawns trash", false, new ConfigDescription("Despawns all trash at the end of the day", (AcceptableValueBase)null, Array.Empty<object>())); AlwaysAbleToDeleteMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Always access to delete", false, new ConfigDescription("Delete shelves and others while customers are in store and store is open", (AcceptableValueBase)null, Array.Empty<object>())); DeleteAllCheckouts = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "Enable or disable deleting all checkout lanes", false, new ConfigDescription("Adds the ability to delete every checkout lane", (AcceptableValueBase)null, Array.Empty<object>())); AllTrashToRecyclers = ((BaseUnityPlugin)this).Config.Bind<bool>("Gameplay Settings", "All Recyclers", false, new ConfigDescription("Turns the nearest trash can into a recycler without the perk.", (AcceptableValueBase)null, Array.Empty<object>())); StorageHighlighting = ((BaseUnityPlugin)this).Config.Bind<bool>("Highlighting", "Enable or disable highlighting", false, new ConfigDescription("Enables or disables highlighting of product and storage shelves when holding a box", (AcceptableValueBase)null, Array.Empty<object>())); AllowFreePlacement = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Disable Placement Blocking", false, new ConfigDescription("Enables or disables you to place structures wherever, even overlapping", (AcceptableValueBase)null, Array.Empty<object>())); ProductStacking = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Enable product stacking", false, new ConfigDescription("Enables or disables most products in the game to stack on shelves", (AcceptableValueBase)null, Array.Empty<object>())); EnablePalletDisplaysPerk = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Enable pallet displays", false, new ConfigDescription("Enables pallet displays without unlocking the perk.", (AcceptableValueBase)null, Array.Empty<object>())); ReplaceCommasWithPeriods = ((BaseUnityPlugin)this).Config.Bind<bool>("Random Features", "Replace commass with periods", false, new ConfigDescription("Changes all commas in the game into periods.", (AcceptableValueBase)null, Array.Empty<object>())); CurrencyTypeToAny = ((BaseUnityPlugin)this).Config.Bind<string>("Random Features", "CurrencySymbol", "$", new ConfigDescription("Sets the currency symbol used in the game. Default is $.", (AcceptableValueBase)null, Array.Empty<object>())); SalesHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Sales Settings", "Sales Tablet Hotkey", new KeyboardShortcut((KeyCode)108, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Sales Tablet in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); SalesToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Sales Settings", "Sales Tablet Toggle", false, new ConfigDescription("Enables the hotkey to activate Sales Tablet", (AcceptableValueBase)null, Array.Empty<object>())); LadderHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Sledgehammer Hotkey", new KeyboardShortcut((KeyCode)109, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Sledgehammer in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); LadderToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Sledgehammer Toggle", false, new ConfigDescription("Enables the hotkey to activate Sledgehammer", (AcceptableValueBase)null, Array.Empty<object>())); SledgeHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Sledgehammer Hotkey", new KeyboardShortcut((KeyCode)106, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Sledgehammer in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); SledgeToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Sledgehammer Toggle", false, new ConfigDescription("Enables the hotkey to activate Sledgehammer", (AcceptableValueBase)null, Array.Empty<object>())); OsMartHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Os Mart 2.0 Tablet Hotkey", new KeyboardShortcut((KeyCode)104, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Os Mart 2.0 Tablet in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); OsMartToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Os Mart 2.0 Toggle", false, new ConfigDescription("Enables the hotkey to activate Os Mart 2.0", (AcceptableValueBase)null, Array.Empty<object>())); TrayHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Tray Hotkey", new KeyboardShortcut((KeyCode)107, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Tray in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); TrayToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Tray Toggle", false, new ConfigDescription("Enables the hotkey to activate Tray", (AcceptableValueBase)null, Array.Empty<object>())); ClockToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Enable hotkey for clock", false, new ConfigDescription("Enables or disabled hotkey activating clock.", (AcceptableValueBase)null, Array.Empty<object>())); ClockHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Toggle Clock", new KeyboardShortcut((KeyCode)111, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to enable/disable the clock", (AcceptableValueBase)null, Array.Empty<object>())); ThirdPersonHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Third Person Hotkey", new KeyboardShortcut((KeyCode)103, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to enter and leave third person/first person.", (AcceptableValueBase)null, Array.Empty<object>())); ThirdPersonToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Enable or disable third person", false, new ConfigDescription("Enables or disables the hotkey to enter and leave third person/first person", (AcceptableValueBase)null, Array.Empty<object>())); EmptyBoxToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "EmptyBox Toggle", false, new ConfigDescription("Enables the hotkey to activate EmptyBox", (AcceptableValueBase)null, Array.Empty<object>())); EmptyBoxHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "EmptyBox Hotkey", new KeyboardShortcut((KeyCode)98, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a EmptyBox in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); PricingGunToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Pricing Gun Toggle", false, new ConfigDescription("Enables the hotkey to activate Pricing Gun", (AcceptableValueBase)null, Array.Empty<object>())); PricingGunHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Pricing Gun Hotkey", new KeyboardShortcut((KeyCode)121, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Pricing Gun in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); BroomToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "Broom Toggle", false, new ConfigDescription("Enables the hotkey to activate Broom", (AcceptableValueBase)null, Array.Empty<object>())); BroomHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Broom Hotkey", new KeyboardShortcut((KeyCode)117, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a Broom in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); DLCTabletToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Hotkey Configurations", "DLC Tablet Toggle", false, new ConfigDescription("Enables the hotkey to activate DLC Tablet", (AcceptableValueBase)null, Array.Empty<object>())); DLCTabletHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "DLC Tablet Hotkey", new KeyboardShortcut((KeyCode)105, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to spawn a DLC Tablet in your hands.", (AcceptableValueBase)null, Array.Empty<object>())); EmptyHandsHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkey Configurations", "Empty Hands Hotkey", new KeyboardShortcut((KeyCode)114, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to remove active item in your hand.", (AcceptableValueBase)null, Array.Empty<object>())); AutoAdjustPriceDaily = ((BaseUnityPlugin)this).Config.Bind<bool>("Pricing Assistance", "Auto Adjust Prices Daily", false, new ConfigDescription("Enables or disables automatically doubling the price of products daily", (AcceptableValueBase)null, Array.Empty<object>())); AutoAdjustPriceDailyValue = ((BaseUnityPlugin)this).Config.Bind<float>("Pricing Assistance", "Adjust the amount prices are automatically set to every day", 2f, new ConfigDescription("Adjusts the amount prices are set to be multiplied by daily. Value of 2x is 2$ * 2 = 4$. Value of 1.99x is 2$*1.99=3.98", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 2f), Array.Empty<object>())); ToggleDoublePrice = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable or disable double price module", false, new ConfigDescription("Enables or disables the price gun automatically having 2x the market price", (AcceptableValueBase)null, Array.Empty<object>())); KeyboardShortcutDoublePrice = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price Gun", "Enable Double Price module", new KeyboardShortcut((KeyCode)113, Array.Empty<KeyCode>()), new ConfigDescription("Hotkey to enable and disable double price module", (AcceptableValueBase)null, Array.Empty<object>())); roundDown = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable rounding down", false, new ConfigDescription("Enables rounding down to prevent 'Too Expensive'", (AcceptableValueBase)null, Array.Empty<object>())); NearestFive = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable rounding down to nearest 0.05", true, new ConfigDescription("Enable rounding down to the nearest fifth", (AcceptableValueBase)null, Array.Empty<object>())); NearestTen = ((BaseUnityPlugin)this).Config.Bind<bool>("Double Price Gun", "Enable rounding down to nearest 0.10", false, new ConfigDescription("Enable rounding down to the nearest tenth", (AcceptableValueBase)null, Array.Empty<object>())); KeyboardShortcutRoundDownSwitch = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price Gun", "Round Down Shortcuts", new KeyboardShortcut((KeyCode)113, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), new ConfigDescription("Hotkey to round down the double price", (AcceptableValueBase)null, Array.Empty<object>())); KeyboardShortcutRoundDownToggle = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Double Price Gun", "Round Down Hotkey", new KeyboardShortcut((KeyCode)113, (KeyCode[])(object)new KeyCode[2] { (KeyCode)306, (KeyCode)304 }), new ConfigDescription("Hotkey to round down to setting set", (AcceptableValueBase)null, Array.Empty<object>())); Tutorial = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables or disables the tutorial", false, new ConfigDescription("Enables or disables the tutorial at the start of a fresh save", (AcceptableValueBase)null, Array.Empty<object>())); NumberKeys = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables normal numbers", false, new ConfigDescription("Enables or disables using non-numpad numbers to set prices", (AcceptableValueBase)null, Array.Empty<object>())); CardboardBalerValue = ((BaseUnityPlugin)this).Config.Bind<int>("Random QoL", "Cardboard Baler", 10, new ConfigDescription("Adjust the amount of boxes required for the cardboard baler to spit out a bale", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), Array.Empty<object>())); QuickStocking = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables quick stocking", false, new ConfigDescription("Enables or disables stocking the entire box onto shelf in one click", (AcceptableValueBase)null, Array.Empty<object>())); AutoOrdering = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables auto-ordering items", false, new ConfigDescription("Enables or disables automatically adding enough stock to the shopping order when picking up the OS Mart device", (AcceptableValueBase)null, Array.Empty<object>())); ClockMorning = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enables clock usage in morning", false, new ConfigDescription("Enables or disables using the clock in the morning", (AcceptableValueBase)null, Array.Empty<object>())); ClockSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Random QoL", "Clock Speed", 5f, new ConfigDescription("Adjust the amount of speed enabling the clock gives", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 15f), Array.Empty<object>())); DisableBoxCollisions = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable collision with boxes", false, new ConfigDescription("Enables or disables collision with boxes allowing them to stack inside of each other https://i.imgur.com/ffJrHOA.jpeg", (AcceptableValueBase)null, Array.Empty<object>())); FastBoxSpawns = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable fast spawning of boxes", false, new ConfigDescription("Enables or disables making purchases boxes spawn quickly https://i.imgur.com/92Ex4V6.png", (AcceptableValueBase)null, Array.Empty<object>())); MissingProductNotifications = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable notification Missing Product", false, new ConfigDescription("Enables or disables the notification for missing products", (AcceptableValueBase)null, Array.Empty<object>())); TooExpensiveNotifications = ((BaseUnityPlugin)this).Config.Bind<bool>("Random QoL", "Enable or disable notification Too Expensive", false, new ConfigDescription("Enables or disables the notification for too expensive products", (AcceptableValueBase)null, Array.Empty<object>())); SelfCheckoutLimit = ((BaseUnityPlugin)this).Config.Bind<int>("Random QoL", "Product limit on self checkout", 4, new ConfigDescription("Limits the amount of item's a customer can have before using the self checkout", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); MaxBoxSize = ((BaseUnityPlugin)this).Config.Bind<int>("Random QoL", "Modify amount of products in boxes", 1, new ConfigDescription("** WARNING THIS IS EXTREMELY BUGGY IN MULTIPLAYER ** Multiples the amount of product in a box, aswell as it's cost. Higher = more products in box and higher cost https://imgur.com/a/QT5l2Ky", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 25), Array.Empty<object>())); Instance = this; Logger = ((BaseUnityPlugin)this).Logger; harmony.PatchAll(); Logger.LogInfo((object)"Plugin BetterSMT v2.2.0 is loaded!"); } public static void CreateCanvasNotification(string text) { GameObject val = Object.Instantiate<GameObject>(GameCanvas.Instance.notificationPrefab, GameCanvas.Instance.notificationParentTransform); ((TMP_Text)val.GetComponent<TextMeshProUGUI>()).text = text; val.SetActive(true); } public static void CreateImportantNotification(string text) { GameObject val = Object.Instantiate<GameObject>(GameCanvas.Instance.importantNotificationPrefab, GameCanvas.Instance.importantNotificationParentTransform); ((TMP_Text)val.GetComponent<TextMeshProUGUI>()).text = text; val.SetActive(true); } private void Update() { //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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) if (!ToggleDoublePrice.Value) { return; } KeyboardShortcut value = KeyboardShortcutDoublePrice.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { doublePrice = !doublePrice; notificationType = "priceToggle"; notify = true; return; } value = KeyboardShortcutRoundDownSwitch.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { if (NearestTen.Value) { NearestTen.Value = false; NearestFive.Value = true; } else { NearestTen.Value = true; NearestFive.Value = false; } notificationType = "roundDownSwitch"; notify = true; } else { value = KeyboardShortcutRoundDownToggle.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { roundDown.Value = !roundDown.Value; notificationType = "roundDownToggle"; notify = true; } } } private void ConfigSettingChanged(object sender, EventArgs e) { if (NearestFive.Value && NearestTen.Value && NearestFive.Value) { NearestTen.Value = false; } } } public static class PluginInfo { public const string PLUGIN_GUID = "BetterSMT"; public const string PLUGIN_NAME = "BetterSMT"; public const string PLUGIN_VERSION = "2.2.0"; } } namespace BetterSMT.Patches { [HarmonyPatch(typeof(BoxData))] public static class BoxDataPatch { private static int _initialLayer = -1; [HarmonyPostfix] [HarmonyPatch("OnStartClient")] public static void OnStartClientPostfix(BoxData __instance) { ConfigEntry<bool> disableBoxCollisions = BetterSMT.DisableBoxCollisions; if (disableBoxCollisions != null && disableBoxCollisions.Value && !((Object)(object)((__instance != null) ? ((Component)__instance).gameObject : null) == (Object)null)) { ApplyCollisionChanges(((Component)__instance).gameObject); } } private static void ApplyCollisionChanges(GameObject boxObject) { _initialLayer = ((_initialLayer == -1) ? boxObject.layer : _initialLayer); boxObject.layer = 20; Physics.IgnoreLayerCollision(20, 20, true); } } [HarmonyPatch(typeof(Builder_Main))] public class Builder_MainPatch { [HarmonyPatch(typeof(Builder_Main), "RetrieveInitialBehaviours")] [HarmonyPriority(600)] [HarmonyPostfix] public static void WaitEndOfIEnumerable() { if (!BetterSMT.ProductStacking.Value) { return; } GameObject[] productPrefabs = ProductListing.Instance.productPrefabs; Data_Product val2 = default(Data_Product); foreach (GameObject val in productPrefabs) { if (!((Object)(object)val == (Object)null) && val.TryGetComponent<Data_Product>(ref val2)) { val2.isStackable = val2.productID != 0; } } } [HarmonyPatch("DeleteBehaviour")] [HarmonyPrefix] public static bool DeleteWheneverPatch(Builder_Main __instance) { HandleMovableObjects(__instance); HandleDecorations(__instance); return false; } [HarmonyPatch(typeof(Builder_Main), "BuildableBehaviour")] [HarmonyPrefix] public static bool BuildableBehaviourPatch(Builder_Main __instance) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) bool value = BetterSMT.AllowFreePlacement.Value; __instance.correctSector = __instance.CheckCorrectGround(); if (value) { __instance.overlapping = false; __instance.canPlace = __instance.correctSector; HighlightEffect val = default(HighlightEffect); if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val)) { val.glowHQColor = (__instance.canPlace ? Color.green : Color.red); } } else { __instance.overlapping = __instance.pmakerFSM.FsmVariables.GetFsmBool("Overlapping").Value; if (__instance.correctSector && !__instance.overlapping && !__instance.canPlace) { __instance.canPlace = true; HighlightEffect val2 = default(HighlightEffect); if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val2)) { val2.glowHQColor = Color.green; } } if ((!__instance.correctSector || __instance.overlapping) && __instance.canPlace) { __instance.canPlace = false; HighlightEffect val3 = default(HighlightEffect); if (__instance.dummyOBJ.TryGetComponent<HighlightEffect>(ref val3)) { val3.glowHQColor = Color.red; } } } if (__instance.MainPlayer.GetButtonDown("Build") && __instance.canPlace) { Quaternion rotation; if (__instance.currentElementIndex == 0) { GameObject currentMovedOBJ = __instance.currentMovedOBJ; if (Object.op_Implicit((Object)(object)((currentMovedOBJ != null) ? currentMovedOBJ.GetComponent<NetworkIdentity>() : null))) { NetworkSpawner component = ((Component)GameData.Instance).GetComponent<NetworkSpawner>(); GameObject currentMovedOBJ2 = __instance.currentMovedOBJ; Vector3 position = __instance.dummyOBJ.transform.position; rotation = __instance.dummyOBJ.transform.rotation; component.GetMoveData(currentMovedOBJ2, position, ((Quaternion)(ref rotation)).eulerAngles); __instance.currentMovedOBJ.GetComponent<Data_Container>().RemoveMoveEffect(); __instance.currentMovedOBJ = null; __instance.recentlyMoved = true; if (Object.op_Implicit((Object)(object)__instance.dummyOBJ)) { Object.Destroy((Object)(object)__instance.dummyOBJ); } } } else if (!value && GameData.Instance.gameFunds < __instance.buildableCost) { GameCanvas.Instance.CreateCanvasNotification("message6"); } else { NetworkSpawner component2 = ((Component)GameData.Instance).GetComponent<NetworkSpawner>(); int currentPropIndex = __instance.currentPropIndex; Vector3 position2 = __instance.dummyOBJ.transform.position; rotation = __instance.dummyOBJ.transform.rotation; component2.CmdSpawn(currentPropIndex, position2, ((Quaternion)(ref rotation)).eulerAngles); } } __instance.SharedBehaviour(); return false; } private static bool HandleMovableObjects(Builder_Main __instance) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)Camera.main).transform.position, ((Component)Camera.main).transform.forward, ref val, 4f, LayerMask.op_Implicit(__instance.lMask))) { if (((Component)((RaycastHit)(ref val)).transform).gameObject.CompareTag("Movable")) { if ((Object)(object)__instance.oldHitOBJ2 != (Object)null && (Object)(object)((Component)((RaycastHit)(ref val)).transform).gameObject != (Object)(object)__instance.oldHitOBJ2 && (Object)(object)__instance.hEffect2 != (Object)null) { __instance.hEffect2.highlighted = false; } __instance.hEffect2 = ((Component)((RaycastHit)(ref val)).transform).GetComponent<HighlightEffect>(); if ((Object)(object)__instance.hEffect2 != (Object)null) { __instance.hEffect2.highlighted = true; } else { Debug.LogWarning((object)"HighlightEffect not found on Movable object!"); } if (__instance.MainPlayer.GetButtonDown("Build") || __instance.MainPlayer.GetButtonDown("Main Action") || __instance.MainPlayer.GetButtonDown("Secondary Action")) { if (!BetterSMT.AlwaysAbleToDeleteMode.Value) { if (GameData.Instance.isSupermarketOpen) { GameCanvas.Instance.CreateCanvasNotification("message15"); return false; } if (NPC_Manager.Instance.customersnpcParentOBJ.transform.childCount > 0) { GameCanvas.Instance.CreateCanvasNotification("message16"); return false; } } if (__instance.FurnitureContainsProduct(((RaycastHit)(ref val)).transform) && !__instance.MainPlayer.GetButton("Drop Item")) { GameCanvas.Instance.CreateCanvasNotification("message17a"); return false; } if ((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent<Data_Container>() != (Object)null) { int containerID = ((Component)((RaycastHit)(ref val)).transform).GetComponent<Data_Container>().containerID; if (!BetterSMT.DeleteAllCheckouts.Value && (containerID == 6 || containerID == 7) && ((Component)((Component)GameData.Instance).GetComponent<NetworkSpawner>().levelPropsOBJ.transform.GetChild(2)).transform.childCount == 1) { GameCanvas.Instance.CreateCanvasNotification("checkoutwarning"); return false; } } if ((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent<NetworkIdentity>() != (Object)null) { float num = (float)((Component)((RaycastHit)(ref val)).transform).GetComponent<Data_Container>().cost * 0.9f; if (__instance.MainPlayer.GetButton("Drop Item")) { try { MethodInfo method = typeof(Builder_Main).GetMethod("CalculateShelfProductCost", BindingFlags.Instance | BindingFlags.NonPublic); if (method != null) { num += (float)method.Invoke(__instance, new object[1] { ((RaycastHit)(ref val)).transform }); } } catch (Exception ex) { Debug.LogError((object)("Reflection error: " + ex.Message)); } } GameData.Instance.CmdAlterFundsWithoutExperience(num); ((Component)GameData.Instance).GetComponent<NetworkSpawner>().CmdDestroyBox(((Component)((RaycastHit)(ref val)).transform).gameObject); } } __instance.oldHitOBJ2 = ((Component)((RaycastHit)(ref val)).transform).gameObject; return true; } if ((Object)(object)__instance.hEffect2 != (Object)null) { __instance.hEffect2.highlighted = false; } } else if ((Object)(object)__instance.hEffect2 != (Object)null) { __instance.hEffect2.highlighted = false; } return false; } private static bool HandleDecorations(Builder_Main __instance) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)Camera.main).transform.position, ((Component)Camera.main).transform.forward, ref val, 4f, LayerMask.op_Implicit(__instance.lMask))) { if (((Component)((RaycastHit)(ref val)).transform).gameObject.CompareTag("Decoration")) { if ((Object)(object)__instance.oldHitOBJ != (Object)null && (Object)(object)((Component)((RaycastHit)(ref val)).transform).gameObject != (Object)(object)__instance.oldHitOBJ && (Object)(object)__instance.hEffect != (Object)null) { ((Behaviour)__instance.hEffect).enabled = false; } Transform obj = ((RaycastHit)(ref val)).transform.Find("Mesh"); HighlightEffect val2 = ((obj != null) ? ((Component)obj).GetComponent<HighlightEffect>() : null); if ((Object)(object)val2 != (Object)null) { __instance.hEffect = val2; ((Behaviour)__instance.hEffect).enabled = true; } else { Debug.LogWarning((object)"HighlightEffect not found on Decoration!"); } if ((__instance.MainPlayer.GetButtonDown("Build") || __instance.MainPlayer.GetButtonDown("Main Action") || __instance.MainPlayer.GetButtonDown("Secondary Action")) && (Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent<NetworkIdentity>() != (Object)null) { float num = ((Component)((RaycastHit)(ref val)).transform).GetComponent<BuildableInfo>().cost * 0.9f; GameData.Instance.CmdAlterFundsWithoutExperience(num); ((Component)GameData.Instance).GetComponent<NetworkSpawner>().CmdDestroyBox(((Component)((RaycastHit)(ref val)).transform).gameObject); } __instance.oldHitOBJ = ((Component)((RaycastHit)(ref val)).transform).gameObject; return true; } if ((Object)(object)__instance.hEffect != (Object)null) { ((Behaviour)__instance.hEffect).enabled = false; } } else if ((Object)(object)__instance.hEffect != (Object)null) { ((Behaviour)__instance.hEffect).enabled = false; } return false; } } [HarmonyPatch(typeof(CardboardBaler))] public static class CardboardBalerPatch { private static readonly FieldInfo BoxesLimitField = typeof(CardboardBaler).GetField("boxesLimitToCreateACardboardBale", BindingFlags.Instance | BindingFlags.NonPublic); public static bool Prepare() { return BetterSMT.CardboardBalerValue.Value != 10; } [HarmonyPostfix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] public static void SetBoxLimitPostfix(CardboardBaler __instance) { BoxesLimitField?.SetValue(__instance, BetterSMT.CardboardBalerValue.Value); } [HarmonyPatch("OnStartServer")] [HarmonyPostfix] private static void OnStartServerPatch() { float num = BetterSMT.CardboardBalerValue.Value; if (Mathf.Approximately(num, 10f)) { return; } PlayMakerFSM[] array = Object.FindObjectsOfType<PlayMakerFSM>(); foreach (PlayMakerFSM val in array) { if (val.FsmName != "Behaviour" || !((Object)((Component)val).gameObject).name.StartsWith("Trash_Recycle")) { continue; } FsmState[] fsmStates = val.FsmStates; foreach (FsmState val2 in fsmStates) { FsmStateAction[] actions = val2.Actions; foreach (FsmStateAction val3 in actions) { FloatOperator val4 = (FloatOperator)(object)((val3 is FloatOperator) ? val3 : null); if (val4 != null && Mathf.Approximately(val4.float1.Value, 15f)) { val4.float1.Value = num; } } } } } } [HarmonyPatch(typeof(CustomCameraController), "LateUpdate")] public class LateUpdateRaycastPatch { private static bool isThirdPersonEnabled; private static void Postfix(CustomCameraController __instance) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance == (Object)null) && !FsmVariables.GlobalVariables.GetFsmBool("InChat").Value && !__instance.inVehicle && !__instance.isInCameraEvent && BetterSMT.ThirdPersonToggle.Value) { KeyboardShortcut value = BetterSMT.ThirdPersonHotkey.Value; if (((KeyboardShortcut)(ref value)).IsDown()) { isThirdPersonEnabled = !isThirdPersonEnabled; } __instance.inEmoteEvent = isThirdPersonEnabled; Cinemachine3rdPersonFollow thirdPersonFollow = __instance.thirdPersonFollow; if ((Object)(object)thirdPersonFollow != (Object)null) { thirdPersonFollow.CameraDistance = (isThirdPersonEnabled ? 2f : 0f); thirdPersonFollow.CameraCollisionFilter = (isThirdPersonEnabled ? __instance.thirdPersonDefaultLayerMask : LayerMask.op_Implicit(0)); } __instance.ShowCharacter(isThirdPersonEnabled); } } } [HarmonyPatch(typeof(Data_Container), "AddItemToRow")] internal class Patch_AddItemToRow { private static bool Prefix(Data_Container __instance, int containerNumber, int productIDToAdd) { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) if (!BetterSMT.QuickStocking.Value) { return true; } if (!((Component)FirstPersonController.Instance).GetComponent<PlayerPermissions>().RequestRP()) { return false; } bool flag = !((NetworkBehaviour)__instance).isServer && FsmVariables.GlobalVariables.FindFsmBool("HighLatencyMode").Value; if (flag && __instance.highLatencyCooldown) { return false; } if (!Object.op_Implicit((Object)(object)__instance.productlistComponent)) { __instance.productlistComponent = ((Component)GameData.Instance).GetComponent<ProductListing>(); } GameObject val = __instance.productlistComponent.productPrefabs[productIDToAdd]; Vector3 size = val.GetComponent<BoxCollider>().size; if (__instance.isVolumeRestricted && size.x * size.y * size.z < __instance.productVolumeLimit) { GameCanvas.Instance.CreateCanvasNotification("message20"); return false; } if (val.GetComponent<Data_Product>().productContainerClass != __instance.containerClass) { GameCanvas.Instance.CreateCanvasNotification("message0"); return false; } bool isStackable = val.GetComponent<Data_Product>().isStackable; int num = Mathf.FloorToInt(__instance.shelfLength / (size.x * 1.1f)); num = Mathf.Clamp(num, 1, 100); int num2 = Mathf.FloorToInt(__instance.shelfWidth / (size.z * 1.1f)); num2 = Mathf.Clamp(num2, 1, 100); int num3 = num * num2; if (isStackable) { int num4 = Mathf.FloorToInt(__instance.shelfHeight / (size.y * 1.1f)); num4 = Mathf.Clamp(num4, 1, 100); num3 = num * num2 * num4; } int num5 = containerNumber * 2; int num6 = __instance.productInfoArray[num5]; int num7 = __instance.productInfoArray[num5 + 1]; if (num7 >= num3) { GameCanvas.Instance.CreateCanvasNotification("message1"); return false; } if (num6 != productIDToAdd && num6 != -1 && num7 != 0) { GameCanvas.Instance.CreateCanvasNotification("message2"); return false; } PlayerNetwork component = ((Component)FirstPersonController.Instance).GetComponent<PlayerNetwork>(); if (flag) { ((MonoBehaviour)__instance).StartCoroutine(__instance.HighLatencyCoroutine()); int num8 = num3 - num7; int extraParameter = component.extraParameter2; int num9 = Mathf.Min(num8, extraParameter); if (num9 <= 0) { GameCanvas.Instance.CreateCanvasNotification("message1"); return false; } component.extraParameter2 -= num9; num7 += num9; AchievementsManager.Instance.CmdAddAchievementPoint(1, num9); } else { int extraParameter2 = component.extraParameter2; int num10 = num3 - num7; int num11 = Mathf.Min(extraParameter2, num10); if (num11 <= 0) { GameCanvas.Instance.CreateCanvasNotification("message1"); return false; } AchievementsManager.Instance.CmdAddAchievementPoint(1, num11); component.extraParameter2 -= num11; num7 += num11; } GameData.Instance.PlayPopSound(); __instance.productInfoArray[num5 + 1] = num7; __instance.CmdUpdateArrayValues(num5, productIDToAdd, num7); return false; } } [HarmonyPatch(typeof(DebtManager), "OnStartClient")] public static class DebtManagerPatch { private static void Postfix(DebtManager __instance) { if (!((Object)(object)__instance == (Object)null)) { __instance.autopayInvoices = BetterSMT.AutoPayAllInvoices?.Value ?? false; } } } [HarmonyPatch(typeof(EmployeesDataGeneration))] public class EmployeesDataGenerationPatch { [HarmonyPatch("GenerateTodayEmployeesData")] [HarmonyPostfix] private static void GenerateTodayEmployeesDataPatch(EmployeesDataGeneration __instance) { EmployeeLevelPatch(__instance); } public static void EmployeeLevelPatch(EmployeesDataGeneration __instance) { int num = Random.Range(0, 5); int num2 = Random.Range(5, 10); for (int i = 0; i < 10; i++) { int num3 = Random.Range(0, 7); int num4; int num5; int num6; int num7; if (i == num) { num4 = Random.Range(6, 11); num5 = Random.Range(7, 11); num6 = Random.Range(6, 11); num7 = Random.Range(7, 11); } else if (i == num2) { num4 = Random.Range(5, 11); num5 = Random.Range(4, 11); num6 = Random.Range(5, 11); num7 = Random.Range(4, 11); } else { num4 = Random.Range(1, 11); num5 = Random.Range(1, 11); num6 = Random.Range(1, 11); num7 = Random.Range(1, 11); } if (BetterSMT.EmployeesEnabled.Value) { num4 = BetterSMT.EmployeesLevel.Value; num5 = BetterSMT.EmployeesLevel.Value; num6 = BetterSMT.EmployeesLevel.Value; num7 = BetterSMT.EmployeesLevel.Value; } int num8 = (num4 + num5 + num6 + num7) * Random.Range(3, 6) + Random.Range(-2, 3) * 10; num8 = Mathf.Clamp(num8, 30, 1000); string text = num3 + "|" + num8 + "|" + num4 + "|" + num5 + "|" + num6 + "|" + num7; __instance.managerComponent.todaysEmployeesData[i] = text; __instance.managerComponent.UpdateTodayEmployeesOnClients(i, text); } } } [HarmonyPatch(typeof(GameCanvas))] internal class NotificationHandler { [HarmonyPatch("Update")] [HarmonyPostfix] public static void NotificationHandler_Postfix(GameCanvas __instance, ref bool ___inCooldown) { if (!BetterSMT.ToggleDoublePrice.Value || !BetterSMT.notify) { return; } ___inCooldown = false; BetterSMT.notify = false; string text = "`"; switch (BetterSMT.notificationType) { default: return; case "priceToggle": text = text + "Double Price: " + (BetterSMT.doublePrice ? "ON" : "OFF"); break; case "roundDownSwitch": text = text + "Rounding to nearest " + (BetterSMT.NearestTen.Value ? "ten" : "five"); if (!BetterSMT.roundDown.Value) { text += "\r\n(Currently disabled)"; } break; case "roundDownToggle": text = text + "Rounding has been " + (BetterSMT.roundDown.Value ? "enabled" : "disabled"); break; } __instance.CreateCanvasNotification(text); } } [HarmonyPatch(typeof(GameData))] public class GameDataPatch { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__2_0; internal void <UpdateEscapeMenu>b__2_0() { ((MonoBehaviour)GameData.Instance).StartCoroutine(SaveGame()); } } [CompilerGenerated] private sealed class <SaveGame>d__3 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private NetworkSpawner <spawner>5__1; private PlayMakerFSM <fsm>5__2; private FsmBool <isSavingVar>5__3; private float <timeout>5__4; private float <elapsed>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SaveGame>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <spawner>5__1 = null; <fsm>5__2 = null; <isSavingVar>5__3 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <spawner>5__1 = ((Component)GameData.Instance).GetComponent<NetworkSpawner>(); if (<spawner>5__1.isSaving) { BetterSMT.CreateImportantNotification("Saving already in progress"); return false; } BetterSMT.CreateImportantNotification("Saving Game"); GameData.Instance.DoDaySaveBackup(); <fsm>5__2 = GameData.Instance.SaveOBJ.GetComponent<PlayMakerFSM>(); <isSavingVar>5__3 = <fsm>5__2.FsmVariables.GetFsmBool("IsSaving"); <isSavingVar>5__3.Value = true; <fsm>5__2.SendEvent("Send_Data"); <timeout>5__4 = 10f; <elapsed>5__5 = 0f; goto IL_0125; case 1: <>1__state = -1; goto IL_0125; case 2: { <>1__state = -1; BetterSMT.CreateImportantNotification("Saving Finished"); return false; } IL_0125: if (<isSavingVar>5__3.Value) { if (<elapsed>5__5 > <timeout>5__4) { BetterSMT.CreateImportantNotification("Save timed out."); return false; } <elapsed>5__5 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } <>2__current = <spawner>5__1.SavePropsCoroutine(); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static readonly Dictionary<int, string> productNames = new Dictionary<int, string> { { 0, "Pasta Penne" }, { 1, "Water Bottle" }, { 2, "Honey Cereals" }, { 3, "Rice" }, { 4, "Salt" }, { 5, "Sugar" }, { 6, "Margarine" }, { 7, "Flour" }, { 8, "Apple Juice" }, { 9, "Olive Oil" }, { 10, "Ketchup" }, { 11, "Sliced Bread" }, { 12, "Pepper" }, { 13, "Orange Juice" }, { 14, "Barbaque Sauce" }, { 15, "Mustard Sauce" }, { 16, "Spaghetti Box" }, { 17, "Tuna Pate" }, { 18, "Fiber Cereals" }, { 19, "Supreme Flour" }, { 20, "Black Coffee" }, { 21, "Egg Box" }, { 22, "Houmous" }, { 23, "White Flour" }, { 24, "Cane Sugar Box" }, { 25, "Sugar" }, { 26, "Macarroni" }, { 27, "Ecologic Sugar" }, { 28, "Brown Sugar" }, { 29, "Sunflower Oil" }, { 30, "Mash Potatoes" }, { 31, "Potato Bag" }, { 32, "Espresso Coffee" }, { 33, "Basmati Rice" }, { 34, "Long Grain Rice" }, { 35, "Coffee" }, { 36, "Supreme Pasta" }, { 37, "Chocolate Cereals" }, { 38, "Premium Water" }, { 39, "Spring Water" }, { 40, "Powdered Sugar" }, { 41, "Sugar - Big Box" }, { 42, "Brown Sugar - Big Box" }, { 43, "Emmental Cheese" }, { 44, "Gruyere Cheese" }, { 45, "Skimmed Cheese" }, { 46, "Fruit Yoghurt" }, { 47, "Vanilla Yoghurt" }, { 48, "Milk Brick" }, { 49, "Butter" }, { 50, "Parmigiano Cheese" }, { 51, "Reggiano Cheese" }, { 52, "Mozzarella Cheese" }, { 53, "Skimmed Yoghurt" }, { 54, "Cola Pack" }, { 55, "Soda Pack" }, { 56, "Decaf Soda Pack" }, { 57, "Soda Bottle" }, { 58, "Cola Bottle" }, { 59, "Sugar Free Soda Bottle" }, { 60, "Premium Soda" }, { 61, "Pizza Barbaque" }, { 62, "Fondue" }, { 63, "Crocanti Ham" }, { 64, "Ham Cheese Crepe" }, { 65, "French Fries" }, { 66, "Crispy Potato Pops" }, { 67, "Green Beans" }, { 68, "Four Cheese Pizza" }, { 69, "Four Seasons Pizza" }, { 70, "Vegetable Mix" }, { 71, "Chicken Mix" }, { 72, "Bolognaise Lasagna" }, { 73, "Vegetable Lasagna" }, { 74, "Toothpaste" }, { 75, "Toilet Paper" }, { 76, "Hand Soap" }, { 77, "Avocado Shampoo" }, { 78, "Egg Shampoo" }, { 79, "Bath Gel" }, { 80, "Toilet Paper" }, { 81, "Mango Soap" }, { 82, "Extra Soft Shampoo" }, { 83, "Jojoba Honey Shampoo" }, { 84, "Argan Oil Shampoo" }, { 85, "Paper Towel" }, { 86, "Double Side Toilet Paper" }, { 87, "Lemon Soap" }, { 88, "Premium Bath Gel" }, { 89, "Shampoo For Babies" }, { 90, "Detergent" }, { 91, "Stain Remover" }, { 92, "Glass Cleaner" }, { 93, "Detergent Tables" }, { 94, "Dishwasher" }, { 95, "Bleach" }, { 96, "Bleach - Big Bottle" }, { 97, "Softener" }, { 98, "Premium Detergent" }, { 99, "Insecticide" }, { 100, "Cleaning Cloths" }, { 101, "Premium Capsules" }, { 102, "Premium Bleach" }, { 103, "Ammonia" }, { 104, "Cookie Jar" }, { 105, "Maxi Cone" }, { 106, "Chocolate Spread" }, { 107, "Chocolate Powder" }, { 108, "Chips" }, { 109, "Sweet Bonbek" }, { 110, "Peach Jam" }, { 111, "Ice Cream Box" }, { 112, "Chocolate Box" }, { 113, "Chocolate Biscuit" }, { 114, "Vanilate Biscuit" }, { 115, "Madeleine" }, { 116, "Strawberry Jam" }, { 117, "Peanut Butter" }, { 118, "Chipos" }, { 119, "Marshmallow" }, { 120, "Lemon Biscuit" }, { 121, "Hazelnut Biscuit" }, { 122, "Premium Ice Cream" }, { 123, "Honey" }, { 124, "Premium Chocolate Box" }, { 125, "Foditos" }, { 126, "Premium Cake" }, { 127, "Chopped Beef" }, { 128, "Pure Beef" }, { 129, "Veal" }, { 130, "Chicken Wings" }, { 131, "Chicken" }, { 132, "Parma Ham" }, { 133, "Sliced Ham" }, { 134, "Peas - Big" }, { 135, "Tuna - Big" }, { 136, "Red Beans" }, { 137, "Cat Food" }, { 138, "Cat Food" }, { 139, "Dog Food" }, { 140, "Green Tea" }, { 141, "Lemon Tea" }, { 142, "Black Tea" }, { 143, "Peppermint" }, { 144, "Mint" }, { 145, "Valerian" }, { 146, "Big Sushi" }, { 147, "Small Sushi" }, { 148, "Smoked Salmon" }, { 149, "Crab Sticks" }, { 150, "Book - Electromagnetic" }, { 151, "Book - Surprise" }, { 152, "Book - ABC" }, { 153, "Book - Mother And Child" }, { 154, "Book - Colors" }, { 155, "Book - Piticha" }, { 156, "Book - OnceUpon" }, { 157, "Book - Krok" }, { 158, "Book - Adventures" }, { 159, "Book - Donnine" }, { 160, "Book - Vintage" }, { 161, "Book - I Wont Share" }, { 162, "Beer Pack" }, { 163, "Beer Pack" }, { 164, "Beer Pack" }, { 165, "Beer Barrel" }, { 166, "Beer Barrel" }, { 167, "Vodka" }, { 168, "Red Wine" }, { 169, "Rose Wine" }, { 170, "White Wine" }, { 171, "Beer Barrel" }, { 172, "Premium Vodka" }, { 173, "Japanese Whisky" }, { 174, "Premium Whisky" }, { 175, "Premium Whisky" }, { 176, "Hydrogen Peroxide" }, { 177, "Disinfectant" }, { 178, "Ibuprofen" }, { 179, "Paracetamol" }, { 180, "Adhesive Bandages" }, { 181, "Laxative" }, { 182, "Antihistamine" }, { 183, "Zinc Supplement" }, { 184, "Antioxidant" }, { 185, "Fish Oil" }, { 186, "Algae Pills" }, { 187, "Vitamins" }, { 188, "Melatonin" }, { 189, "Sunscreen" }, { 190, "Stretch Cream" }, { 191, "Red Apple Tray" }, { 192, "Green Apple Tray" }, { 193, "Clementine Tray" }, { 194, "Orange Tray" }, { 195, "Pear Tray" }, { 196, "Lemon Tray" }, { 197, "Mango Tray" }, { 198, "Avocado Tray" }, { 199, "Kiwi Tray" }, { 200, "Papaya Tray" }, { 201, "Strawberry Tray" }, { 202, "Cherry Tray" }, { 203, "Artichoke Tray" }, { 204, "Zucchini Tray" }, { 205, "Carrot Tray" }, { 206, "Tomato Tray" }, { 207, "Potato Tray" }, { 208, "Onion Tray" }, { 209, "Banana Pack" }, { 210, "Melon" }, { 211, "Pineapple" }, { 212, "Pumpkin" }, { 213, "Watermelon" }, { 214, "Baby Food: Vegetables" }, { 215, "Baby Food: Fish" }, { 216, "Baby Food: Fruits" }, { 217, "Baby Food: Meat" }, { 218, "Nutritive Milk Mix" }, { 219, "Nutritive Milk Powder" }, { 220, "Ecologic Diapers" }, { 221, "Basic Diapers" }, { 222, "Toddler Diapers" }, { 223, "Premium Diapers" }, { 224, "Aloe Baby Wipes " }, { 225, "Basic Baby Wipes" }, { 226, "Baby Powder" }, { 227, "Orange Soda" }, { 228, "Pineapple Soda" }, { 229, "Tropical Soda" }, { 230, "Green Tea Drink" }, { 231, "Red Tea Drink" }, { 232, "Lemon Tea Drink" }, { 233, "Cold Brew Coffee" }, { 234, "Blueberry Energy Drink" }, { 235, "Guava Energy Drink" }, { 236, "Lima Energy Drink" }, { 237, "Fruit Punch Energy Drink" }, { 238, "Mango Energy Drink" }, { 239, "Cola Energy Drink" }, { 240, "Sugar Free Energy Drink" }, { 241, "Basic Strawberry Ice Cream" }, { 242, "Lemon Ice Cream" }, { 243, "Coffee Ice Cream" }, { 244, "Stracciatella Ice Cream" }, { 245, "Strawberry Meringue Ice Cream" }, { 246, "Caramel Ice Cream" }, { 247, "Premium Strawberry Ice Cream" }, { 248, "Strawberry Cheesecake Ice Cream" }, { 249, "Premium Caramel Ice Cream" }, { 250, "Pink Strawberry Ice Cream" }, { 251, "Alcoholic Ice Cream" }, { 252, "Chickpeas" }, { 253, "Meatballs" }, { 254, "Lentils" }, { 255, "Tomato Soup" }, { 256, "Canned Corn" }, { 257, "Canned Peas" }, { 258, "Strawberry Seeds" }, { 259, "Raspberry Seeds" }, { 260, "Blueberry Seeds" }, { 261, "Pineapple Seeds" }, { 262, "Meyer Lemon Seeds" }, { 263, "Tomato Seeds" }, { 264, "Pepper Seeds" }, { 265, "Cucumber Seeds" }, { 266, "Radish Seeds" }, { 267, "Carrots Seeds" }, { 268, "Lawn Seeds" }, { 269, "Poppy Seeds" }, { 270, "Tulip Seeds" }, { 271, "Sunflower Seeds" }, { 272, "Petunia Seeds" }, { 273, "Hand Rake (A)" }, { 274, "Hand Rake (B)" }, { 275, "Hand Shovel" }, { 276, "Hand Cultivator" }, { 277, "Potting Soil" }, { 278, "Fertilizer" }, { 279, "Plant Pot Dish" }, { 280, "Plant Pot" }, { 281, "AA Batteries" }, { 282, "AAA Batteries" }, { 283, "C Batteries" }, { 284, "9V Batteries" }, { 285, "Universal TV Remote" }, { 286, "Universal Phone Charger" }, { 287, "Basic Prepaid Phone" }, { 288, "Basic Mouse" }, { 289, "Wifi Dongle" }, { 290, "Basic Earbuds" }, { 291, "Basic Keyboard" }, { 292, "Basic Gamepad" }, { 293, "USB Flash Drive (128GB)" }, { 294, "USB Flash Drive (256GB)" }, { 295, "USB Flash Drive (512GB)" }, { 296, "USB Flash Drive (1TB)" }, { 297, "Basic Speaker" }, { 298, "Basic Headphones" }, { 299, "Basic Gaming Console" } }; [HarmonyPatch(typeof(GameData), "ServerCalculateNewInflation")] [HarmonyPostfix] public static void OptimizeProductPrices() { if (BetterSMT.AutoAdjustPriceDaily.Value) { } } [HarmonyPatch("OnStartClient")] [HarmonyPostfix] private static void UpdateEscapeMenu() { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: 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_01d9: Expected O, but got Unknown GameObject val = GameObject.Find("MasterOBJ/MasterCanvas/Menus/EscapeMenu/"); if ((Object)(object)val == (Object)null) { BetterSMT.Logger.LogWarning((object)"EscapeMenu not found."); return; } Transform obj = val.transform.Find("QuitButton"); GameObject val2 = ((obj != null) ? ((Component)obj).gameObject : null); Transform obj2 = val.transform.Find("MainMenuButton"); GameObject val3 = ((obj2 != null) ? ((Component)obj2).gameObject : null); Transform obj3 = val.transform.Find("OptionsButton"); GameObject val4 = ((obj3 != null) ? ((Component)obj3).gameObject : null); if ((Object)(object)val2 == (Object)null || (Object)(object)val3 == (Object)null) { BetterSMT.Logger.LogWarning((object)"Quit or MainMenu button not found."); return; } val2.transform.localPosition = new Vector3(0f, 0f, 0f); val3.transform.localPosition = new Vector3(0f, 85f, 0f); GameObject val5 = Object.Instantiate<GameObject>(val2, val.transform); ((Object)val5).name = "SaveButton"; PlayMakerFSM[] components = val5.GetComponents<PlayMakerFSM>(); foreach (PlayMakerFSM val6 in components) { Object.Destroy((Object)(object)val6); } Object.Destroy((Object)(object)val5.GetComponent<EventTrigger>()); val5.transform.localPosition = new Vector3(0f, -85f, 0f); val5.transform.localScale = val2.transform.localScale; TextMeshProUGUI componentInChildren = val5.GetComponentInChildren<TextMeshProUGUI>(); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)componentInChildren).text = "Save Game"; } Button component = val5.GetComponent<Button>(); ButtonClickedEvent onClick = component.onClick; object obj4 = <>c.<>9__2_0; if (obj4 == null) { UnityAction val7 = delegate { ((MonoBehaviour)GameData.Instance).StartCoroutine(SaveGame()); }; <>c.<>9__2_0 = val7; obj4 = (object)val7; } ((UnityEvent)onClick).AddListener((UnityAction)obj4); if (!((NetworkBehaviour)GameData.Instance).isServer) { val5.SetActive(false); } } [IteratorStateMachine(typeof(<SaveGame>d__3))] public static IEnumerator SaveGame() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SaveGame>d__3(0); } [HarmonyPatch("OnStartClient")] [HarmonyPostfix] public static void ShowCounters() { if (BetterSMT.ShowPing.Value) { EnableUIElement("MasterOBJ/MasterCanvas/Ping", "Ping"); } if (BetterSMT.ShowFPS.Value) { EnableUIElement("MasterOBJ/MasterCanvas/FPSDisplay", "FPSDisplay"); } } private static void EnableUIElement(string path, string label) { GameObject val = GameObject.Find(path); if ((Object)(object)val == (Object)null) { BetterSMT.Logger.LogWarning((object)("Couldn't find " + label + " object at path '" + path + "'")); } else { val.SetActive(true); } } [HarmonyPatch("AddExpensiveList")] [HarmonyPostfix] public static void AddExpensiveListPatch(GameData __instance, int productID) { NotifyAndTrack(__instance.productsTooExpensiveList, productID, BetterSMT.TooExpensiveNotifications.Value, "{0} is too expensive.", __instance); } [HarmonyPatch("AddNotFoundList")] [HarmonyPostfix] public static void AddNotFoundListPatch(GameData __instance, int productID) { NotifyAndTrack(__instance.productsNotFoundList, productID, BetterSMT.MissingProductNotifications.Value, "{0} is not found on the shelf.", __instance); } private static void NotifyAndTrack(List<int> list, int productID, bool notifyEnabled, string messageTemplate, GameData __instance) { if (!list.Contains(productID)) { list.Add(productID); } if (notifyEnabled) { string value; string arg = (productNames.TryGetValue(productID, out value) ? value : $"Product {productID}"); PlayerObjectController val = Object.FindObjectOfType<PlayerObjectController>(); string text = string.Format(messageTemplate, arg); if (val != null) { val.CmdSendMessage(text, (NetworkConnectionToClient)null); } } } [HarmonyPatch(typeof(GameData), "UserCode_CmdOpenSupermarket")] [HarmonyPostfix] public static void MaxCustomersNPCsPatch(GameData __instance) { if (__instance.isSupermarketOpen || (__instance.timeOfDay > 8f && __instance.timeOfDay < 23f)) { int count = NetworkServer.connections.Count; int value = BetterSMT.BaseCustomerCart.Value; int value2 = BetterSMT.MaxCustomerCart.Value; int value3 = BetterSMT.BaseCustomerSpawns.Value; int value4 = BetterSMT.MaxCustomerInStore.Value; __instance.maxProductsCustomersToBuy = Mathf.Clamp(value + __instance.gameDay / 2 + count + __instance.difficulty, value, value2 + count + __instance.difficulty); __instance.maxCustomersNPCs = Mathf.Clamp(value3 + __instance.gameDay + (count - 1) * 4 + __instance.extraCustomersPerk + __instance.difficulty * 2, value3, value4 + count); } } [HarmonyPatch("TrashManager")] [HarmonyPostfix] public static void NextTimeToSpawnTrashPatch(GameData __instance) { if (BetterSMT.DisableAllTrash.Value) { __instance.nextTimeToSpawnTrash = float.MaxValue; } } [HarmonyPatch("WorkingDayControl")] [HarmonyPostfix] public static void WorkingDayLightControlPatch(GameData __instance) { UpgradesManager component = ((Component)__instance).GetComponent<UpgradesManager>(); int num = component?.spaceBought ?? 0; int num2 = component?.storageBought ?? 0; float num3 = (((Object)(object)component != (Object)null) ? BetterSMT.LightCostMod.Value : 10f); __instance.lightCost = num3 + (float)num + (float)num2; } [HarmonyPatch("WorkingDayControl")] [HarmonyPostfix] public static void WorkingDayRentControlPatch(GameData __instance) { UpgradesManager component = ((Component)__instance).GetComponent<UpgradesManager>(); int num = component?.spaceBought ?? 0; int num2 = component?.storageBought ?? 0; float num3 = (((Object)(object)component != (Object)null) ? BetterSMT.RentCostMod.Value : 10f); __instance.rentCost = num3 + (float)(num * 5) + (float)(num2 * 10); } [HarmonyPatch("WorkingDayControl")] [HarmonyPostfix] public static void WorkingDayEmployeeControlPatch(GameData __instance) { UpgradesManager component = ((Component)__instance).GetComponent<UpgradesManager>(); int num = NPC_Manager.Instance?.maxEmployees ?? 0; float num2 = (((Object)(object)component != (Object)null) ? BetterSMT.EmployeeCostMod.Value : 0f); __instance.employeesCost = num2 + (float)(num * 60); } } [HarmonyPatch(typeof(LocalizationManager))] internal class LocalizationHandler { [HarmonyPatch("GetLocalizationString")] [HarmonyPrefix] public static bool NoLocalization_Prefix(ref string key, ref string __result) { if (key[0] == '`') { string text = key; __result = text.Substring(1, text.Length - 1); return false; } return true; } } [HarmonyPatch(typeof(ManagerBlackboard))] public class ManagerBlackboardPatch { [CompilerGenerated] private sealed class <CalculateShoppingListTotalOverride>d__1 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ManagerBlackboard __instance; private IEnumerator <>s__1; private Transform <item>5__2; private string <text>5__3; private string <cleanedText>5__4; private float <price>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CalculateShoppingListTotalOverride>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = null; <item>5__2 = null; <text>5__3 = null; <cleanedText>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (BetterSMT.ReplaceCommasWithPeriods.Value) { <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } break; case 1: <>1__state = -1; __instance.shoppingTotalCharge = 0f; if (__instance.shoppingListParent.transform.childCount > 0) { <>s__1 = __instance.shoppingListParent.transform.GetEnumerator(); try { while (<>s__1.MoveNext()) { <item>5__2 = (Transform)<>s__1.Current; <text>5__3 = ((TMP_Text)((Component)((Component)<item>5__2).transform.Find("BoxPrice")).GetComponent<TextMeshProUGUI>()).text; string text = <text>5__3; <cleanedText>5__4 = text.Substring(2, text.Length - 2).Trim(); if (float.TryParse(<cleanedText>5__4, NumberStyles.Float, CultureInfo.InvariantCulture, out <price>5__5)) { ManagerBlackboard _instance = __instance; _instance.shoppingTotalCharge += <price>5__5; } <text>5__3 = null; <cleanedText>5__4 = null; <item>5__2 = null; } } finally { if (<>s__1 is IDisposable disposable) { disposable.Dispose(); } } <>s__1 = null; } ((TMP_Text)__instance.totalChargeOBJ).text = ProductListing.Instance.ConvertFloatToTextPrice(__instance.shoppingTotalCharge); break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyTranspiler] private static IEnumerable<CodeInstruction> InstantCargoSpawner(IEnumerable<CodeInstruction> instructions) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown return BetterSMT.FastBoxSpawns.Value ? new CodeMatcher(instructions, (ILGenerator)null).Start().MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((OpCode?)OpCodes.Newobj, (object)AccessTools.Constructor(typeof(WaitForSeconds), new Type[1] { typeof(float) }, false), (string)null) }).Repeat((Action<CodeMatcher>)delegate(CodeMatcher matcher) { matcher.Advance(-1); matcher.SetOperandAndAdvance((object)0.01f); matcher.Advance(1); }, (Action<string>)null) .InstructionEnumeration() : instructions; } [IteratorStateMachine(typeof(<CalculateShoppingListTotalOverride>d__1))] public static IEnumerator CalculateShoppingListTotalOverride(ManagerBlackboard __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CalculateShoppingListTotalOverride>d__1(0) { __instance = __instance }; } [HarmonyPatch("RemoveShoppingListProduct")] [HarmonyPrefix] public static void RemoveShoppingListProductPatch(ManagerBlackboard __instance, int indexToRemove) { if (BetterSMT.ReplaceCommasWithPeriods.Value) { if (__instance.shoppingListParent.transform.childCount > 0) { Object.Destroy((Object)(object)((Component)__instance.shoppingListParent.transform.GetChild(indexToRemove)).gameObject); } ((MonoBehaviour)__instance).StartCoroutine(CalculateShoppingListTotalOverride(__instance)); } } [HarmonyPatch("RemoveAllShoppingList")] [HarmonyPrefix] public static void RemoveAllShoppingListPatch(ManagerBlackboard __instance) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown if (!BetterSMT.ReplaceCommasWithPeriods.Value || __instance.shoppingListParent.transform.childCount == 0) { return; } foreach (Transform item in __instance.shoppingListParent.transform) { Transform val = item; Object.Destroy((Object)(object)((Component)val).gameObject); } ((MonoBehaviour)__instance).StartCoroutine(CalculateShoppingListTotalOverride(__instance)); } [HarmonyPatch("AddShoppingListProduct")] [HarmonyPrefix] public static bool AddShoppingListProductPatch(ManagerBlackboard __instance, int productID, float boxPrice) { if (BetterSMT.ReplaceCommasWithPeriods.Value) { ProductListing component = ((Component)__instance).GetComponent<ProductListing>(); GameObject val = Object.Instantiate<GameObject>(__instance.UIShoppingListPrefab, __instance.shoppingListParent.transform); string text = "product" + productID; string localizationString = LocalizationManager.instance.GetLocalizationString(text); ((TMP_Text)((Component)val.transform.Find("ProductName")).GetComponent<TextMeshProUGUI>()).text = localizationString; GameObject val2 = component.productPrefabs[productID]; string productBrand = val2.GetComponent<Data_Product>().productBrand; ((TMP_Text)((Component)val.transform.Find("BrandName")).GetComponent<TextMeshProUGUI>()).text = productBrand; int maxItemsPerBox = val2.GetComponent<Data_Product>().maxItemsPerBox; ((TMP_Text)((Component)val.transform.Find("BoxQuantity")).GetComponent<TextMeshProUGUI>()).text = "x" + maxItemsPerBox.ToString("F2", CultureInfo.InvariantCulture); ((TMP_Text)((Component)val.transform.Find("BoxPrice")).GetComponent<TextMeshProUGUI>()).text = " $" + boxPrice.ToString("F2", CultureInfo.InvariantCulture); val.GetComponent<InteractableData>().thisSkillIndex = productID; ((MonoBehaviour)__instance).StartCoroutine(CalculateShoppingListTotalOverride(__instance)); return false; } return true; } } [HarmonyPatch(typeof(NPC_Info))] public class NPC_InfoPatch { [HarmonyPatch(typeof(NPC_Info))] public class DisableThievesPatch { [HarmonyPatch("CreateNPCCharacter")] [HarmonyPostfix] private static void MakeNPCsThieves(ref bool ___isAThief) { ___isAThief = BetterSMT.AllNPCAreThieves.Value || (!BetterSMT.DisableAllThieves.Value & ___isAThief); } } [HarmonyPatch("PlaceProducts")] [HarmonyPrefix] private static void PlaceProductsPatch(NPC_Info __instance) { __instance.productItemPlaceWait = (BetterSMT.FasterCheckout.Value ? 0f : 0.5f); } [HarmonyPatch("AuxiliarAnimationPlay")] [HarmonyPrefix] private static bool AuxiliarAnimationPlayPatch(NPC_Info __instance, ref int animationIndex) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (!BetterSMT.OneHitThief.Value) { return true; } if (!__instance.beingPushed) { ((MonoBehaviour)__instance).StartCoroutine(__instance.StopSpeed()); } if (__instance.isAThief && __instance.productsIDCarrying.Count > 0) { int count = __instance.productsIDCarrying.Count; for (int i = 0; i < count; i++) { GameObject val = Object.Instantiate<GameObject>(__instance.stolenProductPrefab, NPC_Manager.Instance.droppedProductsParentOBJ.transform); val.transform.position = ((Component)__instance).transform.position + new Vector3(Random.Range(-0.4f, 0.4f), 0f, Random.Range(-0.4f, 0.4f)); val.GetComponent<StolenProductSpawn>().NetworkproductID = __instance.productsIDCarrying[0]; val.GetComponent<StolenProductSpawn>().NetworkproductCarryingPrice = __instance.productsCarryingPrice[0] * 0.8f; NetworkServer.Spawn(val, (NetworkConnection)null); __instance.productsIDCarrying.RemoveAt(0); __instance.productsCarryingPrice.RemoveAt(0); } } if (__instance.isAThief && __instance.productsIDCarrying.Count == 0 && Object.op_Implicit((Object)(object)((Component)((Component)__instance).transform.Find("ThiefCanvas")).gameObject) && ((Component)((Component)__instance).transform.Find("ThiefCanvas")).gameObject.activeSelf) { __instance.RpcHideThief(); } int num = Random.Range(0, 9); __instance.RpcAnimationPlay(animationIndex); __instance.RPCNotificationAboveHead("NPCmessagehit" + num, ""); return false; } } [HarmonyPatch(typeof(NPC_Manager))] public class NPC_ManagerPatch { [HarmonyPatch("GetAvailableSelfCheckout")] [HarmonyPostfix] private static void GetAvailableSelfCheckoutPatch(NPC_Info npcInfo, NPC_Manager __instance) { SelfCheckoutPatch(npcInfo, __instance); } public static int SelfCheckoutPatch(NPC_Info npcInfo, NPC_Manager __instance) { if (npcInfo.productsIDCarrying.Count > 18 + __instance.selfcheckoutExtraProductsFromPerk || npcInfo.productsIDCarrying.Count == 0) { return -1; } float num = Mathf.Clamp((float)((18 + __instance.selfcheckoutExtraProductsFromPerk) / npcInfo.productsIDCarrying.Count), 0f, 1f); if (__instance.selfcheckoutChanceCurve.Evaluate(num) < Random.value) { for (int i = 0; i < __instance.selfCheckoutOBJ.transform.childCount; i++) { if (!((Component)__instance.selfCheckoutOBJ.transform.GetChild(i)).GetComponent<Data_Container>().checkoutQueue[0]) { if (!BetterSMT.SelfCheckoutTheft.Value && npcInfo.productsIDCarrying.Count > 6 && Random.value < 0.02f + (float)GameData.Instance.difficulty * 0.005f) { int index = Random.Range(0, npcInfo.productsIDCarrying.Count); npcInfo.productsIDCarrying.RemoveAt(index); npcInfo.productsCarryingPrice.RemoveAt(index); } return i; } } } return -1; } } [HarmonyPatch(typeof(OrderingDevice))] public static class OrderingDevicePatch { public static class ProductPriceUtility { public static float GetPricePerBox(int productID) { ProductListing instance = ProductListing.Instance; GameObject val = instance.productPrefabs[productID]; Data_Product component = val.GetComponent<Data_Product>(); float num = instance.tierInflation[component.productTier]; float basePricePerUnit = component.basePricePerUnit; int maxItemsPerBox = component.maxItemsPerBox; float num2 = basePricePerUnit * num * (float)maxItemsPerBox; return Mathf.Round(num2 * 100f) / 100f; } } [CompilerGenerated] private sealed class <CalculateShoppingListTotalOverrideOrdering>d__3 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public OrderingDevice __instance; private GameObject <managerListParentOBJ>5__1; private float <num>5__2; private string <text2>5__3; private IEnumerator <>s__4; private Transform <item>5__5; private string <text>5__6; private string <cleanedText>5__7; private float <price>5__8; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CalculateShoppingListTotalOverrideOrdering>d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <managerListParentOBJ>5__1 = null; <text2>5__3 = null; <>s__4 = null; <item>5__5 = null; <text>5__6 = null; <cleanedText>5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <managerListParentOBJ>5__1 = ((Component)GameData.Instance).GetComponent<ManagerBlackboard>().shoppingListParent; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: <>1__state = -1; ((TMP_Text)__instance.totalBoxesAmount).text = "x" + __instance.listParentOBJ.transform.childCount; <num>5__2 = 0f; if (<managerListParentOBJ>5__1.transform.childCount > 0) { <>s__4 = <managerListParentOBJ>5__1.transform.GetEnumerator(); try { while (<>s__4.MoveNext()) { <item>5__5 = (Transform)<>s__4.Current; <text>5__6 = ((TMP_Text)((Component)((Component)<item>5__5).transform.Find("BoxPrice")).GetComponent<TextMeshProUGUI>()).text; string text = <text>5__6; <cleanedText>5__7 = text.Substring(2, text.Length - 2).Trim().Replace(",", "."); if (float.TryParse(<cleanedText>5__7, NumberStyles.Float, CultureInfo.InvariantCulture, out <price>5__8)) { <num>5__2 += <price>5__8; } else { Debug.LogWarning((object)("BetterSMT: Failed to parse float from price string '" + <cleanedText>5__7 + "'")); } <text>5__6 = null; <cleanedText>5__7 = null; <item>5__5 = null; } } finally { if (<>s__4 is IDisposable disposable) { disposable.Dispose(); } } <>s__4 = null; } <text2>5__3 = ProductListing.Instance.ConvertFloatToTextPrice(<num>5__2); ((TMP_Text)__instance.totalPriceField).text = <text2>5__3; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HarmonyPostfix] [HarmonyPatch("OnEnable")] public static void OnOrderingDeviceEnabled(OrderingDevice __instance) { if (!BetterSMT.AutoOrdering.Value) { return; } GameData instance = GameData.Instance; ManagerBlackboard val = ((instance != null) ? ((Component)instance).GetComponent<ManagerBlackboard>() : null); ProductListing instance2 = ProductListing.Instance; GameObject val2 = NPC_Manager.Instance?.shelvesOBJ; if ((Object)(object)val == (Object)null || (Object)(object)instance2 == (Object)null || (Object)(object)val2 == (Object)null) { return; } int num = 0; for (int i = 0;