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