fix cauterization (#23264)

* fix cauterization

* remove if statement

* revert DamageTest change

* fix
This commit is contained in:
themias
2024-01-01 03:08:25 -05:00
committed by GitHub
parent 2ac40560dd
commit 9115994abf
3 changed files with 7 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ namespace Content.Tests.Shared
private static Dictionary<string, float> _resistanceCoefficientDict = new()
{
// "missing" blunt entry
{ "Piercing", -2 }, // negative multipliers just cause the damage to be ignored.
{ "Piercing", -2 },// Turn Piercing into Healing
{ "Slash", 3 },
{ "Radiation", 1.5f },
};
@@ -152,14 +152,14 @@ namespace Content.Tests.Shared
// Apply once
damageSpec = DamageSpecifier.ApplyModifierSet(damageSpec, modifierSet);
Assert.That(damageSpec.DamageDict["Blunt"], Is.EqualTo(FixedPoint2.New(25)));
Assert.That(!damageSpec.DamageDict.ContainsKey("Piercing")); // Cannot convert damage into healing.
Assert.That(damageSpec.DamageDict["Piercing"], Is.EqualTo(FixedPoint2.New(-40))); // became healing
Assert.That(damageSpec.DamageDict["Slash"], Is.EqualTo(FixedPoint2.New(6)));
Assert.That(damageSpec.DamageDict["Radiation"], Is.EqualTo(FixedPoint2.New(44.25)));
// And again, checking for some other behavior
damageSpec = DamageSpecifier.ApplyModifierSet(damageSpec, modifierSet);
Assert.That(damageSpec.DamageDict["Blunt"], Is.EqualTo(FixedPoint2.New(30)));
Assert.That(!damageSpec.DamageDict.ContainsKey("Piercing"));
Assert.That(damageSpec.DamageDict["Piercing"], Is.EqualTo(FixedPoint2.New(-40))); // resistances don't apply to healing
Assert.That(!damageSpec.DamageDict.ContainsKey("Slash")); // Reduction reduced to 0, and removed from specifier
Assert.That(damageSpec.DamageDict["Radiation"], Is.EqualTo(FixedPoint2.New(65.63)));
}