mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed bugs in piercing penetration and crushing poise damage calculations.
This commit is contained in:
parent
d1e1de3b14
commit
f182eec611
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user