Browse Source

[MonsterNests] [2.0.2.1] More Nests

Zariteis 4 years ago
parent
commit
bde93ec41d

BIN
MonsterNests/Assets/ancientCrystal.png


BIN
MonsterNests/Assets/ancientCrystalCM.png


BIN
MonsterNests/Assets/plagueBall.png


BIN
MonsterNests/Assets/plagueNest.png


BIN
MonsterNests/Assets/spiderEggCM.png


BIN
MonsterNests/Assets/spiderEggCM2.png


BIN
MonsterNests/Assets/spikePlant.png


BIN
MonsterNests/Assets/spikePlantCM.png


+ 6 - 1
MonsterNests/Core.cs

@@ -10,10 +10,15 @@ namespace MonsterNests
 {
   internal static class Core
   {
-
     public static ObjectInfo objectBugspotBig;
     public static ObjectInfo objectSpiderEgg;
+    public static ObjectInfo objectSpiderEggCM;
     public static ObjectInfo objectGoldenShroom;
+    public static ObjectInfo objectSpikePlant;
+    public static ObjectInfo objectSpikePlantCM;
+    public static ObjectInfo objectAncientCrystal;
+    public static ObjectInfo objectAncientCrystalCM;
+
     public static GadgetLogger logger;
   }
 }

+ 14 - 4
MonsterNests/MonsterNests.cs

@@ -39,12 +39,22 @@ namespace MonsterNests
       Core.logger = Logger;
 
       Texture2D textureBugspotBig = GadgetCoreAPI.LoadTexture2D("bugspotBig.png");
+      Texture2D textureSpikePlant = GadgetCoreAPI.LoadTexture2D("spikePlant.png");
+      Texture2D textureSpikePlantCM = GadgetCoreAPI.LoadTexture2D("spikePlantCM.png");
       Texture2D textureSpiderEgg = GadgetCoreAPI.LoadTexture2D("spiderEgg.png");
+      Texture2D textureSpiderEggCM = GadgetCoreAPI.LoadTexture2D("spiderEggCM.png");
       Texture2D textureGoldenShroom = GadgetCoreAPI.LoadTexture2D("goldenShroom.png");
-
-      Core.objectBugspotBig = new ObjectInfo(ObjectType.BUGSPOT, new Item(31, 1, 0, 0, 0, new int[3], new int[3]), 22, textureBugspotBig).Register("bugspotBig");
-      Core.objectSpiderEgg = new ObjectInfo(ObjectType.ORE, new Item(3, 1, 0, 0, 0, new int[3], new int[3]), 22, textureSpiderEgg).Register("spiderEgg");
-      Core.objectGoldenShroom = new ObjectInfo(ObjectType.PLANT, new Item(12, 1, 0, 0, 0, new int[3], new int[3]), 22, textureGoldenShroom).Register("goldenShroom");
+      Texture2D textureAncientCrystal = GadgetCoreAPI.LoadTexture2D("ancientCrystal.png");
+      Texture2D textureAncientCrystalCM = GadgetCoreAPI.LoadTexture2D("ancientCrystalCM.png");
+
+      Core.objectBugspotBig = new ObjectInfo(ObjectType.BUGSPOT, new Item(31, 1, 0, 0, 0, new int[3], new int[3]), 16, textureBugspotBig).Register("bugspotBig");
+      Core.objectSpikePlant = new ObjectInfo(ObjectType.PLANT, new Item(11, 1, 0, 0, 0, new int[3], new int[3]), 16, textureSpikePlant).Register("spikePlant");
+      Core.objectSpikePlantCM = new ObjectInfo(ObjectType.PLANT, new Item(11, 1, 0, 0, 0, new int[3], new int[3]), 16, textureSpikePlantCM).Register("spikePlantCM");
+      Core.objectSpiderEgg = new ObjectInfo(ObjectType.ORE, new Item(3, 1, 0, 0, 0, new int[3], new int[3]), 8, textureSpiderEgg).Register("spiderEgg");
+      Core.objectSpiderEggCM = new ObjectInfo(ObjectType.ORE, new Item(3, 1, 0, 0, 0, new int[3], new int[3]), 16, textureSpiderEggCM).Register("spiderEggCM");
+      Core.objectGoldenShroom = new ObjectInfo(ObjectType.PLANT, new Item(12, 1, 0, 0, 0, new int[3], new int[3]), 16, textureGoldenShroom).Register("goldenShroom");
+      Core.objectAncientCrystal = new ObjectInfo(ObjectType.ORE, new Item(23, 1, 0, 0, 0, new int[3], new int[3]), 16, textureAncientCrystal).Register("ancientCrystal");
+      Core.objectAncientCrystalCM = new ObjectInfo(ObjectType.ORE, new Item(23, 1, 0, 0, 0, new int[3], new int[3]), 16, textureAncientCrystalCM).Register("ancientCrystalCM");
 
     }
   }

+ 24 - 0
MonsterNests/MonsterNests.csproj

@@ -95,6 +95,12 @@
     <Message Importance="High" Text="Mod Exported to $(GamePath)GadgetCore\Mods\$(AssemblyName)_v$(AssemblyFileVersion).zip" />
   </Target>
   <ItemGroup>
+    <None Update="Assets\ancientCrystal.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\ancientCrystalCM.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="Assets\bgScrapYard.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
@@ -227,6 +233,12 @@
     <None Update="Assets\one">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
+    <None Update="Assets\plagueBall.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\plagueNest.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="Assets\planetScrapYard.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
@@ -266,6 +278,18 @@
     <None Update="Assets\spiderEgg.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
