diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewel.cs index a6edbdf1f8..086a89025d 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel.cs @@ -152,8 +152,8 @@ namespace CalamityMod.NPCs.NormalNPCs int damage = NPC.GetProjectileDamage(type); if (CalamityWorld.death || BossRushEvent.BossRushActive) { - int numProj = 5; - float rotation = MathHelper.ToRadians(12); + int numProj = Main.masterMode ? 5 : 4; + float rotation = MathHelper.ToRadians(18); for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projVector.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); diff --git a/NPCs/NormalNPCs/KingSlimeJewel2.cs b/NPCs/NormalNPCs/KingSlimeJewel2.cs index d18df61e1d..b2acf064b6 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel2.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel2.cs @@ -71,7 +71,20 @@ namespace CalamityMod.NPCs.NormalNPCs float velocity = 5f; float acceleration = 0.1f; - if (NPC.position.Y > Main.player[NPC.target].position.Y - 300f) + int distanceFromKingSlime = 1; + Vector2 kingSlimeCenter = NPC.Center; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].active && Main.npc[i].type == NPCID.KingSlime) + { + distanceFromKingSlime = (int)NPC.Distance(Main.npc[i].Center); + kingSlimeCenter = Main.npc[i].Center; + break; + } + } + + Vector2 movementTarget = kingSlimeCenter == NPC.Center ? Main.player[NPC.target].Center : kingSlimeCenter; + if (NPC.position.Y > movementTarget.Y - 200f) { if (NPC.velocity.Y > 0f) NPC.velocity.Y *= 0.98f; @@ -81,7 +94,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.velocity.Y > velocity) NPC.velocity.Y = velocity; } - else if (NPC.position.Y < Main.player[NPC.target].position.Y - 400f) + else if (NPC.position.Y < movementTarget.Y - 250f) { if (NPC.velocity.Y < 0f) NPC.velocity.Y *= 0.98f; @@ -92,7 +105,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.velocity.Y = -velocity; } - if (NPC.Center.X > Main.player[NPC.target].Center.X + 300f) + if (NPC.Center.X > movementTarget.X + 100f) { if (NPC.velocity.X > 0f) NPC.velocity.X *= 0.98f; @@ -102,7 +115,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.velocity.X > 8f) NPC.velocity.X = 8f; } - if (NPC.Center.X < Main.player[NPC.target].Center.X - 300f) + if (NPC.Center.X < movementTarget.X - 100f) { if (NPC.velocity.X < 0f) NPC.velocity.X *= 0.98f; @@ -121,18 +134,6 @@ namespace CalamityMod.NPCs.NormalNPCs SoundEngine.PlaySound(SoundID.Item8, NPC.Center); - int distanceFromKingSlime = 1; - Vector2 kingSlimeCenter = NPC.Center; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == NPCID.KingSlime) - { - distanceFromKingSlime = (int)NPC.Distance(Main.npc[i].Center); - kingSlimeCenter = Main.npc[i].Center; - break; - } - } - for (int dusty = 0; dusty < 10; dusty++) { Vector2 dustVel = (kingSlimeCenter - NPC.Center).SafeNormalize(Vector2.UnitY) * Main.rand.NextFloat(2f, 4f); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index d2f68c28c4..3b8db5b32a 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -276,6 +276,38 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (masterMode) teleportRate *= 2f; + if (npc.ai[0] == 0f) + { + // Move Blue Crystal + if (blueCrystalAlive) + { + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC blueCrystal = Main.npc[i]; + if (blueCrystal.active && blueCrystal.type == ModContent.NPCType()) + { + blueCrystal.position.X = npc.position.X; + blueCrystal.position.Y = npc.position.Y - 200f; + + for (int dusty = 0; dusty < 10; dusty++) + { + Vector2 dustVel = Main.rand.NextVector2CircularEdge(5f, 5f); + int sapphire = Dust.NewDust(blueCrystal.Center, blueCrystal.width, blueCrystal.height, DustID.GemSapphire, 0f, 0f, 100, default, 2f); + Main.dust[sapphire].velocity = dustVel * Main.rand.NextFloat(1f, 2f); + Main.dust[sapphire].noGravity = true; + if (Main.rand.NextBool()) + { + Main.dust[sapphire].scale = 0.5f; + Main.dust[sapphire].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + + break; + } + } + } + } + npc.ai[0] += teleportRate; teleportScale = MathHelper.Clamp(npc.ai[0] / 30f, 0f, 1f); teleportScale = 0.5f + teleportScale * 0.5f;