| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 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.Retry))]
- [HarmonyGadget("IronmanChest")]
- public static class Patch_GameScript_Retry
- {
- [HarmonyPostfix]
- [HarmonyPriority(Priority.Low)]
- public static void Postfix(GameScript __instance, Item[] ___storage, ref int ___storageLevel)
- {
- 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);
- }
- Patch_GameScript_LoadGame.Postfix(__instance, ___storage, ref ___storageLevel);
- }
- }
- }
- }
|