Hive Cysts spawn enemies

This commit is contained in:
Altixal authored and Cameron Ewell committed 2022-12-22 22:14:11 -05:00
1 parent f733de47ab
commit a0239147d5
2 files changed
+46

No files matched your search

+39
View File
@@ -54,6 +54,45 @@ namespace CalamityMod.NPCs.HiveMind
NPC.frame.Y = frame * frameHeight;
}
public override void AI()
{
//TODO -- Zenith seed.
bool getFuckedAI = Main.getGoodWorld && Main.masterMode;
float timeToSpawn = 120f;
if (getFuckedAI && NPC.AnyNPCs(ModContent.NPCType<HiveMind>()))
{
//Passively spawns random enemies
NPC.ai[0]++;
if (NPC.ai[0] >= timeToSpawn)
{
int spawnRandomizer = Main.rand.Next(0, 5);
int type = NPCID.EaterofSouls;
switch (spawnRandomizer)
{
case 0:
case 1:
break;
case 2:
type = NPCID.DevourerHead;
break;
case 3:
type = ModContent.NPCType<DankCreeper>();
break;
case 4:
type = ModContent.NPCType<HiveBlob2>();
break;
default:
break;
}
NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, type);
NPC.ai[0] = 0f;
}
}
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
if (CalamityGlobalNPC.AnyEvents(spawnInfo.Player))
+7
View File
@@ -351,6 +351,13 @@ namespace CalamityMod.NPCs.HiveMind
if (choice < 5)
NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + Main.rand.Next(NPC.width), (int)NPC.position.Y + Main.rand.Next(NPC.height), type);
}
//TODO -- Zenith seed.
bool getFuckedAI = Main.getGoodWorld && Main.masterMode;
//Spawn a Hive Cyst
if (getFuckedAI && NPC.CountNPCS(ModContent.NPCType<HiveCyst>()) < 3)
NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + Main.rand.Next(NPC.width), (int)NPC.position.Y + Main.rand.Next(NPC.height), ModContent.NPCType<HiveCyst>());
}
private void ReelBack()