fix: fixed impenetrable proccing on heavy artillery hit
This commit is contained in:
parent
e7bad12bef
commit
34fe16407e
1 changed files with 23 additions and 9 deletions
|
|
@ -13,7 +13,7 @@ use proxisim_models::bundle::{
|
|||
},
|
||||
weapon::{
|
||||
Ammo, AmmoType, DamageStat, NeedsReload, NonTargeted, RateOfFire, Usable, Uses, Weapon,
|
||||
WeaponSlot,
|
||||
WeaponCategory, WeaponSlot,
|
||||
},
|
||||
};
|
||||
use rand::Rng as _;
|
||||
|
|
@ -197,8 +197,7 @@ fn check_bonus_mitigation(
|
|||
w_children: &Children,
|
||||
armour_mitigation: &mut f32,
|
||||
piece: &mut Option<&BodyPartCoverage>,
|
||||
slot: WeaponSlot,
|
||||
rounds: &Option<u16>,
|
||||
cat: &WeaponCategory,
|
||||
health: &Health,
|
||||
max_health: &SimpleStatEffective<MaxHealth>,
|
||||
) -> f32 {
|
||||
|
|
@ -221,10 +220,26 @@ fn check_bonus_mitigation(
|
|||
&& let Some(mut mitigation) = params.mitigation_q.get_mut(piece.armour).unwrap()
|
||||
{
|
||||
match mitigation.as_mut() {
|
||||
DamageMitigationBonus::Impregnable { mitigation } if slot == WeaponSlot::Melee => {
|
||||
DamageMitigationBonus::Impregnable { mitigation }
|
||||
if matches!(
|
||||
*cat,
|
||||
WeaponCategory::Clubbing | WeaponCategory::Piercing | WeaponCategory::Slashing
|
||||
) =>
|
||||
{
|
||||
*mitigation
|
||||
}
|
||||
DamageMitigationBonus::Impenetrable { mitigation }
|
||||
if matches!(
|
||||
*cat,
|
||||
WeaponCategory::MachineGun
|
||||
| WeaponCategory::Pistol
|
||||
| WeaponCategory::Rifle
|
||||
| WeaponCategory::Shotgun
|
||||
| WeaponCategory::Smg
|
||||
) =>
|
||||
{
|
||||
*mitigation
|
||||
}
|
||||
DamageMitigationBonus::Impenetrable { mitigation } if rounds.is_some() => *mitigation,
|
||||
DamageMitigationBonus::Insurmountable { mitigation } => {
|
||||
if health.0 as f32 / max_health.value as f32 <= 0.25 {
|
||||
*mitigation
|
||||
|
|
@ -425,7 +440,7 @@ struct EntityParams<'w, 's> {
|
|||
&'static SimpleStatEffective<DamageBonus>,
|
||||
&'static SimpleStatEffective<CritRate>,
|
||||
&'static Children,
|
||||
&'static WeaponSlot,
|
||||
&'static WeaponCategory,
|
||||
Has<NonTargeted>,
|
||||
),
|
||||
(With<Weapon>, With<Current>, Without<NeedsReload>),
|
||||
|
|
@ -495,7 +510,7 @@ fn use_damaging_weapon(
|
|||
),
|
||||
dmg_spread: Local<DamageSpread>,
|
||||
) {
|
||||
let Ok((weapon, w_dmg, acc, dmg_bonus, crit, children, slot, non_targeted)) =
|
||||
let Ok((weapon, w_dmg, acc, dmg_bonus, crit, children, w_cat, non_targeted)) =
|
||||
entities.weapon_q.single()
|
||||
else {
|
||||
return;
|
||||
|
|
@ -689,8 +704,7 @@ fn use_damaging_weapon(
|
|||
children,
|
||||
&mut armour_mitigation,
|
||||
&mut piece,
|
||||
*slot,
|
||||
&rounds,
|
||||
w_cat,
|
||||
&health,
|
||||
target_max_health,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue