forked from mirror/openmw-tes3mp
Don't block when actor is paralyzed
This commit is contained in:
parent
28a0899d2b
commit
9897f14c3c
1 changed files with 15 additions and 13 deletions
|
@ -55,11 +55,24 @@ namespace MWMechanics
|
||||||
if (!blocker.getClass().hasInventoryStore(blocker))
|
if (!blocker.getClass().hasInventoryStore(blocker))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (blocker.getClass().getCreatureStats(blocker).getKnockedDown()
|
MWMechanics::CreatureStats& blockerStats = blocker.getClass().getCreatureStats(blocker);
|
||||||
|| blocker.getClass().getCreatureStats(blocker).getHitRecovery())
|
|
||||||
|
if (blockerStats.getKnockedDown() // Used for both knockout or knockdown
|
||||||
|
|| blockerStats.getHitRecovery()
|
||||||
|
|| blockerStats.getMagicEffects().get(ESM::MagicEffect::Paralyze).mMagnitude > 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Don't block when in spellcasting state (shield is equipped, but not visible)
|
||||||
|
if (blockerStats.getDrawState() == DrawState_Spell)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MWWorld::InventoryStore& inv = blocker.getClass().getInventoryStore(blocker);
|
MWWorld::InventoryStore& inv = blocker.getClass().getInventoryStore(blocker);
|
||||||
|
|
||||||
|
// Don't block when in hand-to-hand combat (shield is equipped, but not visible)
|
||||||
|
if (blockerStats.getDrawState() == DrawState_Weapon &&
|
||||||
|
inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight) == inv.end())
|
||||||
|
return false;
|
||||||
|
|
||||||
MWWorld::ContainerStoreIterator shield = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
MWWorld::ContainerStoreIterator shield = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
||||||
if (shield == inv.end() || shield->getTypeName() != typeid(ESM::Armor).name())
|
if (shield == inv.end() || shield->getTypeName() != typeid(ESM::Armor).name())
|
||||||
return false;
|
return false;
|
||||||
|
@ -73,17 +86,6 @@ namespace MWMechanics
|
||||||
if (angle.valueDegrees() > gmst.find("fCombatBlockRightAngle")->getFloat())
|
if (angle.valueDegrees() > gmst.find("fCombatBlockRightAngle")->getFloat())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MWMechanics::CreatureStats& blockerStats = blocker.getClass().getCreatureStats(blocker);
|
|
||||||
|
|
||||||
// Don't block when in spellcasting state (shield is equipped, but not visible)
|
|
||||||
if (blockerStats.getDrawState() == DrawState_Spell)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Don't block when in hand-to-hand combat (shield is equipped, but not visible)
|
|
||||||
if (blockerStats.getDrawState() == DrawState_Weapon &&
|
|
||||||
inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight) == inv.end())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
MWMechanics::CreatureStats& attackerStats = attacker.getClass().getCreatureStats(attacker);
|
MWMechanics::CreatureStats& attackerStats = attacker.getClass().getCreatureStats(attacker);
|
||||||
|
|
||||||
float blockTerm = blocker.getClass().getSkill(blocker, ESM::Skill::Block) + 0.2 * blockerStats.getAttribute(ESM::Attribute::Agility).getModified()
|
float blockTerm = blocker.getClass().getSkill(blocker, ESM::Skill::Block) + 0.2 * blockerStats.getAttribute(ESM::Attribute::Agility).getModified()
|
||||||
|
|
Loading…
Reference in a new issue