From 46c48453cd320ddc4c7c416893d7a3f63ce71bd1 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Wed, 11 Jun 2025 15:21:59 -0500 Subject: [PATCH 1/9] Gave ravager solid rock pillars --- CalPlayer/CalamityPlayer.cs | 106 ++++++++++++++++++++++++++++++++++++ NPCs/Ravager/RockPillar.cs | 7 +++ 2 files changed, 113 insertions(+) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1f7e29d431..71b4cafbf3 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -70,6 +70,7 @@ using Terraria.ModLoader; using Terraria.ModLoader.IO; using Terraria.Graphics.Effects; using static Terraria.ModLoader.ModContent; +using CalamityMod.NPCs.Ravager; namespace CalamityMod.CalPlayer { @@ -4313,6 +4314,111 @@ namespace CalamityMod.CalPlayer if (CalamityKeybinds.ExoChairSlowdownHotkey.Current) Player.velocity *= 0.5f; } + + foreach (var npc in Main.ActiveNPCs) + { + //This is the ravager rock pillar collision logic. It should only apply to rock pillars that are mostly opaque to ensure players don't get stopped by invisible pillars right when they spawn. + //This could also potentially be limited to only run with the pillar is stationary if desired. + if (npc.type == ModContent.NPCType() && npc.Opacity > 0.9f) + { + float origX = Player.velocity.X; + float origY = Player.velocity.Y; + //Yes, testing intercepts on th X, Y, and X+Y individually has a purpose. It makes it far more stable and consistent. + bool intersectX = false; + Player.position.X += Player.velocity.X; + if (Player.Hitbox.Intersects(npc.Hitbox)) + intersectX = true; + Player.position.X -= Player.velocity.X; + bool intersectY = false; + Player.position.Y += Player.velocity.Y; + if (Player.Hitbox.Intersects(npc.Hitbox)) + intersectY = true; + Player.position.Y -= Player.velocity.Y; + bool intersect = false; + //We only bother checking the X+Y together if individually they return false. + //This accounts for moving diagonal onto a corner. + if (!intersectX && !intersectY) + { + Player.position += Player.velocity; + if (Player.Hitbox.Intersects(npc.Hitbox)) + intersect = true; + Player.position -= Player.velocity; + } + if (intersectX || intersect) + { + //This checks if the player is to the left of the pillar + if (Player.Center.X < npc.Center.X) + { + float playerEdge = Player.Hitbox.X + Player.Hitbox.Width; + float pillarEdge = npc.Hitbox.X; + float goalEdge = playerEdge + Player.velocity.X; + if (goalEdge > pillarEdge) + { + Player.velocity.X += pillarEdge - goalEdge; + if (Player.velocity.X < 0) + if (!Collision.SolidCollision(Player.position + new Vector2(Player.velocity.X, 0), Player.Hitbox.Width, Player.Hitbox.Height)) + { + Player.position.X += Player.velocity.X; + Player.velocity.X = 0; + } + else + { + Player.velocity.X = origX; + } + } + } + //This is for if the player is to the right of the pillar + else + { + float playerEdge = Player.Hitbox.X; + float pillarEdge = npc.Hitbox.X + npc.Hitbox.Width; + float goalEdge = playerEdge + Player.velocity.X; + if (goalEdge < pillarEdge) + { + Player.velocity.X += pillarEdge - goalEdge; + if (Player.velocity.X > 0) + if (!Collision.SolidCollision(Player.position + new Vector2(Player.velocity.X, 0), Player.Hitbox.Width, Player.Hitbox.Height)) + { + Player.position.X += Player.velocity.X; + Player.velocity.X = 0; + } + else + { + Player.velocity.X = origX; + } + } + } + } + //For the vertical axis, we don't distinguish between top and bottom, and always move players to the top + //This is so being placed inside a pillar teleports a player to the top, which applies primarily to teleporting or pillar spawning + //Additionally, this is set to only work when the pillar is stationary vertically to prevent janky interations when pillars are moving. + if ((intersectY || intersect) && npc.velocity.Y == 0) + { + float playerEdge = Player.Hitbox.Y + Player.Hitbox.Height; + float pillarEdge = npc.Hitbox.Y; + float goalEdge = playerEdge + Player.velocity.Y; + if (goalEdge > pillarEdge) + { + Player.velocity.Y += pillarEdge - goalEdge; + if (Player.velocity.Y < 0) + if (!Collision.SolidCollision(Player.position + new Vector2(0, Player.velocity.Y), Player.Hitbox.Width, Player.Hitbox.Height)) + { + Player.position.Y += Player.velocity.Y; + Player.velocity.Y = 0; + } + else + { + Player.velocity.Y = origY; + } + } + } + //This is to guarantee we can stand on top of rock pillars instead of looking like we're "floating" on top of them. + if (intersectY && Player.velocity.Y < 0.25f && Player.velocity.Y > -0.25f) + { + Player.velocity.Y = 0; + } + } + } } #endregion diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 08344e4ead..d125b49c8b 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -42,6 +42,13 @@ namespace CalamityMod.NPCs.Ravager CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } + //Disable dmg when stationary vertically or before jumping + public override bool CanHitPlayer(Player target, ref int cooldownSlot) + { + if (NPC.velocity.Y == 0 || NPC.ai[0] == 0f) + return false; + return base.CanHitPlayer(target, ref cooldownSlot); + } public override void AI() { if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active) From 92095bd09ea6e3a92e3eb78a39d837404919195e Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Thu, 12 Jun 2025 18:52:28 -0500 Subject: [PATCH 2/9] fixed pillar warp --- CalPlayer/CalamityPlayer.cs | 52 ++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 71b4cafbf3..0f2ab30885 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4394,22 +4394,44 @@ namespace CalamityMod.CalPlayer //Additionally, this is set to only work when the pillar is stationary vertically to prevent janky interations when pillars are moving. if ((intersectY || intersect) && npc.velocity.Y == 0) { - float playerEdge = Player.Hitbox.Y + Player.Hitbox.Height; - float pillarEdge = npc.Hitbox.Y; - float goalEdge = playerEdge + Player.velocity.Y; - if (goalEdge > pillarEdge) + if (Player.Center.X < npc.Center.X) { - Player.velocity.Y += pillarEdge - goalEdge; - if (Player.velocity.Y < 0) - if (!Collision.SolidCollision(Player.position + new Vector2(0, Player.velocity.Y), Player.Hitbox.Width, Player.Hitbox.Height)) - { - Player.position.Y += Player.velocity.Y; - Player.velocity.Y = 0; - } - else - { - Player.velocity.Y = origY; - } + float playerEdge = Player.Hitbox.Y + Player.Hitbox.Height; + float pillarEdge = npc.Hitbox.Y; + float goalEdge = playerEdge + Player.velocity.Y; + if (goalEdge > pillarEdge) + { + Player.velocity.Y += pillarEdge - goalEdge; + if (Player.velocity.Y < 0) + if (!Collision.SolidCollision(Player.position + new Vector2(0, Player.velocity.Y), Player.Hitbox.Width, Player.Hitbox.Height)) + { + Player.position.Y += Player.velocity.Y; + Player.velocity.Y = 0; + } + else + { + Player.velocity.Y = origY; + } + } + } else + { + float playerEdge = Player.Hitbox.Y; + float pillarEdge = npc.Hitbox.Y + npc.Hitbox.Height; + float goalEdge = playerEdge + Player.velocity.Y; + if (goalEdge < pillarEdge) + { + Player.velocity.Y += pillarEdge - goalEdge; + if (Player.velocity.Y > 0) + if (!Collision.SolidCollision(Player.position + new Vector2(0, Player.velocity.Y), Player.Hitbox.Width, Player.Hitbox.Height)) + { + Player.position.Y += Player.velocity.Y; + Player.velocity.Y = 0; + } + else + { + Player.velocity.Y = origY; + } + } } } //This is to guarantee we can stand on top of rock pillars instead of looking like we're "floating" on top of them. From cc90206b0c1f6ad617ababa4ec299feca73af4a3 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Thu, 12 Jun 2025 19:57:55 -0500 Subject: [PATCH 3/9] no more ravager elevator --- CalPlayer/CalamityPlayer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 0f2ab30885..13d9a47315 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4394,7 +4394,7 @@ namespace CalamityMod.CalPlayer //Additionally, this is set to only work when the pillar is stationary vertically to prevent janky interations when pillars are moving. if ((intersectY || intersect) && npc.velocity.Y == 0) { - if (Player.Center.X < npc.Center.X) + if (Player.Center.Y < npc.Center.Y) { float playerEdge = Player.Hitbox.Y + Player.Hitbox.Height; float pillarEdge = npc.Hitbox.Y; From 9a1f2c5ffe7f95bf630cbd35701b4574e315f148 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Sat, 14 Jun 2025 14:38:49 -0500 Subject: [PATCH 4/9] pick pillars! more pillars! --- NPCs/Ravager/FlamePillar.cs | 19 +++++++++++++++++++ NPCs/Ravager/RavagerBody.cs | 5 +++-- NPCs/Ravager/RockPillar.cs | 23 +++++++++++++++++++++-- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 78144eff7a..b84db284b3 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -214,5 +214,24 @@ namespace CalamityMod.NPCs.Ravager } } } + + public override void ModifyHitByItem(Player player, Item item, ref NPC.HitModifiers modifiers) + { + if (item.pick > 0) + { + modifiers.ScalingBonusDamage += item.pick / 5f; + } + base.ModifyHitByItem(player, item, ref modifiers); + } + + public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers) + { + var item = Main.player[projectile.owner].HeldItem; + if (item.pick > 0 && projectile.CountsAsClass()) + { + modifiers.ScalingBonusDamage += item.pick / 5f; + } + base.ModifyHitByProjectile(projectile, ref modifiers); + } } } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 9076571ce5..8920929cc7 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Linq; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.Items.Accessories; @@ -591,7 +592,7 @@ namespace CalamityMod.NPCs.Ravager if (Main.netMode != NetmodeID.MultiplayerClient) { - bool anyRockPillars = NPC.AnyNPCs(ModContent.NPCType()); + bool anyRockPillars = Main.npc.Any(x => x.active && x.type == ModContent.NPCType() && x.ai[1] < 1); bool anyFlamePillars = NPC.AnyNPCs(ModContent.NPCType()); if (CalamityWorld.LegendaryMode) @@ -624,7 +625,7 @@ namespace CalamityMod.NPCs.Ravager { if (n.type == ModContent.NPCType() && n.ai[0] == 0f) { - n.ai[1] = -1f; + n.ai[1]++; n.direction = NPC.direction; n.netUpdate = true; } diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index d125b49c8b..7dda44310c 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -79,11 +79,11 @@ namespace CalamityMod.NPCs.Ravager NPC.damage = NPC.defDamage; } - if (NPC.ai[0] == 0f) + if (NPC.ai[0] == 0) { if (NPC.velocity.Y == 0f) { - if (NPC.ai[1] == -1f) + if (NPC.ai[1] >= 2) { SoundEngine.PlaySound(SoundID.Item62, NPC.Center); @@ -218,5 +218,24 @@ namespace CalamityMod.NPCs.Ravager } } } + + public override void ModifyHitByItem(Player player, Item item, ref NPC.HitModifiers modifiers) + { + if (item.pick > 0) + { + modifiers.ScalingBonusDamage += item.pick / 5f; + } + base.ModifyHitByItem(player, item, ref modifiers); + } + + public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers) + { + var item = Main.player[projectile.owner].HeldItem; + if (item.pick > 0 && projectile.CountsAsClass()) + { + modifiers.ScalingBonusDamage += item.pick / 5f; + } + base.ModifyHitByProjectile(projectile, ref modifiers); + } } } From f3eca37fb9e7d3e758035ecfeddf18abb3e7acd1 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Sat, 14 Jun 2025 15:35:30 -0500 Subject: [PATCH 5/9] pillars now have 2000% pick power worth of HP --- NPCs/Ravager/FlamePillar.cs | 6 ++++-- NPCs/Ravager/RockPillar.cs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index b84db284b3..f02a4b6769 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -219,7 +219,8 @@ namespace CalamityMod.NPCs.Ravager { if (item.pick > 0) { - modifiers.ScalingBonusDamage += item.pick / 5f; + modifiers.FlatBonusDamage += -10000; + modifiers.FinalDamage.Flat += (NPC.lifeMax / 2000f) * item.pick; } base.ModifyHitByItem(player, item, ref modifiers); } @@ -229,7 +230,8 @@ namespace CalamityMod.NPCs.Ravager var item = Main.player[projectile.owner].HeldItem; if (item.pick > 0 && projectile.CountsAsClass()) { - modifiers.ScalingBonusDamage += item.pick / 5f; + modifiers.FlatBonusDamage += -10000; + modifiers.FinalDamage.Flat += (NPC.lifeMax / 2000f) * item.pick; } base.ModifyHitByProjectile(projectile, ref modifiers); } diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 7dda44310c..d983350dde 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -223,7 +223,8 @@ namespace CalamityMod.NPCs.Ravager { if (item.pick > 0) { - modifiers.ScalingBonusDamage += item.pick / 5f; + modifiers.FlatBonusDamage += -10000; + modifiers.FinalDamage.Flat += (NPC.lifeMax / 2000f) * item.pick; } base.ModifyHitByItem(player, item, ref modifiers); } @@ -233,7 +234,8 @@ namespace CalamityMod.NPCs.Ravager var item = Main.player[projectile.owner].HeldItem; if (item.pick > 0 && projectile.CountsAsClass()) { - modifiers.ScalingBonusDamage += item.pick / 5f; + modifiers.FlatBonusDamage += -10000; + modifiers.FinalDamage.Flat += (NPC.lifeMax / 2000f) * item.pick; } base.ModifyHitByProjectile(projectile, ref modifiers); } From 6e33c4aca72096be319dc30e1f8330f8c035065f Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Wed, 25 Jun 2025 14:52:24 -0500 Subject: [PATCH 6/9] Pickaxe pillar cleanup, more rock pillars --- NPCs/Ravager/FlamePillar.cs | 25 ++++++++++++++++++++++--- NPCs/Ravager/RavagerBody.cs | 9 ++------- NPCs/Ravager/RockPillar.cs | 30 +++++++++++++++++++++++++----- 3 files changed, 49 insertions(+), 15 deletions(-) diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 2d7125d06c..abbb9ed7db 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -20,6 +20,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetStaticDefaults() { this.HideFromBestiary(); + NPCID.Sets.ImmuneToAllBuffs[Type] = true; Main.npcFrameCount[Type] = 4; if (!Main.dedServ) { @@ -35,7 +36,7 @@ namespace CalamityMod.NPCs.Ravager NPC.defense = 35; NPC.DR_NERD(0.2f); NPC.chaseable = false; - NPC.lifeMax = DownedBossSystem.downedProvidence ? 14000 : 3500; + NPC.lifeMax = 1250; NPC.alpha = 255; NPC.aiStyle = -1; AIType = -1; @@ -60,6 +61,10 @@ namespace CalamityMod.NPCs.Ravager public override void AI() { + if (NPC.lifeMax > 1250) + NPC.lifeMax = 1250; + if (NPC.life > NPC.lifeMax) + NPC.life = NPC.lifeMax; // Avoid cheap bullshit NPC.damage = 0; @@ -221,7 +226,14 @@ namespace CalamityMod.NPCs.Ravager if (item.pick > 0) { modifiers.FlatBonusDamage += -10000; - modifiers.FinalDamage.Flat += (NPC.lifeMax / 2000f) * item.pick; + modifiers.FinalDamage.Flat += item.pick - 1; + modifiers.SetCrit(); + } + else + { + modifiers.SetMaxDamage(1); + modifiers.DisableCrit(); + modifiers.HideCombatText(); } base.ModifyHitByItem(player, item, ref modifiers); } @@ -232,7 +244,14 @@ namespace CalamityMod.NPCs.Ravager if (item.pick > 0 && projectile.CountsAsClass()) { modifiers.FlatBonusDamage += -10000; - modifiers.FinalDamage.Flat += (NPC.lifeMax / 2000f) * item.pick; + modifiers.FinalDamage.Flat += item.pick-1; + modifiers.SetCrit(); + } + else + { + modifiers.SetMaxDamage(1); + modifiers.DisableCrit(); + modifiers.HideCombatText(); } base.ModifyHitByProjectile(projectile, ref modifiers); } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index a34a175a5a..38aee040ba 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -592,7 +592,7 @@ namespace CalamityMod.NPCs.Ravager if (Main.netMode != NetmodeID.MultiplayerClient) { - bool anyRockPillars = Main.npc.Any(x => x.active && x.type == ModContent.NPCType() && x.ai[1] < 1); + bool anyRockPillars = Main.npc.Any(x => x.active && x.type == ModContent.NPCType() && x.ai[1] < 2); bool anyFlamePillars = NPC.AnyNPCs(ModContent.NPCType()); if (CalamityWorld.LegendaryMode) @@ -632,17 +632,12 @@ namespace CalamityMod.NPCs.Ravager } int spawnDistance = 360; - - if (!anyRockPillars || !anyFlamePillars) { SoundEngine.PlaySound(PillarSound, NPC.Center); - } - if (!anyRockPillars || CalamityWorld.LegendaryMode) - { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X - spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X + spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); } - else if (!anyFlamePillars || CalamityWorld.LegendaryMode) + if (!anyFlamePillars) { float distanceMultiplier = finalPhase ? 2.5f : 2f; NPC.NewNPC(NPC.GetSource_FromAI(), (int)player.Center.X - (int)(spawnDistance * distanceMultiplier), (int)player.Center.Y - 100, ModContent.NPCType()); diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 2c52fdb9d8..d3288a5610 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -16,6 +16,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetStaticDefaults() { this.HideFromBestiary(); + NPCID.Sets.ImmuneToAllBuffs[Type] = true; } public override void SetDefaults() @@ -27,7 +28,6 @@ namespace CalamityMod.NPCs.Ravager NPC.defense = 50; NPC.DR_NERD(0.3f); NPC.chaseable = false; - NPC.lifeMax = DownedBossSystem.downedProvidence ? 20000 : 5000; NPC.alpha = 255; NPC.aiStyle = -1; AIType = -1; @@ -36,10 +36,12 @@ namespace CalamityMod.NPCs.Ravager NPC.DeathSound = SoundID.NPCDeath14; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; + NPCID.Sets.ImmuneToAllBuffs[Type] = true; // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); + NPC.lifeMax = 1800; } //Disable dmg when stationary vertically or before jumping @@ -51,6 +53,10 @@ namespace CalamityMod.NPCs.Ravager } public override void AI() { + if (NPC.lifeMax > 1800) + NPC.lifeMax = 1800; + if (NPC.life > NPC.lifeMax) + NPC.life = NPC.lifeMax; if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active) { if (Main.netMode != NetmodeID.MultiplayerClient) @@ -110,7 +116,7 @@ namespace CalamityMod.NPCs.Ravager NPC.velocity.X = (BossRushEvent.BossRushActive ? 15 : 12) * NPC.direction; NPC.velocity.Y = -28.5f; NPC.ai[0] = 1f; - NPC.ai[1] = 0f; + NPC.ai[1] = 0; } } } @@ -135,7 +141,7 @@ namespace CalamityMod.NPCs.Ravager } } } - public override bool? CanFallThroughPlatforms() => NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height; + public override bool? CanFallThroughPlatforms() => (NPC.alpha > 10) || (NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height); public override bool CheckActive() => false; public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) @@ -224,7 +230,14 @@ namespace CalamityMod.NPCs.Ravager if (item.pick > 0) { modifiers.FlatBonusDamage += -10000; - modifiers.FinalDamage.Flat += (NPC.lifeMax / 2000f) * item.pick; + modifiers.FinalDamage.Flat += item.pick - 1; + modifiers.SetCrit(); + } + else + { + modifiers.SetMaxDamage(1); + modifiers.DisableCrit(); + modifiers.HideCombatText(); } base.ModifyHitByItem(player, item, ref modifiers); } @@ -235,7 +248,14 @@ namespace CalamityMod.NPCs.Ravager if (item.pick > 0 && projectile.CountsAsClass()) { modifiers.FlatBonusDamage += -10000; - modifiers.FinalDamage.Flat += (NPC.lifeMax / 2000f) * item.pick; + modifiers.FinalDamage.Flat += item.pick - 1; + modifiers.SetCrit(); + } + else + { + modifiers.SetMaxDamage(1); + modifiers.DisableCrit(); + modifiers.HideCombatText(); } base.ModifyHitByProjectile(projectile, ref modifiers); } From c1a4b03f11451af4dc0b39778585ea364984a808 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Wed, 25 Jun 2025 16:09:43 -0500 Subject: [PATCH 7/9] Rock pillars anti jank, death changes --- CalPlayer/CalamityPlayer.cs | 231 ++++++++++++++++++++---------------- NPCs/Ravager/RavagerBody.cs | 33 ++++-- NPCs/Ravager/RockPillar.cs | 12 +- 3 files changed, 159 insertions(+), 117 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 03f19ef7d3..6990d1de98 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4315,126 +4315,151 @@ namespace CalamityMod.CalPlayer { //This is the ravager rock pillar collision logic. It should only apply to rock pillars that are mostly opaque to ensure players don't get stopped by invisible pillars right when they spawn. //This could also potentially be limited to only run with the pillar is stationary if desired. - if (npc.type == ModContent.NPCType() && npc.Opacity > 0.9f) + if (npc.type == ModContent.NPCType() && npc.Opacity > 0.9f && npc.damage < 1) { + bool LandedOnPlayer = false; float origX = Player.velocity.X; float origY = Player.velocity.Y; - //Yes, testing intercepts on th X, Y, and X+Y individually has a purpose. It makes it far more stable and consistent. - bool intersectX = false; - Player.position.X += Player.velocity.X; + npc.position += npc.velocity; + bool intersectPreVel = false; + Player.position += Player.velocity; + if (Player.Hitbox.Intersects(npc.Hitbox)) - intersectX = true; - Player.position.X -= Player.velocity.X; - bool intersectY = false; - Player.position.Y += Player.velocity.Y; - if (Player.Hitbox.Intersects(npc.Hitbox)) - intersectY = true; - Player.position.Y -= Player.velocity.Y; - bool intersect = false; - //We only bother checking the X+Y together if individually they return false. - //This accounts for moving diagonal onto a corner. - if (!intersectX && !intersectY) + intersectPreVel = true; + Player.position -= Player.velocity; + if (intersectPreVel) { - Player.position += Player.velocity; + Player.position += npc.velocity; + if (Collision.SolidCollision(Player.position, Player.Hitbox.Width, Player.Hitbox.Height) || Main.npc.Any(x => x.active && x.type == ModContent.NPCType() && x.Opacity > 0.9f && x.whoAmI != npc.whoAmI && x.Hitbox.Intersects(Player.Hitbox))) + { + npc.damage = npc.defDamage; + npc.ai[0] = 1; + LandedOnPlayer = true; + Player.position -= npc.velocity; + } + } + npc.position -= npc.velocity; + + if (!LandedOnPlayer) + { + //Yes, testing intercepts on th X, Y, and X+Y individually has a purpose. It makes it far more stable and consistent. + bool intersectX = false; + Player.position.X += Player.velocity.X; if (Player.Hitbox.Intersects(npc.Hitbox)) - intersect = true; - Player.position -= Player.velocity; - } - if (intersectX || intersect) - { - //This checks if the player is to the left of the pillar - if (Player.Center.X < npc.Center.X) + intersectX = true; + Player.position.X -= Player.velocity.X; + bool intersectY = false; + Player.position.Y += Player.velocity.Y; + if (Player.Hitbox.Intersects(npc.Hitbox)) + intersectY = true; + Player.position.Y -= Player.velocity.Y; + bool intersect = false; + //We only bother checking the X+Y together if individually they return false. + //This accounts for moving diagonal onto a corner. + if (!intersectX && !intersectY) { - float playerEdge = Player.Hitbox.X + Player.Hitbox.Width; - float pillarEdge = npc.Hitbox.X; - float goalEdge = playerEdge + Player.velocity.X; - if (goalEdge > pillarEdge) + Player.position += Player.velocity; + if (Player.Hitbox.Intersects(npc.Hitbox)) + intersect = true; + Player.position -= Player.velocity; + } + if (intersectX || intersect) + { + //This checks if the player is to the left of the pillar + if (Player.Center.X < npc.Center.X) { - Player.velocity.X += pillarEdge - goalEdge; - if (Player.velocity.X < 0) - if (!Collision.SolidCollision(Player.position + new Vector2(Player.velocity.X, 0), Player.Hitbox.Width, Player.Hitbox.Height)) - { - Player.position.X += Player.velocity.X; - Player.velocity.X = 0; - } - else - { - Player.velocity.X = origX; - } + float playerEdge = Player.Hitbox.X + Player.Hitbox.Width; + float pillarEdge = npc.Hitbox.X; + float goalEdge = playerEdge + Player.velocity.X; + if (goalEdge > pillarEdge) + { + Player.velocity.X += pillarEdge - goalEdge; + if (Player.velocity.X < 0) + if (!Collision.SolidCollision(Player.position + new Vector2(Player.velocity.X, 0), Player.Hitbox.Width, Player.Hitbox.Height)) + { + Player.position.X += Player.velocity.X; + Player.velocity.X = 0; + } + else + { + Player.velocity.X = origX; + } + } + } + //This is for if the player is to the right of the pillar + else + { + float playerEdge = Player.Hitbox.X; + float pillarEdge = npc.Hitbox.X + npc.Hitbox.Width; + float goalEdge = playerEdge + Player.velocity.X; + if (goalEdge < pillarEdge) + { + Player.velocity.X += pillarEdge - goalEdge; + if (Player.velocity.X > 0) + if (!Collision.SolidCollision(Player.position + new Vector2(Player.velocity.X, 0), Player.Hitbox.Width, Player.Hitbox.Height)) + { + Player.position.X += Player.velocity.X; + Player.velocity.X = 0; + } + else + { + Player.velocity.X = origX; + } + } } } - //This is for if the player is to the right of the pillar - else + //For the vertical axis, we don't distinguish between top and bottom, and always move players to the top + //This is so being placed inside a pillar teleports a player to the top, which applies primarily to teleporting or pillar spawning + //Additionally, this is set to only work when the pillar is stationary vertically to prevent janky interations when pillars are moving. + if ((intersectY || intersect)) { - float playerEdge = Player.Hitbox.X; - float pillarEdge = npc.Hitbox.X + npc.Hitbox.Width; - float goalEdge = playerEdge + Player.velocity.X; - if (goalEdge < pillarEdge) + if (Player.Center.Y < npc.Center.Y) { - Player.velocity.X += pillarEdge - goalEdge; - if (Player.velocity.X > 0) - if (!Collision.SolidCollision(Player.position + new Vector2(Player.velocity.X, 0), Player.Hitbox.Width, Player.Hitbox.Height)) - { - Player.position.X += Player.velocity.X; - Player.velocity.X = 0; - } - else - { - Player.velocity.X = origX; - } + float playerEdge = Player.Hitbox.Y + Player.Hitbox.Height; + float pillarEdge = npc.Hitbox.Y; + float goalEdge = playerEdge + Player.velocity.Y; + if (goalEdge > pillarEdge) + { + Player.velocity.Y += pillarEdge - goalEdge; + if (Player.velocity.Y < 0) + if (!Collision.SolidCollision(Player.position + new Vector2(0, Player.velocity.Y), Player.Hitbox.Width, Player.Hitbox.Height)) + { + Player.position.Y += Player.velocity.Y; + Player.velocity.Y = 0; + } + else + { + Player.velocity.Y = origY; + } + } + } + else + { + float playerEdge = Player.Hitbox.Y; + float pillarEdge = npc.Hitbox.Y + npc.Hitbox.Height; + float goalEdge = playerEdge + Player.velocity.Y; + if (goalEdge < pillarEdge) + { + Player.velocity.Y += pillarEdge - goalEdge; + if (Player.velocity.Y > 0) + if (!Collision.SolidCollision(Player.position + new Vector2(0, Player.velocity.Y), Player.Hitbox.Width, Player.Hitbox.Height)) + { + Player.position.Y += Player.velocity.Y; + Player.velocity.Y = 0; + } + else + { + Player.velocity.Y = origY; + } + } } } - } - //For the vertical axis, we don't distinguish between top and bottom, and always move players to the top - //This is so being placed inside a pillar teleports a player to the top, which applies primarily to teleporting or pillar spawning - //Additionally, this is set to only work when the pillar is stationary vertically to prevent janky interations when pillars are moving. - if ((intersectY || intersect) && npc.velocity.Y == 0) - { - if (Player.Center.Y < npc.Center.Y) + //This is to guarantee we can stand on top of rock pillars instead of looking like we're "floating" on top of them. + if (intersectY && Player.velocity.Y < 0.25f && Player.velocity.Y > -0.25f) { - float playerEdge = Player.Hitbox.Y + Player.Hitbox.Height; - float pillarEdge = npc.Hitbox.Y; - float goalEdge = playerEdge + Player.velocity.Y; - if (goalEdge > pillarEdge) - { - Player.velocity.Y += pillarEdge - goalEdge; - if (Player.velocity.Y < 0) - if (!Collision.SolidCollision(Player.position + new Vector2(0, Player.velocity.Y), Player.Hitbox.Width, Player.Hitbox.Height)) - { - Player.position.Y += Player.velocity.Y; - Player.velocity.Y = 0; - } - else - { - Player.velocity.Y = origY; - } - } - } else - { - float playerEdge = Player.Hitbox.Y; - float pillarEdge = npc.Hitbox.Y + npc.Hitbox.Height; - float goalEdge = playerEdge + Player.velocity.Y; - if (goalEdge < pillarEdge) - { - Player.velocity.Y += pillarEdge - goalEdge; - if (Player.velocity.Y > 0) - if (!Collision.SolidCollision(Player.position + new Vector2(0, Player.velocity.Y), Player.Hitbox.Width, Player.Hitbox.Height)) - { - Player.position.Y += Player.velocity.Y; - Player.velocity.Y = 0; - } - else - { - Player.velocity.Y = origY; - } - } + Player.velocity.Y = 0; } } - //This is to guarantee we can stand on top of rock pillars instead of looking like we're "floating" on top of them. - if (intersectY && Player.velocity.Y < 0.25f && Player.velocity.Y > -0.25f) - { - Player.velocity.Y = 0; - } } } } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 38aee040ba..9fce483037 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -515,7 +515,7 @@ namespace CalamityMod.NPCs.Ravager player = Main.player[NPC.target]; bool shouldFall = player.position.Y >= NPC.Bottom.Y; - float velocityXBoost = !anyHeadActive ? 6f : death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); + float velocityXBoost = !anyHeadActive ? 6f : 4f * (1f - lifeRatio); float velocityX = 4f + velocityXBoost; if (velocityY != 16) @@ -548,13 +548,13 @@ namespace CalamityMod.NPCs.Ravager { velocityX *= 2f; if (!shouldFall) - velocityY *= 0.5f; + velocityY *= 0.75f; } else if (calamityGlobalNPC.newAI[0] % 2f == 0f) { velocityX *= 1.5f; if (!shouldFall) - velocityY *= 0.75f; + velocityY *= 1f; } } @@ -632,11 +632,28 @@ namespace CalamityMod.NPCs.Ravager } int spawnDistance = 360; - { + if (death && phase2) + spawnDistance = 300; SoundEngine.PlaySound(PillarSound, NPC.Center); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X - spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X + spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); - } + + if (death && !leftClawActive && !rightClawActive) + { + + var index = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X), (int)player.Center.Y - spawnDistance - 100, ModContent.NPCType()); + if (Main.npc.IndexInRange(index)) + { + var npc = Main.npc[index]; + (int, int) H_W = (npc.height, npc.width); + npc.position = npc.Center; + npc.height = H_W.Item2; + npc.width = H_W.Item1; + npc.rotation = -MathHelper.PiOver2; + npc.Center = npc.position; + npc.ModNPC.DrawOffsetY = npc.width / 2 - npc.height / 2; + } + } if (!anyFlamePillars) { float distanceMultiplier = finalPhase ? 2.5f : 2f; @@ -708,7 +725,7 @@ namespace CalamityMod.NPCs.Ravager else calamityGlobalNPC.newAI[2] = player.direction; - float maxOffsetScale = death ? 320f : 240f; + float maxOffsetScale = 240f; float maxOffset = maxOffsetScale * (1f - lifeRatio); float offset = phase2 ? maxOffset * calamityGlobalNPC.newAI[2] : 0f; int quarterWidth = (int)(NPC.width * 0.25f); @@ -750,7 +767,7 @@ namespace CalamityMod.NPCs.Ravager if (NPC.Bottom.Y < player.position.Y) { - float fallSpeedBoost = !anyHeadActive ? 0.9f : death ? 0.9f * (1f - lifeRatio) : 0.6f * (1f - lifeRatio); + float fallSpeedBoost = !anyHeadActive ? 0.9f : 0.6f * (1f - lifeRatio); float fallSpeed = (bossRush ? 0.9f : 0.6f) + fallSpeedBoost; if (calamityGlobalNPC.newAI[1] > 1f) @@ -765,7 +782,7 @@ namespace CalamityMod.NPCs.Ravager float velocityMult = bossRush ? 2f : 1.8f; float velocityXChange = 0.2f + Math.Abs(NPC.Center.X - player.Center.X) * 0.001f; - float velocityXBoost = !anyHeadActive ? 6f : death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); + float velocityXBoost = !anyHeadActive ? 6f : 4f * (1f - lifeRatio); float velocityXCap = 8f + velocityXBoost + Math.Abs(NPC.Center.X - player.Center.X) * 0.001f; if (!rightClawActive) diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index d3288a5610..3b230cd26a 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -79,10 +79,6 @@ namespace CalamityMod.NPCs.Ravager } else { - if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive) - NPC.damage = (int)(NPC.defDamage * 1.5); - else - NPC.damage = NPC.defDamage; } if (NPC.ai[0] == 0) @@ -113,10 +109,14 @@ namespace CalamityMod.NPCs.Ravager } NPC.noTileCollide = true; - NPC.velocity.X = (BossRushEvent.BossRushActive ? 15 : 12) * NPC.direction; + if (NPC.rotation == 0) + NPC.velocity.X = (BossRushEvent.BossRushActive ? 15 : 12) * NPC.direction; NPC.velocity.Y = -28.5f; NPC.ai[0] = 1f; NPC.ai[1] = 0; + NPC.damage = NPC.defDamage; + if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive) + NPC.damage = (int)(NPC.defDamage * 1.5); } } } @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.Ravager } } } - public override bool? CanFallThroughPlatforms() => (NPC.alpha > 10) || (NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height); + public override bool? CanFallThroughPlatforms() => NPC.ai[0] != 0 || ((NPC.alpha > 10) || (NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height)); public override bool CheckActive() => false; public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) From 065c8125fdaed5f5436abfbdd3faa444832a1fe3 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Mon, 7 Jul 2025 22:24:36 -0500 Subject: [PATCH 8/9] Flame pillar visuals, detached head no longer fires beams and is invincible --- NPCs/Ravager/FlamePillar.cs | 3 +-- NPCs/Ravager/RavagerHead2.cs | 5 +++-- Projectiles/Boss/RavagerFlame.cs | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index abbb9ed7db..692d310041 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -33,8 +33,6 @@ namespace CalamityMod.NPCs.Ravager NPC.GetNPCDamage(); NPC.width = 40; NPC.height = 150; - NPC.defense = 35; - NPC.DR_NERD(0.2f); NPC.chaseable = false; NPC.lifeMax = 1250; NPC.alpha = 255; @@ -129,6 +127,7 @@ namespace CalamityMod.NPCs.Ravager int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + NPC.SimpleStrikeNPC(NPC.lifeMax/4,0,false,noPlayerInteraction:true); } NPC.ai[2] += 1f; diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index b2aaf4dd89..f52cba531e 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -51,6 +51,7 @@ namespace CalamityMod.NPCs.Ravager // Scale stats in Expert and Master CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); + NPC.dontTakeDamage = true; } public override void AI() @@ -133,8 +134,8 @@ namespace CalamityMod.NPCs.Ravager { if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundID.Item33, NPC.Center); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, -1f); + //SoundEngine.PlaySound(SoundID.Item33, NPC.Center); + //Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, -1f); } } } diff --git a/Projectiles/Boss/RavagerFlame.cs b/Projectiles/Boss/RavagerFlame.cs index 69f81fa5da..53bc023b24 100644 --- a/Projectiles/Boss/RavagerFlame.cs +++ b/Projectiles/Boss/RavagerFlame.cs @@ -1,5 +1,7 @@ using CalamityMod.Events; +using CalamityMod.Particles; using CalamityMod.World; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -24,14 +26,16 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.extraUpdates = BossRushEvent.BossRushActive ? 2 : 1; + Projectile.extraUpdates = 1; } public override void AI() { + Particle beam3 = new CustomSpark(Projectile.Center, new Vector2(1).RotatedByRandom(6.3f), "CalamityMod/Particles/BloomCircle", false, 10, 0.25f, Color.SkyBlue, new Vector2(1), true, false, 0, false, false, 0f); + GeneralParticleHandler.SpawnParticle(beam3); for (int i = 0; i < 2; i++) { - int icyFlame = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.IceTorch, 0f, 0f, 100, default, 3f); + int icyFlame = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.IceTorch, 0f, 0f, 100, default, 1.5f); Main.dust[icyFlame].noGravity = true; Main.dust[icyFlame].velocity *= 0f; } From 0a8924d4ad4af796703eaeee64d5079a7bdcb539 Mon Sep 17 00:00:00 2001 From: Doze-Zoze Date: Fri, 12 Sep 2025 17:19:01 -0500 Subject: [PATCH 9/9] nerfs phase 2 no longer spawns rock walls death no longer boosts fist speed death top wall only spawns in phase 2 fist speed/fire rate under 20% hp reduced --- NPCs/Ravager/RavagerBody.cs | 35 ++++++++++++++++---------------- NPCs/Ravager/RavagerClawLeft.cs | 19 ++++++++--------- NPCs/Ravager/RavagerClawRight.cs | 19 ++++++++--------- 3 files changed, 35 insertions(+), 38 deletions(-) diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 9fce483037..87f6c0a533 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -632,29 +632,28 @@ namespace CalamityMod.NPCs.Ravager } int spawnDistance = 360; + SoundEngine.PlaySound(PillarSound, NPC.Center); if (death && phase2) + { spawnDistance = 300; - SoundEngine.PlaySound(PillarSound, NPC.Center); - NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X - spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X + spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); - - if (death && !leftClawActive && !rightClawActive) + var index = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X), (int)player.Center.Y - spawnDistance - 100, ModContent.NPCType()); + if (Main.npc.IndexInRange(index)) { + var npc = Main.npc[index]; + (int, int) H_W = (npc.height, npc.width); + npc.position = npc.Center; + npc.height = H_W.Item2; + npc.width = H_W.Item1; + npc.rotation = -MathHelper.PiOver2; + npc.Center = npc.position; + npc.ModNPC.DrawOffsetY = npc.width / 2 - npc.height / 2; - var index = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X), (int)player.Center.Y - spawnDistance - 100, ModContent.NPCType()); - if (Main.npc.IndexInRange(index)) - { - var npc = Main.npc[index]; - (int, int) H_W = (npc.height, npc.width); - npc.position = npc.Center; - npc.height = H_W.Item2; - npc.width = H_W.Item1; - npc.rotation = -MathHelper.PiOver2; - npc.Center = npc.position; - npc.ModNPC.DrawOffsetY = npc.width / 2 - npc.height / 2; - } } - if (!anyFlamePillars) + } + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X - spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X + spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); + + if (!anyFlamePillars && !phase2) { float distanceMultiplier = finalPhase ? 2.5f : 2f; NPC.NewNPC(NPC.GetSource_FromAI(), (int)player.Center.X - (int)(spawnDistance * distanceMultiplier), (int)player.Center.Y - 100, ModContent.NPCType()); diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index 84cda3e20c..0c560f0992 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -67,7 +67,6 @@ namespace CalamityMod.NPCs.Ravager return; } - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.timeLeft < 1800) { NPC.timeLeft = 1800; @@ -98,17 +97,17 @@ namespace CalamityMod.NPCs.Ravager NPC.rotation = 0f; NPC.Center = Main.npc[CalamityGlobalNPC.scavenger].Center + new Vector2(-120f, 50f); NPC.ai[1] += 1f; - if (NPC.life < NPC.lifeMax / 2 || death) + if (NPC.life < NPC.lifeMax / 2) { NPC.ai[1] += 1f; } - if (NPC.life < NPC.lifeMax / 3 || death) + if (NPC.life < NPC.lifeMax / 3) { NPC.ai[1] += 1f; } - if (NPC.life < NPC.lifeMax / 5 || death) + if (NPC.life < NPC.lifeMax / 5) { - NPC.ai[1] += 5f; + NPC.ai[1] += 2f; } if (NPC.ai[1] >= 60f) { @@ -148,17 +147,17 @@ namespace CalamityMod.NPCs.Ravager NPC.collideX = false; NPC.collideY = false; float clawSpeed = 12f; - if (NPC.life < NPC.lifeMax / 2 || death) + if (NPC.life < NPC.lifeMax / 2) { clawSpeed += 2f; } - if (NPC.life < NPC.lifeMax / 3 || death) + if (NPC.life < NPC.lifeMax / 3) { clawSpeed += 2f; } - if (NPC.life < NPC.lifeMax / 5 || death) + if (NPC.life < NPC.lifeMax / 5) { - clawSpeed += 5f; + clawSpeed += 4f; } Vector2 npcCenterAttack = new Vector2(NPC.Center.X, NPC.Center.Y); float targetX = Main.player[NPC.target].Center.X - npcCenterAttack.X; @@ -205,7 +204,7 @@ namespace CalamityMod.NPCs.Ravager bodyReturnYDist += 40f; bodyReturnXDist -= 110f; float bodyReturnDistance = (float)Math.Sqrt(bodyReturnXDist * bodyReturnXDist + bodyReturnYDist * bodyReturnYDist); - if ((bodyReturnDistance > (death ? 900f : 700f) || NPC.collideX || NPC.collideY) | NPC.justHit) + if ((bodyReturnDistance > 700f || NPC.collideX || NPC.collideY) | NPC.justHit) { // Avoid cheap bullshit NPC.damage = 0; diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index b8855ebe09..08d86aba82 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -68,7 +68,6 @@ namespace CalamityMod.NPCs.Ravager return; } - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.timeLeft < 1800) { NPC.timeLeft = 1800; @@ -99,17 +98,17 @@ namespace CalamityMod.NPCs.Ravager NPC.rotation = 0f; NPC.Center = Main.npc[CalamityGlobalNPC.scavenger].Center + new Vector2(120f, 50f); NPC.ai[1] += 1f; - if (NPC.life < NPC.lifeMax / 2 || death) + if (NPC.life < NPC.lifeMax / 2) { NPC.ai[1] += 1f; } - if (NPC.life < NPC.lifeMax / 3 || death) + if (NPC.life < NPC.lifeMax / 3) { NPC.ai[1] += 1f; } - if (NPC.life < NPC.lifeMax / 5 || death) + if (NPC.life < NPC.lifeMax / 5) { - NPC.ai[1] += 5f; + NPC.ai[1] += 2f; } if (NPC.ai[1] >= 60f) { @@ -149,17 +148,17 @@ namespace CalamityMod.NPCs.Ravager NPC.collideX = false; NPC.collideY = false; float clawSpeed = 12f; - if (NPC.life < NPC.lifeMax / 2 || death) + if (NPC.life < NPC.lifeMax / 2) { clawSpeed += 2f; } - if (NPC.life < NPC.lifeMax / 3 || death) + if (NPC.life < NPC.lifeMax / 3) { clawSpeed += 2f; } - if (NPC.life < NPC.lifeMax / 5 || death) + if (NPC.life < NPC.lifeMax / 5) { - clawSpeed += 5f; + clawSpeed += 4f; } Vector2 npcCenterAttack = new Vector2(NPC.Center.X, NPC.Center.Y); float targetX = Main.player[NPC.target].Center.X - npcCenterAttack.X; @@ -206,7 +205,7 @@ namespace CalamityMod.NPCs.Ravager bodyReturnYDist += 40f; bodyReturnXDist += 110f; float bodyReturnDistance = (float)Math.Sqrt(bodyReturnXDist * bodyReturnXDist + bodyReturnYDist * bodyReturnYDist); - if ((bodyReturnDistance > (death ? 900f : 700f) || NPC.collideX || NPC.collideY) | NPC.justHit) + if ((bodyReturnDistance > 700f || NPC.collideX || NPC.collideY) | NPC.justHit) { // Avoid cheap bullshit NPC.damage = 0;