| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using GadgetCore.API;
- using GadgetCore.Util;
- using HarmonyLib;
- using System.Collections;
- using UnityEngine;
- namespace First.Patches
- {
- [HarmonyPatch(typeof(KylockeStand))]
- [HarmonyPatch("Awake")]
- [HarmonyGadget("First")]
- public static class Patch_KylockeStand_Awake
- {
- [HarmonyPostfix]
- public static void Prefix(KylockeStand __instance)
- {
- __instance.StartCoroutine(WaitAMoment(__instance));
- }
- private static IEnumerator WaitAMoment(KylockeStand instance)
- {
- if (instance.itemID == 2402)
- {
- instance.itemID = Core.itemWhiteLampId;
- }
- else if (instance.itemID == 2401)
- {
- switch (Random.Range(0, 6))
- {
- case 0:
- instance.itemID = Core.itemYellowLampId;
- break;
- case 1:
- instance.itemID = Core.itemOrangeLampId;
- break;
- case 2:
- instance.itemID = 2401;
- break;
- case 3:
- instance.itemID = Core.itemPurpleLampId;
- break;
- case 4:
- instance.itemID = 2402;
- break;
- case 5:
- instance.itemID = Core.itemGreenLampId;
- break;
- }
- }
- yield break;
- }
- }
- }
|