using GadgetCore.API; using GadgetCore.Util; using HarmonyLib; using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using System.Reflection.Emit; using UnityEngine; namespace IronmanChest.Patches { [HarmonyPatch(typeof(GameScript))] [HarmonyPatch(nameof(GameScript.EraseCharacter))] [HarmonyGadget("IronmanChest")] public static class Patch_GameScript_EraseCharacter { [HarmonyPrefix] [HarmonyPriority(Priority.Low)] public static void Prefix(GameScript __instance) { if (Menuu.curProfession == 1 && !Core.IsSoftcore()) { PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorageLevel", 0); for (int i = 0; i < Core.settingAmountPages * Core.settingAmountSlots; i++) { PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorage" + i + "id", 0); PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorage" + i + "q", 0); PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorage" + i + "exp", 0); PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorage" + i + "tier", 0); PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorage" + i + "corrupted", 0); PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorage" + i + "a0", 0); PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorage" + i + "a1", 0); PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorage" + i + "a2", 0); PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorage" + i + "aL0", 0); PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorage" + i + "aL1", 0); PreviewLabs.PlayerPrefs.SetInt(Menuu.curChar + "ironmanstorage" + i + "aL2", 0); } } } } }