1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-28 15:09:40 +00:00

Merge pull request #2463 from Capostrophic/crit

Vanilla-friendly ranged crits (bug #5067)
This commit is contained in:
Andrei Kortunov 2019-08-09 20:23:56 +04:00 committed by GitHub
commit 134631ad72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 14 deletions

View file

@ -109,6 +109,7 @@
Bug #5056: Calling Cast function on player doesn't equip the spell but casts it Bug #5056: Calling Cast function on player doesn't equip the spell but casts it
Bug #5060: Magic effect visuals stop when death animation begins instead of when it ends Bug #5060: Magic effect visuals stop when death animation begins instead of when it ends
Bug #5063: Shape named "Tri Shadow" in creature mesh is visible if it isn't hidden Bug #5063: Shape named "Tri Shadow" in creature mesh is visible if it isn't hidden
Bug #5067: Ranged attacks on unaware opponents ("critical hits") differ from the vanilla engine
Bug #5069: Blocking creatures' attacks doesn't degrade shields Bug #5069: Blocking creatures' attacks doesn't degrade shields
Bug #5074: Paralyzed actors greet the player Bug #5074: Paralyzed actors greet the player
Bug #5075: Enchanting cast style can be changed if there's no object Bug #5075: Enchanting cast style can be changed if there's no object

View file

@ -229,25 +229,20 @@ namespace MWMechanics
applyWerewolfDamageMult(victim, projectile, damage); applyWerewolfDamageMult(victim, projectile, damage);
if (attacker == getPlayer()) if (attacker == getPlayer())
{
attacker.getClass().skillUsageSucceeded(attacker, weaponSkill, 0); attacker.getClass().skillUsageSucceeded(attacker, weaponSkill, 0);
const MWMechanics::AiSequence& sequence = victim.getClass().getCreatureStats(victim).getAiSequence(); const MWMechanics::AiSequence& sequence = victim.getClass().getCreatureStats(victim).getAiSequence();
bool unaware = attacker == getPlayer() && !sequence.isInCombat()
bool unaware = !sequence.isInCombat()
&& !MWBase::Environment::get().getMechanicsManager()->awarenessCheck(attacker, victim); && !MWBase::Environment::get().getMechanicsManager()->awarenessCheck(attacker, victim);
bool knockedDown = victim.getClass().getCreatureStats(victim).getKnockedDown();
if (unaware) if (knockedDown || unaware)
{ {
damage *= gmst.find("fCombatCriticalStrikeMult")->mValue.getFloat(); damage *= gmst.find("fCombatKODamageMult")->mValue.getFloat();
MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}"); if (!knockedDown)
MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f); MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f);
} }
} }
if (victim.getClass().getCreatureStats(victim).getKnockedDown())
damage *= gmst.find("fCombatKODamageMult")->mValue.getFloat();
}
reduceWeaponCondition(damage, validVictim, weapon, attacker); reduceWeaponCondition(damage, validVictim, weapon, attacker);
// Apply "On hit" effect of the weapon & projectile // Apply "On hit" effect of the weapon & projectile