Fixed bugs in piercing penetration and crushing poise damage calculations.

This commit is contained in:
Sam 2022-01-07 10:15:37 -05:00
parent d1e1de3b14
commit f182eec611

View File

@ -277,7 +277,7 @@ impl Attack {
let reduced_damage =
applied_damage * damage_reduction / (1.0 - damage_reduction);
let poise = reduced_damage * CRUSHING_POISE_FRACTION;
let change = Poise::apply_poise_reduction(poise, target.inventory);
let change = -Poise::apply_poise_reduction(poise, target.inventory);
let poise_change = PoiseChange {
amount: change,
impulse: *dir,
@ -777,7 +777,9 @@ impl Damage {
let penetration = if let Some(damage) = damage {
if let DamageKind::Piercing = damage.kind {
damage.value * PIERCING_PENETRATION_FRACTION
(damage.value * PIERCING_PENETRATION_FRACTION)
.min(protection.unwrap_or(0.0))
.max(0.0)
} else {
0.0
}