|
@@ -1,9 +1,6 @@
|
|
|
using GadgetCore.API;
|
|
using GadgetCore.API;
|
|
|
-using GadgetCore.Util;
|
|
|
|
|
using HarmonyLib;
|
|
using HarmonyLib;
|
|
|
using System.Collections;
|
|
using System.Collections;
|
|
|
-using System.Threading;
|
|
|
|
|
-using System.Windows.Threading;
|
|
|
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace MonsterNests.Patches
|
|
namespace MonsterNests.Patches
|
|
@@ -20,83 +17,105 @@ namespace MonsterNests.Patches
|
|
|
if (___id == Core.objectBugspotBig.GetID())
|
|
if (___id == Core.objectBugspotBig.GetID())
|
|
|
{
|
|
{
|
|
|
GameScript.cadetValue += 34;
|
|
GameScript.cadetValue += 34;
|
|
|
- __instance.StartCoroutine(Shake());
|
|
|
|
|
if (Network.isServer)
|
|
if (Network.isServer)
|
|
|
|
|
+ {
|
|
|
|
|
+ GadgetCoreAPI.CallCustomRPC(MonsterNests.RPCMonsterNestsShake, RPCMode.All, new object[] { 0 });
|
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 10, 6, "e/wasp", 0.1f));
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 10, 6, "e/wasp", 0.1f));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (___id == Core.objectBugTree.GetID())
|
|
if (___id == Core.objectBugTree.GetID())
|
|
|
{
|
|
{
|
|
|
GameScript.cadetValue += 34;
|
|
GameScript.cadetValue += 34;
|
|
|
- __instance.StartCoroutine(Shake());
|
|
|
|
|
if (Network.isServer)
|
|
if (Network.isServer)
|
|
|
|
|
+ {
|
|
|
|
|
+ GadgetCoreAPI.CallCustomRPC(MonsterNests.RPCMonsterNestsShake, RPCMode.All, new object[] { 0 });
|
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 10, 3, "e/wasp", 0.2f));
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 10, 3, "e/wasp", 0.2f));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if (___id == Core.objectSpikePlant.GetID())
|
|
else if (___id == Core.objectSpikePlant.GetID())
|
|
|
{
|
|
{
|
|
|
GameScript.cadetValue += 34;
|
|
GameScript.cadetValue += 34;
|
|
|
- __instance.StartCoroutine(Shake());
|
|
|
|
|
if (Network.isServer)
|
|
if (Network.isServer)
|
|
|
|
|
+ {
|
|
|
|
|
+ GadgetCoreAPI.CallCustomRPC(MonsterNests.RPCMonsterNestsShake, RPCMode.All, new object[] { 0 });
|
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 0, 12, "haz/vinegas", 0.1f));
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 0, 12, "haz/vinegas", 0.1f));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if (___id == Core.objectSpikePlantCM.GetID())
|
|
else if (___id == Core.objectSpikePlantCM.GetID())
|
|
|
{
|
|
{
|
|
|
GameScript.cadetValue += 34;
|
|
GameScript.cadetValue += 34;
|
|
|
- __instance.StartCoroutine(Shake());
|
|
|
|
|
if (Network.isServer)
|
|
if (Network.isServer)
|
|
|
|
|
+ {
|
|
|
|
|
+ GadgetCoreAPI.CallCustomRPC(MonsterNests.RPCMonsterNestsShake, RPCMode.All, new object[] { 0 });
|
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 0, 6, "e/sliver", 0.3f));
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 0, 6, "e/sliver", 0.3f));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if (___id == Core.objectSpiderEgg.GetID() || ___id == Core.objectSpiderEggCM.GetID())
|
|
else if (___id == Core.objectSpiderEgg.GetID() || ___id == Core.objectSpiderEggCM.GetID())
|
|
|
{
|
|
{
|
|
|
GameScript.cadetValue += 34;
|
|
GameScript.cadetValue += 34;
|
|
|
- __instance.StartCoroutine(Shake());
|
|
|
|
|
if (Network.isServer)
|
|
if (Network.isServer)
|
|
|
|
|
+ {
|
|
|
|
|
+ GadgetCoreAPI.CallCustomRPC(MonsterNests.RPCMonsterNestsShake, RPCMode.All, new object[] { 0 });
|
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 4, 10, "e/rockspider", 0.3f));
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 4, 10, "e/rockspider", 0.3f));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if (___id == Core.objectWizShroom.GetID() || ___id == Core.objectSpiderEggCM.GetID())
|
|
else if (___id == Core.objectWizShroom.GetID() || ___id == Core.objectSpiderEggCM.GetID())
|
|
|
{
|
|
{
|
|
|
GameScript.cadetValue += 34;
|
|
GameScript.cadetValue += 34;
|
|
|
- __instance.StartCoroutine(Shake());
|
|
|
|
|
if (Network.isServer)
|
|
if (Network.isServer)
|
|
|
- Network.Instantiate(Resources.Load("e/Shroomwizard"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 5f, 0f), Quaternion.identity, 0);
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ GadgetCoreAPI.CallCustomRPC(MonsterNests.RPCMonsterNestsShake, RPCMode.All, new object[] { 0 });
|
|
|
|
|
+ Network.Instantiate(Resources.Load("e/Shroomwizard"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 5f, 0f), Quaternion.identity, 0);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if (___id == Core.objectGoldenShroom.GetID())
|
|
else if (___id == Core.objectGoldenShroom.GetID())
|
|
|
{
|
|
{
|
|
|
GameScript.cadetValue += 34;
|
|
GameScript.cadetValue += 34;
|
|
|
- __instance.StartCoroutine(Shake());
|
|
|
|
|
if (Network.isServer)
|
|
if (Network.isServer)
|
|
|
|
|
+ {
|
|
|
|
|
+ GadgetCoreAPI.CallCustomRPC(MonsterNests.RPCMonsterNestsShake, RPCMode.All, new object[] { 0 });
|
|
|
Network.Instantiate(Resources.Load("e/MonsterNests/goldenShroom"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 1.1f, 0f), Quaternion.identity, 0);
|
|
Network.Instantiate(Resources.Load("e/MonsterNests/goldenShroom"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 1.1f, 0f), Quaternion.identity, 0);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if (___id == Core.objectAncientCrystal.GetID() || ___id == Core.objectAncientCrystalCM.GetID())
|
|
else if (___id == Core.objectAncientCrystal.GetID() || ___id == Core.objectAncientCrystalCM.GetID())
|
|
|
{
|
|
{
|
|
|
GameScript.cadetValue += 34;
|
|
GameScript.cadetValue += 34;
|
|
|
- __instance.StartCoroutine(Shake());
|
|
|
|
|
if (Network.isServer)
|
|
if (Network.isServer)
|
|
|
|
|
+ {
|
|
|
|
|
+ GadgetCoreAPI.CallCustomRPC(MonsterNests.RPCMonsterNestsShake, RPCMode.All, new object[] { 0 });
|
|
|
Network.Instantiate(Resources.Load("e/golem"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 1.1f, 0f), Quaternion.identity, 0);
|
|
Network.Instantiate(Resources.Load("e/golem"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 1.1f, 0f), Quaternion.identity, 0);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if (___id == Core.objectPlagueNest.GetID())
|
|
else if (___id == Core.objectPlagueNest.GetID())
|
|
|
{
|
|
{
|
|
|
GameScript.cadetValue += 34;
|
|
GameScript.cadetValue += 34;
|
|
|
- __instance.StartCoroutine(Shake());
|
|
|
|
|
- if (Network.isServer) ;
|
|
|
|
|
- //Network.Instantiate(Resources.Load("e/plaguebeast"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 1.1f, 0f), Quaternion.identity, 0);
|
|
|
|
|
|
|
+ if (Network.isServer)
|
|
|
|
|
+ {
|
|
|
|
|
+ GadgetCoreAPI.CallCustomRPC(MonsterNests.RPCMonsterNestsShake, RPCMode.All, new object[] { 0 });
|
|
|
|
|
+ //Network.Instantiate(Resources.Load("e/plaguebeast"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 1.1f, 0f), Quaternion.identity, 0);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if (___id == Core.objectFrozenWisp.GetID())
|
|
else if (___id == Core.objectFrozenWisp.GetID())
|
|
|
{
|
|
{
|
|
|
GameScript.cadetValue += 34;
|
|
GameScript.cadetValue += 34;
|
|
|
- __instance.StartCoroutine(Shake());
|
|
|
|
|
if (Network.isServer)
|
|
if (Network.isServer)
|
|
|
|
|
+ {
|
|
|
|
|
+ GadgetCoreAPI.CallCustomRPC(MonsterNests.RPCMonsterNestsShake, RPCMode.All, new object[] { 0 });
|
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 5, 6, "e/wisp", 0.35f));
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 5, 6, "e/wisp", 0.35f));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else if (___id == Core.objectMolten.GetID())
|
|
else if (___id == Core.objectMolten.GetID())
|
|
|
{
|
|
{
|
|
|
GameScript.cadetValue += 34;
|
|
GameScript.cadetValue += 34;
|
|
|
- __instance.StartCoroutine(Shake());
|
|
|
|
|
if (Network.isServer)
|
|
if (Network.isServer)
|
|
|
|
|
+ {
|
|
|
|
|
+ GadgetCoreAPI.CallCustomRPC(MonsterNests.RPCMonsterNestsShake, RPCMode.All, new object[] { 0 });
|
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 5, 6, "e/wyvern", 0.35f));
|
|
__instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 5, 6, "e/wyvern", 0.35f));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private static IEnumerator Shake()
|
|
|
|
|
|
|
+ public static IEnumerator Shake()
|
|
|
{
|
|
{
|
|
|
Camera.main.GetComponent<Animation>().Play("shake");
|
|
Camera.main.GetComponent<Animation>().Play("shake");
|
|
|
yield return new WaitForSeconds(1.0f);
|
|
yield return new WaitForSeconds(1.0f);
|