|
|
@ -135,6 +135,15 @@ namespace MWMechanics
|
|
|
|
auto& prng = MWBase::Environment::get().getWorld()->getPrng();
|
|
|
|
auto& prng = MWBase::Environment::get().getWorld()->getPrng();
|
|
|
|
if (Misc::Rng::roll0to99(prng) < x)
|
|
|
|
if (Misc::Rng::roll0to99(prng) < x)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
MWBase::SoundManager* sndMgr = MWBase::Environment::get().getSoundManager();
|
|
|
|
|
|
|
|
const ESM::RefId skill = shield->getClass().getEquipmentSkill(*shield);
|
|
|
|
|
|
|
|
if (skill == ESM::Skill::LightArmor)
|
|
|
|
|
|
|
|
sndMgr->playSound3D(blocker, ESM::RefId::stringRefId("Light Armor Hit"), 1.0f, 1.0f);
|
|
|
|
|
|
|
|
else if (skill == ESM::Skill::MediumArmor)
|
|
|
|
|
|
|
|
sndMgr->playSound3D(blocker, ESM::RefId::stringRefId("Medium Armor Hit"), 1.0f, 1.0f);
|
|
|
|
|
|
|
|
else if (skill == ESM::Skill::HeavyArmor)
|
|
|
|
|
|
|
|
sndMgr->playSound3D(blocker, ESM::RefId::stringRefId("Heavy Armor Hit"), 1.0f, 1.0f);
|
|
|
|
|
|
|
|
|
|
|
|
// Reduce shield durability by incoming damage
|
|
|
|
// Reduce shield durability by incoming damage
|
|
|
|
int shieldhealth = shield->getClass().getItemHealth(*shield);
|
|
|
|
int shieldhealth = shield->getClass().getItemHealth(*shield);
|
|
|
|
|
|
|
|
|
|
|
|