public void SetModalStatValues(PChar c) { if (c.GetArmor() != null) { this._armorSlider.maxValue = (float)c.GetArmor().GetStat(EArmorStat.Durability); this._armorSlider.value = (float)c.GetArmor().GetStat(EArmorStat.Durability); } else { this._armorSlider.maxValue = 0; } if (c.GetHelm() != null) { this._helmSlider.maxValue = (float)c.GetHelm().GetStat(EArmorStat.Durability); this._helmSlider.value = (float)c.GetHelm().GetStat(EArmorStat.Durability); } else { this._helmSlider.maxValue = 0; } if (c.GetLWeapon() != null) { this._lWeaponSlider.maxValue = (float)c.GetLWeapon().GetStat(EWeaponStat.Max_Durability); this._lWeaponSlider.value = (float)c.GetLWeapon().GetStat(EWeaponStat.Max_Durability); } else { this._lWeaponSlider.maxValue = 0; } if (c.GetRWeapon() != null) { this._rWeaponSlider.maxValue = (float)c.GetRWeapon().GetStat(EWeaponStat.Max_Durability); this._rWeaponSlider.value = (float)c.GetRWeapon().GetStat(EWeaponStat.Max_Durability); } else { this._rWeaponSlider.maxValue = 0; } this._hpSlider.maxValue = (int)c.GetStat(ESecondaryStat.HP); this._hpSlider.value = (int)c.GetPoints(ESecondaryStat.HP); this._moraleSlider.maxValue = (int)c.GetStat(ESecondaryStat.Morale); this._moraleSlider.value = (int)c.GetPoints(ESecondaryStat.Morale); this._stamSlider.maxValue = (int)c.GetStat(ESecondaryStat.Stamina); this._stamSlider.value = (int)c.GetPoints(ESecondaryStat.Stamina); }
private double GetHitDamageIgnore(MHit hit, PChar src, PChar tgt) { double flatDmgNegate = tgt.GetStat(ESecondaryStat.Damage_Ignore); if (hit.Data.IsWeapon) { double modifier = 1; if (hit.Data.IsLWeapon) { modifier *= (src.GetLWeapon().GetStat(EWeaponStat.Armor_Pierce) / src.GetLWeapon().GetDurabilityPercentage()); } else { modifier *= (src.GetRWeapon().GetStat(EWeaponStat.Armor_Pierce) / src.GetRWeapon().GetDurabilityPercentage()); } flatDmgNegate *= modifier; } return(flatDmgNegate); }