mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-02 07:21:07 +00:00
Resist failed normal weapon hits (bug #7284)
This commit is contained in:
parent
d9027f7eef
commit
411c71062c
@ -54,6 +54,7 @@
|
|||||||
Bug #7172: Current music playlist continues playing indefinitely if next playlist is empty
|
Bug #7172: Current music playlist continues playing indefinitely if next playlist is empty
|
||||||
Bug #7229: Error marker loading failure is not handled
|
Bug #7229: Error marker loading failure is not handled
|
||||||
Bug #7243: Supporting loading external files from VFS from esm files
|
Bug #7243: Supporting loading external files from VFS from esm files
|
||||||
|
Bug #7284: "Your weapon has no effect." message doesn't always show when the player character attempts to attack
|
||||||
Bug #7298: Water ripples from projectiles sometimes are not spawned
|
Bug #7298: Water ripples from projectiles sometimes are not spawned
|
||||||
Bug #7307: Alchemy "Magic Effect" search string does not match on tool tip for effects related to attributes
|
Bug #7307: Alchemy "Magic Effect" search string does not match on tool tip for effects related to attributes
|
||||||
Bug #7322: Shadows don't cover groundcover depending on the view angle and perspective with compute scene bounds = primitives
|
Bug #7322: Shadows don't cover groundcover depending on the view angle and perspective with compute scene bounds = primitives
|
||||||
|
@ -614,15 +614,16 @@ namespace MWClass
|
|||||||
if (ptr == MWMechanics::getPlayer())
|
if (ptr == MWMechanics::getPlayer())
|
||||||
MWBase::Environment::get().getWindowManager()->setEnemy(victim);
|
MWBase::Environment::get().getWindowManager()->setEnemy(victim);
|
||||||
|
|
||||||
|
float damage = 0.0f;
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
othercls.onHit(victim, 0.0f, false, weapon, ptr, osg::Vec3f(), false);
|
othercls.onHit(victim, damage, false, weapon, ptr, osg::Vec3f(), false);
|
||||||
MWMechanics::reduceWeaponCondition(0.f, false, weapon, ptr);
|
MWMechanics::reduceWeaponCondition(damage, false, weapon, ptr);
|
||||||
|
MWMechanics::resistNormalWeapon(victim, ptr, weapon, damage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool healthdmg;
|
bool healthdmg;
|
||||||
float damage = 0.0f;
|
|
||||||
if (!weapon.isEmpty())
|
if (!weapon.isEmpty())
|
||||||
{
|
{
|
||||||
const unsigned char* attack = nullptr;
|
const unsigned char* attack = nullptr;
|
||||||
|
@ -180,7 +180,7 @@ namespace MWMechanics
|
|||||||
void resistNormalWeapon(
|
void resistNormalWeapon(
|
||||||
const MWWorld::Ptr& actor, const MWWorld::Ptr& attacker, const MWWorld::Ptr& weapon, float& damage)
|
const MWWorld::Ptr& actor, const MWWorld::Ptr& attacker, const MWWorld::Ptr& weapon, float& damage)
|
||||||
{
|
{
|
||||||
if (damage == 0 || weapon.isEmpty() || !isNormalWeapon(weapon))
|
if (weapon.isEmpty() || !isNormalWeapon(weapon))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const MWMechanics::MagicEffects& effects = actor.getClass().getCreatureStats(actor).getMagicEffects();
|
const MWMechanics::MagicEffects& effects = actor.getClass().getCreatureStats(actor).getMagicEffects();
|
||||||
@ -189,7 +189,7 @@ namespace MWMechanics
|
|||||||
|
|
||||||
damage *= 1.f - std::min(1.f, resistance - weakness);
|
damage *= 1.f - std::min(1.f, resistance - weakness);
|
||||||
|
|
||||||
if (damage == 0 && attacker == getPlayer())
|
if (resistance - weakness >= 1.f && attacker == getPlayer())
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicTargetResistsWeapons}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicTargetResistsWeapons}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user