ignore non-prey/pred NPCs

This commit is contained in:
GinYuH committed 2025-03-13 21:51:47 -07:00
1 parent a529dd65dd
commit 6ef9c84dc7
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -314,7 +314,7 @@ namespace CalamityMod.NPCs.SunkenSea
protected override bool NPCSearchFilter(NPC n)
{
return (base.NPCSearchFilter(n) || n == CurrentPredator && Vector2.DistanceSquared(NPC.Center, n.Center) < 1960f * 1960f) && (n.type != ModContent.NPCType<Polyperil>() && n.type != ModContent.NPCType<PolyperilTentacle>() && n.type != NPC.type);
return base.NPCSearchFilter(n) || n == CurrentPredator && Vector2.DistanceSquared(NPC.Center, n.Center) < 1960f * 1960f;
}
protected override bool PlayerSearchFilter(Player p)
+1 -1
View File
@@ -215,7 +215,7 @@ namespace CalamityMod.NPCs.SunkenSea
protected override bool NPCSearchFilter(NPC n)
{
return (base.NPCSearchFilter(n) || n == CurrentPrey && Vector2.DistanceSquared(NPC.Center, n.Center) < 460f * 460f) && (n.type != ModContent.NPCType<Polyperil>() && n.type != NPC.type);
return base.NPCSearchFilter(n) || n == CurrentPrey && Vector2.DistanceSquared(NPC.Center, n.Center) < 460f * 460f;
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
+1 -1
View File
@@ -147,7 +147,7 @@ namespace CalamityMod.NPCs.SunkenSea
/// </summary>
/// <param name="n">The NPC to evaluate.</param>
/// <returns><see langword="true"/> if the NPC is a valid target; otherwise, <see langword="false"/>.</returns>
protected virtual bool NPCSearchFilter(NPC n) => NPC.HasSight(n.Center) && Vector2.DistanceSquared(NPC.Center, n.Center) < 72900f;
protected virtual bool NPCSearchFilter(NPC n) => NPC.HasSight(n.Center) && Vector2.DistanceSquared(NPC.Center, n.Center) < 72900f && (PreyIDs.Contains(n.type) || PredatorIDs.Contains(n.type));
/// <summary>
/// Updates the current targets of this creature, including prey, predators, and players, based on detection logic.