Merge branch 'trollderim/replace-magic-dr-number' into 'master'

Replace magic dr constant

Closes #915

See merge request veloren/veloren!1756
This commit is contained in:
Imbris 2021-02-06 20:28:40 +00:00
commit a5c76a6d36

View File

@ -393,8 +393,11 @@ impl Damage {
Protection::Invincible => None,
})
.sum::<Option<f32>>();
const FIFTY_PERCENT_DR_THRESHOLD: f32 = 60.0;
match protection {
Some(dr) => dr / (60.0 + dr.abs()),
Some(dr) => dr / (FIFTY_PERCENT_DR_THRESHOLD + dr.abs()),
None => 1.0,
}
}