+    <None Update="Assets\spiderEggCM.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\spiderEggCM2.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\spikePlant.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="Assets\spikePlantCM.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="Assets\stars.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>

+ 36 - 3
MonsterNests/Patches/Patch_Chunk_SpawnBiomeSlot.cs

@@ -32,18 +32,51 @@ namespace MonsterNests.Patches
           ___temp++;
           return false;
         }
-        if (a == 2)
+        else if (a == 1)
         {
-          ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectSpiderEgg.Object, transform.position, Quaternion.identity, 0);
+          if (GameScript.challengeLevel <= 0)
+          {
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectSpikePlant.Object, transform.position, Quaternion.identity, 0);
+          }
+          else
+          {
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectSpikePlantCM.Object, transform.position, Quaternion.identity, 0);
+          }
           ___temp++;
           return false;
         }
-        if (a == 3)
+        else if (a == 2)
+        {
+          if (GameScript.challengeLevel <= 0)
+          {
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectSpiderEgg.Object, transform.position, Quaternion.identity, 0);
+          }
+          else
+          {
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectSpiderEggCM.Object, transform.position, Quaternion.identity, 0);
+          }
+          ___temp++;
+          return false;
+        }
+        else if (a == 3)
         {
           ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectGoldenShroom.Object, transform.position, Quaternion.identity, 0);
           ___temp++;
           return false;
         }
+        else if (a == 4)
+        {
+          if (GameScript.challengeLevel <= 0)
+          {
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectAncientCrystal.Object, transform.position, Quaternion.identity, 0);
+          }
+          else
+          {
+            ___networkStuff[___temp] = (GameObject)Network.Instantiate(Core.objectAncientCrystalCM.Object, transform.position, Quaternion.identity, 0);
+          }
+          ___temp++;
+          return false;
+        }
       }
       return true;
     }

+ 37 - 29
MonsterNests/Patches/Patch_ObjectScript_Die.cs

@@ -20,63 +20,71 @@ namespace MonsterNests.Patches
       if (___id == Core.objectBugspotBig.GetID())
       {
         GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
         if (Network.isServer)
-        {
-          __instance.StartCoroutine(SpawnWasps(__instance.transform.position.x, __instance.transform.position.y));
-        }
+          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 10, 4, "e/wasp", 0.1f));
       }
-      else if (___id == Core.objectSpiderEgg.GetID())
+      else if (___id == Core.objectSpikePlant.GetID())
       {
         GameScript.cadetValue += 34;
         __instance.StartCoroutine(Shake());
         if (Network.isServer)
-        {
-          __instance.StartCoroutine(SpawnSpiders(__instance.transform.position.x, __instance.transform.position.y));
-        }
+          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 0, 12, "haz/vinegas", 0.1f));
+      }
+      else if (___id == Core.objectSpikePlantCM.GetID())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          __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())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          __instance.StartCoroutine(SpawnMultiple(__instance.transform.position.x, __instance.transform.position.y, 4, 10, "e/rockspider", 0.3f));
       }
       else if (___id == Core.objectGoldenShroom.GetID())
       {
         GameScript.cadetValue += 34;
         __instance.StartCoroutine(Shake());
         if (Network.isServer)
-        {
           Network.Instantiate(Resources.Load("e/bully"), 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())
+      {
+        GameScript.cadetValue += 34;
+        __instance.StartCoroutine(Shake());
+        if (Network.isServer)
+          Network.Instantiate(Resources.Load("e/golem"), new Vector3(__instance.transform.position.x, __instance.transform.position.y + 1.1f, 0f), Quaternion.identity, 0);
       }
     }
 
     private static IEnumerator Shake()
     {
       Camera.main.GetComponent<Animation>().Play("shake");
-      yield return new WaitForSeconds(3.5f);
+      yield return new WaitForSeconds(1.0f);
       Camera.main.GetComponent<Animation>().Stop();
       Camera.main.transform.eulerAngles = new Vector3(0f, 0f, 0f);
       yield break;
     }
 
-    private static IEnumerator SpawnSpiders(float xBase, float yBase)
+    private static IEnumerator SpawnMultiple(float xBase, float yBase, float range, int amount, string name, float speed)
     {
-      for (int i = 0; i < 10; i++)
+      for (int i = 0; i < amount; i++)
       {
-        int x = Random.Range(-40, 40);
-        int y = Random.Range(-40, 40);
-        Network.Instantiate(Resources.Load("e/rockspider"), new Vector3(xBase + x / 10f, yBase + 1.1f + y/10f, 0f), Quaternion.identity, 0);
-        yield return new WaitForSeconds(0.3f);
-      }
-      yield break;
-    }
-
-    private static IEnumerator SpawnWasps(float xBase, float yBase)
-    {
-      for (int i = 0; i < 10; i++)
-      {
-        int x = Random.Range(-15, 15);
-        int y = Random.Range(-15, 15);
-        Network.Instantiate(Resources.Load("e/wasp"), new Vector3(xBase + x / 10f, yBase + 1.1f + y / 10f, 0f), Quaternion.identity, 0);
-        yield return new WaitForSeconds(0.1f);
+        int x = 0;
+        int y = 0;
+        if (range > 0)
+        {
+          x = Random.Range(-1 * (int)(range * 10), (int)(range * 10));
+          y = Random.Range(-1 * (int)(range * 10), (int)(range * 10));
+        }
+        Network.Instantiate(Resources.Load(name), new Vector3(xBase + x / 10f, yBase + 1.1f + y / 10f, 0f), Quaternion.identity, 0);
+        yield return new WaitForSeconds(speed);
       }
       yield break;
     }
   }
-
 }