forked from teamnwah/openmw-tes3coop
Implement ranged crits (feature #3703)
This commit is contained in:
parent
9e6cba09a6
commit
c79f96d0d2
2 changed files with 15 additions and 1 deletions
|
@ -75,6 +75,7 @@
|
|||
Feature #3083: Play animation when NPC is casting spell via script
|
||||
Feature #3276: Editor: Search- Show number of (remaining) search results and indicate a search without any results
|
||||
Feature #3641: Editor: Limit FPS in 3d preview window
|
||||
Feature #3703: Ranged sneak attack criticals
|
||||
Feature #4222: 360° screenshots
|
||||
Feature #4256: Implement ToggleBorders (TB) console command
|
||||
Feature #4324: Add CFBundleIdentifier in Info.plist to allow for macOS function key shortcuts
|
||||
|
|
|
@ -209,8 +209,21 @@ namespace MWMechanics
|
|||
|
||||
adjustWeaponDamage(damage, weapon, attacker);
|
||||
|
||||
if(attacker == getPlayer())
|
||||
if (attacker == getPlayer())
|
||||
{
|
||||
attacker.getClass().skillUsageSucceeded(attacker, weaponSkill, 0);
|
||||
const MWMechanics::AiSequence& sequence = victim.getClass().getCreatureStats(victim).getAiSequence();
|
||||
|
||||
bool unaware = !sequence.isInCombat()
|
||||
&& !MWBase::Environment::get().getMechanicsManager()->awarenessCheck(attacker, victim);
|
||||
|
||||
if (unaware)
|
||||
{
|
||||
damage *= gmst.find("fCombatCriticalStrikeMult")->getFloat();
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}");
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
if (victim.getClass().getCreatureStats(victim).getKnockedDown())
|
||||
damage *= gmst.find("fCombatKODamageMult")->getFloat();
|
||||
|
|
Loading…
Reference in a new issue