Fixed King Slime target bugs by returning the targeting to what it used to be.

This commit is contained in:
mountaindrew10 authored and Ozzatron committed 2024-06-01 20:23:51 -04:00
1 parent 5db80ab5b6
commit dd2da4035e
1 file changed
+5
@@ -414,6 +414,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.damage = setDamage;
npc.netUpdate = true;
npc.TargetClosest();
float distanceBelowTarget = npc.position.Y - (Main.player[npc.target].position.Y + 80f);
float speedMult = 1f;
@@ -686,6 +687,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.ai[1] = 5f;
if (Main.netMode != NetmodeID.MultiplayerClient)
{
npc.TargetClosest(false);
Point point3 = npc.Center.ToTileCoordinates();
Point point4 = Main.player[npc.target].Center.ToTileCoordinates();
Vector2 vector30 = Main.player[npc.target].Center - npc.Center;
@@ -872,6 +874,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.damage = npc.defDamage;
npc.netUpdate = true;
npc.TargetClosest();
if (npc.ai[1] == 3f)
{
npc.velocity.Y = -13f;
@@ -971,6 +975,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
public static void GetPlaceToTeleportTo(NPC npc)
{
npc.TargetClosest(false);
float distanceAhead = 800f;
Vector2 randomDefault = Main.rand.NextBool() ? Vector2.UnitX : -Vector2.UnitX;
Vector2 vectorAimedAheadOfTarget = Main.player[npc.target].Center + new Vector2((float)Math.Round(Main.player[npc.target].velocity.X), 0f).SafeNormalize(randomDefault) * distanceAhead;