Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of FurnitureConfig v1.0.1
BepInEx/plugins/FurnitureConfig/AddStorageLuck.dll
Decompiled 9 months agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using FurnitureConfig.Patches; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("AddStorageLuck")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("AddStorageLuck")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("96d93e07-bc2f-4998-ad82-2f8e0e4fa26a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace FurnitureConfig { [BepInPlugin("Ryoryoman_FurnitureConfig", "FurnitureConfig", "1.0.1")] public class FurnitureConfigBase : BaseUnityPlugin { private const string modGUID = "Ryoryoman_FurnitureConfig"; private const string modName = "FurnitureConfig"; private const string modVersion = "1.0.1"; private readonly Harmony harmony = new Harmony("Ryoryoman_FurnitureConfig"); private static FurnitureConfigBase Instanse; public static ManualLogSource mls; public ConfigEntry<string> switchKey; private void Awake() { if ((Object)(object)Instanse == (Object)null) { Instanse = this; } mls = Logger.CreateLogSource("Ryoryoman_FurnitureConfig"); mls.LogInfo((object)"FurnitureConfig1.0.1loaded."); harmony.PatchAll(typeof(FurnitureConfigBase)); harmony.PatchAll(typeof(AddStorageLuckPatch)); harmony.PatchAll(typeof(TerminalPatch)); } } } namespace FurnitureConfig.Patches { [HarmonyPatch(typeof(TimeOfDay))] internal class AddStorageLuckPatch { [HarmonyPatch("CalculateLuckValue")] [HarmonyPostfix] public static void CalculateLuckPatch(TimeOfDay __instance) { ScriptableObject obj = ScriptableObject.CreateInstance("UnlockablesList"); UnlockablesList val = (UnlockablesList)(object)((obj is UnlockablesList) ? obj : null); if (TerminalPatch.StorageLuckIsAdded) { __instance.luckValue = 0f; } if (__instance.furniturePlacedAtQuotaStart.Count <= 0) { for (int i = 0; i < __instance.furniturePlacedAtQuotaStart.Count; i++) { __instance.luckValue = Mathf.Clamp(__instance.luckValue + val.unlockables[__instance.furniturePlacedAtQuotaStart[i]].luckValue, -0.5f, 1f); } FurnitureConfigBase.mls.LogInfo((object)$"Luck calculated including storage luck: {__instance.luckValue}"); } } [HarmonyPatch("SetNewProfitQuota")] [HarmonyPostfix] public static void SetQuotaPatch(TimeOfDay __instance) { if (TerminalPatch.StorageLuckIsAdded) { __instance.furniturePlacedAtQuotaStart.Clear(); } for (int i = 0; i < StartOfRound.Instance.unlockablesList.unlockables.Count; i++) { if (StartOfRound.Instance.unlockablesList.unlockables[i].hasBeenUnlockedByPlayer) { __instance.furniturePlacedAtQuotaStart.Add(i); FurnitureConfigBase.mls.LogInfo((object)("unlockablesID" + i + "has added to furniturePlacedAtQuotaStart")); } } } } [HarmonyPatch(typeof(Terminal))] internal class TerminalPatch { public static bool StorageLuckIsAdded = true; [HarmonyPatch("ParsePlayerSentence")] [HarmonyPrefix] public static bool ParsePlayerSentencePatch(Terminal __instance) { string text = __instance.screenText.text.Substring(__instance.screenText.text.Length - __instance.textAdded); string text2 = "addluck"; if (text == text2) { StorageLuckIsAdded = !StorageLuckIsAdded; if (StorageLuckIsAdded) { __instance.currentText = "\n\n\nAddStorageLuck is ON! \n\nThe luck value of all furniture is calsulated,\n including those in storage."; } else { __instance.currentText = "\n\n\nAddStorageLuck is OFF! \n\nOnly the luck value of placed furniture \nis calculated."; } __instance.screenText.text = __instance.currentText; return false; } return true; } } } namespace AddStorageLuck.Patches { internal class CommandManager { } }