diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 8d4801a246..0dd197f08c 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3512,6 +3512,10 @@ namespace CalamityMod.NPCs if (npc.type == NPCID.BloodNautilus) return DreadnautilusAI.BuffedDreadnautilusAI(npc, Mod); + // More telegraphs + if (npc.type == NPCID.SpikedIceSlime || npc.type == NPCID.SpikedJungleSlime || npc.type == NPCID.SlimeSpiked) + return SlimeAI.BuffedSlimeAI(npc, Mod); + // Decrease the projectile velocities of several fighter enemies and make them better to fight in general if (npc.type == NPCID.IceGolem || npc.type == NPCID.Eyezor || npc.type == NPCID.VortexRifleman || npc.type == NPCID.TacticalSkeleton || npc.type == NPCID.Nailhead || npc.type == NPCID.WallCreeper || @@ -3924,8 +3928,6 @@ namespace CalamityMod.NPCs case NPCID.ToxicSludge: case NPCID.IceSlime: case NPCID.Crimslime: - case NPCID.SpikedIceSlime: - case NPCID.SpikedJungleSlime: case NPCID.UmbrellaSlime: case NPCID.RainbowSlime: case NPCID.SlimeMasked: @@ -3934,7 +3936,6 @@ namespace CalamityMod.NPCs case NPCID.SlimeRibbonYellow: case NPCID.SlimeRibbonGreen: case NPCID.SlimeRibbonRed: - case NPCID.SlimeSpiked: case NPCID.SandSlime: case NPCID.GoldenSlime: case NPCID.ShimmerSlime: diff --git a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs index aa471304a5..5ed1a1dcbc 100644 --- a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs +++ b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs @@ -6001,7 +6001,7 @@ PrepareToShoot: // Emit feather dust from center when about to shoot if (npc.ai[0] > HarpyFeatherGateValue - HarpyFeatherTelegraphTime) { - Dust dust = Dust.NewDustDirect(npc.Center + Main.rand.NextVector2CircularEdge(5f, 5f), 1, 1, 42, 0f, 0f, 0, default, 1.5f); + Dust dust = Dust.NewDustDirect(npc.Center + Main.rand.NextVector2CircularEdge(5f, 5f), 1, 1, 172, 0f, 0f, 0, default, 1.5f); dust.noGravity = true; dust.velocity *= 0f; } diff --git a/NPCs/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs b/NPCs/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs index eed910dcfe..216e8d2780 100644 --- a/NPCs/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs @@ -12,6 +12,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies { public static class SlimeAI { + public const float SpikedSlimeSpikeBarrageGateValue = 30f; + public const float SpikedSlimeSpikeGateValue = 50f; + public const float SpikedSlimeSpikeTelegraphTime = 30f; + public static void ChooseRandomItem(out int dropItem) { // Use a fallback of -1. @@ -101,7 +105,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies if (npc.type == NPCID.SpikedJungleSlime) { projectileShootType = ProjectileID.JungleSpike; - projectileShootSpeedFactor *= 0.6f; + projectileShootSpeedFactor *= 1.5f; } ref float jumpDelay = ref npc.ai[0]; @@ -180,7 +184,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies if (Main.netMode != NetmodeID.MultiplayerClient && projectileShootCountdown <= 0f) { var source = npc.GetSource_FromAI(); - if (distanceFromTarget < 120f) + if (Main.expertMode && distanceFromTarget < 120f) { for (int i = 0; i < 5; i++) { @@ -188,25 +192,60 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies spikeShootVelocity *= Main.rand.NextVector2Square(0.75f, 1.25f); spikeShootVelocity.Normalize(); spikeShootVelocity *= Main.rand.NextFloat(3.5f, 4.5f) * projectileShootSpeedFactor; - int proj = Projectile.NewProjectile(source, npc.Center, spikeShootVelocity, projectileShootType, 9, 0f, Main.myPlayer, 0f, 0f); + int proj = Projectile.NewProjectile(source, npc.Center, spikeShootVelocity, projectileShootType, 9, 0f, Main.myPlayer); if (CalamityWorld.death) Main.projectile[proj].extraUpdates += 1; - projectileShootCountdown = 30f; + + projectileShootCountdown = SpikedSlimeSpikeBarrageGateValue; } } else { - Vector2 velocity = npc.SafeDirectionTo(Main.player[npc.target].Center - Vector2.UnitY * Main.rand.NextFloat(200f)) * projectileShootSpeedFactor * (CalamityWorld.death ? 4f : 6f); - int proj = Projectile.NewProjectile(source, npc.Center, velocity, projectileShootType, 9, 0f, Main.myPlayer, 0f, 0f); + Vector2 velocity = npc.SafeDirectionTo(Main.player[npc.target].Center - Vector2.UnitY * 100f) * projectileShootSpeedFactor * (CalamityWorld.death ? 3.25f : CalamityWorld.revenge ? 5.5f : 4.5f); + int proj = Projectile.NewProjectile(source, npc.Center, velocity, projectileShootType, 9, 0f, Main.myPlayer); if (CalamityWorld.death) { Main.projectile[proj].extraUpdates += 1; Main.projectile[proj].timeLeft = 1200; } - projectileShootCountdown = 50f; + + projectileShootCountdown = SpikedSlimeSpikeGateValue; } } } + else + projectileShootCountdown = SpikedSlimeSpikeGateValue; + + if (npc.type == NPCID.SpikedIceSlime) + { + // Emit dust from center when about to shoot + if (projectileShootCountdown <= SpikedSlimeSpikeTelegraphTime) + { + Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 56, 0f, 0f, 0, default, 3f); + dust.noGravity = true; + dust.velocity *= 0f; + } + } + else if (npc.type == NPCID.SpikedJungleSlime) + { + // Emit dust from center when about to shoot + if (projectileShootCountdown <= SpikedSlimeSpikeTelegraphTime) + { + Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 61, 0f, 0f, 0, default, 3f); + dust.noGravity = true; + dust.velocity *= 0f; + } + } + else if (npc.type == NPCID.SlimeSpiked) + { + // Emit dust from center when about to shoot + if (projectileShootCountdown <= SpikedSlimeSpikeTelegraphTime) + { + Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 4, 0f, 0f, 0, new Color(78, 136, 255, 150), 3f); + dust.noGravity = true; + dust.velocity *= 0f; + } + } } // Decrement the target reset counter. @@ -360,6 +399,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies npc.velocity.X *= 1.2f; npc.velocity.Y *= 1.3f; } + npc.netUpdate = true; } @@ -367,7 +407,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies { // Move up if tiles are hit on the Y axis. if (npc.collideY) - npc.velocity.Y = -4f; + npc.velocity.Y = -(CalamityWorld.death ? 4f : CalamityWorld.revenge ? 3f : 2f); if (npc.velocity.Y < 0f && npc.ai[3] == npc.position.X) { @@ -378,8 +418,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies if (npc.velocity.Y > 0f) npc.ai[3] = npc.position.X; - float riseSpeed = 0.6f; - float maxRiseSpeed = 6f; + float riseSpeed = CalamityWorld.death ? 0.6f : CalamityWorld.revenge ? 0.55f : 0.5f; + float maxRiseSpeed = CalamityWorld.death ? 6f : CalamityWorld.revenge ? 5f : 4f; if (isLavaSlime) { riseSpeed += 0.2f;