mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 12:53:51 +00:00
Account for enemy armor rating in weapon rating
This commit is contained in:
parent
fa3e45fa7d
commit
e66be02e2e
1 changed files with 8 additions and 2 deletions
|
@ -97,8 +97,11 @@ namespace MWMechanics
|
|||
}
|
||||
}
|
||||
|
||||
if (weapon->mData.mType <= ESM::Weapon::MarksmanThrown)
|
||||
rating *= weapon->mData.mSpeed;
|
||||
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;
|
||||
if (actor.getClass().isNpc())
|
||||
|
@ -115,6 +118,9 @@ namespace MWMechanics
|
|||
|
||||
rating *= getHitChance(actor, enemy, value) / 100.f;
|
||||
|
||||
if (weapon->mData.mType <= ESM::Weapon::MarksmanThrown)
|
||||
rating *= weapon->mData.mSpeed;
|
||||
|
||||
return rating * rangedMult;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue