| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using GadgetCore.API;
- using GadgetCore.Util;
- using HarmonyLib;
- using System.Collections;
- using System.Threading;
- using System.Windows.Threading;
- using UnityEngine;
- namespace MonsterNests.Patches
- {
- [HarmonyPatch(typeof(Chunk))]
- [HarmonyPatch("SpawnBiomeSlot")]
- [HarmonyGadget("MonsterNests")]
- public static class Patch_Chunk_SpawnBiomeSlot
- {
- [HarmonyPostfix]
- public static bool Prefix(Chunk __instance, int a, int i, int mid, ref GameObject[] ___spawnSpot, ref GameObject[] ___spawnSpotMid, ref GameObject[] ___networkStuff, ref int ___temp)
- {
- Transform transform;
- if (mid == 1)
- transform = ___spawnSpotMid[i].transform;
- else
- transform = ___spawnSpot[i].transform;
- int num = UnityEngine.Random.Range(0, 100);
- if (num < 2)
- {
- if (a == 0)
- {
- ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectBugspotBig.Object, transform.position, Quaternion.identity, 0);
- ___temp++;
- return false;
- }
- if (a == 2)
- {
- ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectSpiderEgg.Object, transform.position, Quaternion.identity, 0);
- ___temp++;
- return false;
- }
- if (a == 3)
- {
- ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectGoldenShroom.Object, transform.position, Quaternion.identity, 0);
- ___temp++;
- return false;
- }
- }
- return true;
- }
- }
- }
|