mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 20:53:50 +00:00
Merge pull request #2377 from Capostrophic/armor
Armor mitigation tweaks (feature #5033)
This commit is contained in:
commit
004da85533
4 changed files with 6 additions and 11 deletions
|
@ -114,6 +114,7 @@
|
||||||
Feature #5000: Compressed BSA format support
|
Feature #5000: Compressed BSA format support
|
||||||
Feature #5010: Native graphics herbalism support
|
Feature #5010: Native graphics herbalism support
|
||||||
Feature #5031: Make GetWeaponType function return different values for tools
|
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 #4686: Upgrade media decoder to a more current FFmpeg API
|
||||||
Task #4695: Optimize Distant Terrain memory consumption
|
Task #4695: Optimize Distant Terrain memory consumption
|
||||||
Task #4721: Add NMake support to the Windows prebuild script
|
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?
|
stats.setHitRecovery(true); // Is this supposed to always occur?
|
||||||
}
|
}
|
||||||
|
|
||||||
damage = std::max(1.f, damage);
|
|
||||||
|
|
||||||
if(ishealth)
|
if(ishealth)
|
||||||
{
|
{
|
||||||
|
damage *= damage / (damage + getArmorRating(ptr));
|
||||||
|
damage = std::max(1.f, damage);
|
||||||
if (!attacker.isEmpty())
|
if (!attacker.isEmpty())
|
||||||
{
|
{
|
||||||
damage = scaleDamage(damage, attacker, ptr);
|
damage = scaleDamage(damage, attacker, ptr);
|
||||||
|
@ -597,7 +597,7 @@ namespace MWClass
|
||||||
|
|
||||||
float Creature::getArmorRating (const MWWorld::Ptr& ptr) const
|
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();
|
return getCreatureStats(ptr).getMagicEffects().get(ESM::MagicEffect::Shield).getMagnitude();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,12 +108,6 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy.getClass().isNpc())
|
|
||||||
{
|
|
||||||
static const float fCombatArmorMinMult = gmst.find("fCombatArmorMinMult")->mValue.getFloat();
|
|
||||||
rating *= std::max(fCombatArmorMinMult, rating / (rating + enemy.getClass().getArmorRating(enemy)));
|
|
||||||
}
|
|
||||||
|
|
||||||
int value = 50.f;
|
int value = 50.f;
|
||||||
if (actor.getClass().isNpc())
|
if (actor.getClass().isNpc())
|
||||||
{
|
{
|
||||||
|
|
|
@ -571,8 +571,8 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
|
||||||
|
|
||||||
// Autoequip clothing, armor and weapons.
|
// Autoequip clothing, armor and weapons.
|
||||||
// Equipping lights is handled in Actors::updateEquippedLight based on environment light.
|
// Equipping lights is handled in Actors::updateEquippedLight based on environment light.
|
||||||
// Note: creatures do not use the armor mitigation and can equip only shields
|
// Note: creatures ignore equipment armor rating and only equip shields
|
||||||
// Use a custom logic for them - select shield based on its health instead of armor rating (since it useless for creatures)
|
// Use custom logic for them - select shield based on its health instead of armor rating
|
||||||
autoEquipWeapon(actor, slots_);
|
autoEquipWeapon(actor, slots_);
|
||||||
autoEquipArmor(actor, slots_);
|
autoEquipArmor(actor, slots_);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue