Moved universal pierce resistance balancing values into BalancingConstants

This commit is contained in:
Ozzatron committed 2025-04-16 19:34:58 -04:00
1 parent 06d9eb8f9f
commit fbbdc70199
3 files changed
+14 -10

No files matched your search

+10
View File
@@ -242,6 +242,16 @@
internal static readonly float TrueMeleeRipperReductionFactor = 0.5f; // True melee benefits less from rippers to prevent excessive melting.
#endregion
#region Pierce Resistance
// Both of the below variables only apply when an NPC has universal pierce resistance enabled via attribute.
// Projectiles may be marked as exempt from this pierce resistance by using an attribute.
/// <summary> Constant variable used to determine the percentage a projectile's damage is reduced by pierce resist on each hit. </summary>
public const float PierceResistHarshness = 0.12f;
/// <summary> Constant variable used to determine the maximum percentage a projectile's damage can be reduced by pierce resist. </summary>
public const float PierceResistCap = 0.8f;
#endregion
// TODO -- NPC classification is not done consistently with predictable thresholds.
// These variables should be used in general to classify "enemies" vs "non-enemies" as well.
// See NPCUtils.IsAnEnemy
+4 -5
View File
@@ -2,9 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using CalamityMod.Balancing;
using CalamityMod.Items.Accessories;
using CalamityMod.NPCs;
using CalamityMod.NPCs.ExoMechs.Thanatos;
using CalamityMod.Projectiles;
using CalamityMod.Systems.Collections;
using Terraria;
@@ -149,9 +148,9 @@ namespace CalamityMod.NPCs
if (ThanatosIDList.Includes(npc.type) && npc.GetGlobalNPC<CalamityGlobalNPC>().unbreakableDR)
return;
float damageReduction = projectile.Calamity().timesPierced * CalamityGlobalProjectile.PierceResistHarshness;
if (damageReduction > CalamityGlobalProjectile.PierceResistCap)
damageReduction = CalamityGlobalProjectile.PierceResistCap;
float damageReduction = projectile.Calamity().timesPierced * BalancingConstants.PierceResistHarshness;
if (damageReduction > BalancingConstants.PierceResistCap)
damageReduction = BalancingConstants.PierceResistCap;
modifiers.FinalDamage *= 1f - damageReduction;
-5
View File
@@ -74,11 +74,6 @@ namespace CalamityMod.Projectiles
/// <summary> Constant variable used as a speed cap for boss laser projectiles with 2 extra updates. </summary>
public const float AcceleratingBossLaserVelocityCap = 8f;
/// <summary> Constant variable used to determine the percentage a projectile's damage is reduced by pierce resist on each hit. </summary>
public const float PierceResistHarshness = 0.12f;
/// <summary> Constant variable used to determine the maximum percentage a projectile's damage can be reduced by pierce resist. </summary>
public const float PierceResistCap = 0.8f;
/// <summary>
/// Used for executing frame one hacks. Things set during this include:
/// <br/>* Reducing projectile damage for Hardmode enemies and in Master Mode.