Always reduce weapon condition by the raw damage (bug #6559)

CPP20_support
Alexei Dobrohotov 2 years ago
parent 09b1aca9bd
commit fdd9e6a793

@ -101,6 +101,7 @@
Bug #6519: Effects tooltips for ingredients work incorrectly
Bug #6523: Disintegrate Weapon is resisted by Resist Magicka instead of Sanctuary
Bug #6544: Far from world origin objects jitter when camera is still
Bug #6559: Weapon condition inconsistency between melee and ranged critical / sneak / KO attacks
Bug #6579: OpenMW compilation error when using OSG doubles for BoundingSphere
Feature #890: OpenMW-CS: Column filtering
Feature #1465: "Reset" argument for AI functions

@ -305,8 +305,8 @@ namespace MWClass
{
damage = attack[0] + ((attack[1]-attack[0])*attackStrength);
MWMechanics::adjustWeaponDamage(damage, weapon, ptr);
MWMechanics::resistNormalWeapon(victim, ptr, weapon, damage);
MWMechanics::reduceWeaponCondition(damage, true, weapon, ptr);
MWMechanics::resistNormalWeapon(victim, ptr, weapon, damage);
}
// Apply "On hit" enchanted weapons

@ -607,9 +607,9 @@ namespace MWClass
damage = attack[0] + ((attack[1]-attack[0])*attackStrength);
}
MWMechanics::adjustWeaponDamage(damage, weapon, ptr);
MWMechanics::reduceWeaponCondition(damage, true, weapon, ptr);
MWMechanics::resistNormalWeapon(victim, ptr, weapon, damage);
MWMechanics::applyWerewolfDamageMult(victim, weapon, damage);
MWMechanics::reduceWeaponCondition(damage, true, weapon, ptr);
healthdmg = true;
}
else

@ -200,17 +200,17 @@ namespace MWMechanics
bool validVictim = !victim.isEmpty() && victim.getClass().isActor();
int weaponSkill = ESM::Skill::Marksman;
if (!weapon.isEmpty())
weaponSkill = weapon.getClass().getEquipmentSkill(weapon);
float damage = 0.f;
if (validVictim)
{
if (attacker == getPlayer())
MWBase::Environment::get().getWindowManager()->setEnemy(victim);
int weaponSkill = ESM::Skill::Marksman;
if (!weapon.isEmpty())
weaponSkill = weapon.getClass().getEquipmentSkill(weapon);
int skillValue = attacker.getClass().getSkill(attacker, weapon.getClass().getEquipmentSkill(weapon));
int skillValue = attacker.getClass().getSkill(attacker, weaponSkill);
if (Misc::Rng::roll0to99() >= getHitChance(attacker, victim, skillValue))
{
@ -228,6 +228,12 @@ namespace MWMechanics
damage += attack[0] + ((attack[1] - attack[0]) * attackStrength);
adjustWeaponDamage(damage, weapon, attacker);
}
reduceWeaponCondition(damage, validVictim, weapon, attacker);
if (validVictim)
{
if (weapon == projectile || Settings::Manager::getBool("only appropriate ammunition bypasses resistance", "Game") || isNormalWeapon(weapon))
resistNormalWeapon(victim, attacker, projectile, damage);
applyWerewolfDamageMult(victim, projectile, damage);
@ -247,8 +253,6 @@ namespace MWMechanics
}
}
reduceWeaponCondition(damage, validVictim, weapon, attacker);
// Apply "On hit" effect of the projectile
bool appliedEnchantment = applyOnStrikeEnchantment(attacker, victim, projectile, hitPosition, true);

Loading…
Cancel
Save