Magic armor mitigation for creatures (feature #5033)

pull/541/head
Capostrophic 6 years ago
parent c67eb6d9db
commit 144b1b9b06

@ -114,6 +114,7 @@
Feature #5000: Compressed BSA format support
Feature #5010: Native graphics herbalism support
Feature #5031: Make GetWeaponType function return different values for tools
Feature #5033: Magic armor mitigation for creatures
Task #4686: Upgrade media decoder to a more current FFmpeg API
Task #4695: Optimize Distant Terrain memory consumption
Task #4721: Add NMake support to the Windows prebuild script

@ -401,10 +401,10 @@ namespace MWClass
stats.setHitRecovery(true); // Is this supposed to always occur?
}
damage = std::max(1.f, damage);
if(ishealth)
{
damage *= damage / (damage + getArmorRating(ptr));
damage = std::max(1.f, damage);
if (!attacker.isEmpty())
{
damage = scaleDamage(damage, attacker, ptr);
@ -597,7 +597,7 @@ namespace MWClass
float Creature::getArmorRating (const MWWorld::Ptr& ptr) const
{
// Note this is currently unused. Creatures do not use armor mitigation.
// Equipment armor rating is deliberately ignored.
return getCreatureStats(ptr).getMagicEffects().get(ESM::MagicEffect::Shield).getMagnitude();
}

@ -571,8 +571,8 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
// Autoequip clothing, armor and weapons.
// Equipping lights is handled in Actors::updateEquippedLight based on environment light.
// Note: creatures do not use the armor mitigation and can equip only shields
// Use a custom logic for them - select shield based on its health instead of armor rating (since it useless for creatures)
// Note: creatures ignore equipment armor rating and only equip shields
// Use custom logic for them - select shield based on its health instead of armor rating
autoEquipWeapon(actor, slots_);
autoEquipArmor(actor, slots_);

Loading…
Cancel
Save