mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-12 13:37:08 +03:00
Merge branch 'resistanceisnotfutile' into 'master'
Resist failed normal weapon hits (bug #7284) Closes #7284 See merge request OpenMW/openmw!3220
This commit is contained in:
commit
f9cb752b25
3 changed files with 7 additions and 5 deletions
|
@ -57,6 +57,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
|
||||||
|
|
|
@ -616,15 +616,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…
Add table
Add a link
Reference in a new issue