From baaf65bc2cfb9f76f460d8c3aa62711d37e372a0 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 31 Mar 2018 02:38:36 +0300 Subject: [PATCH] Add vanilla enchanted weaponry behavior option, on by default (fixes #4136) --- apps/openmw/mwmechanics/combat.cpp | 7 ++++++- docs/source/reference/modding/settings/game.rst | 12 ++++++++++++ files/settings-default.cfg | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index 13cd4232d..ac34c658b 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -1,6 +1,7 @@ #include "combat.hpp" #include +#include #include @@ -155,7 +156,11 @@ namespace MWMechanics if (!(weapon.get()->mBase->mData.mFlags & ESM::Weapon::Silver || weapon.get()->mBase->mData.mFlags & ESM::Weapon::Magical)) - damage *= multiplier; + { + if (weapon.getClass().getEnchantment(weapon).empty() + || !Settings::Manager::getBool("enchanted weapons are magical", "Game")) + damage *= multiplier; + } if ((weapon.get()->mBase->mData.mFlags & ESM::Weapon::Silver) && actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) diff --git a/docs/source/reference/modding/settings/game.rst b/docs/source/reference/modding/settings/game.rst index e1d5d75f6..e0ac4b6da 100644 --- a/docs/source/reference/modding/settings/game.rst +++ b/docs/source/reference/modding/settings/game.rst @@ -109,6 +109,18 @@ The remaining duration is displayed in the tooltip by hovering over the magical The default value is false. This setting can only be configured by editing the settings configuration file. +enchanted weapons are magical +----------------------------- + +:Type: boolean +:Range: True/False +:Default: True + +Makes enchanted weapons without Magical flag bypass normal weapons resistance (and weakness) certain creatures have. +This is how original Morrowind behaves. + +This setting can only be configured by editing the settings configuration file. + prevent merchant equipping -------------------------- diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 8a28c42e4..8386f22c1 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -179,6 +179,9 @@ show effect duration = false # Prevents merchants from equipping items that are sold to them. prevent merchant equipping = false +# Make enchanted weaponry without Magical flag bypass normal weapons resistance +enchanted weapons are magical = true + # Makes player followers and escorters start combat with enemies who have started combat with them # or the player. Otherwise they wait for the enemies or the player to do an attack first. followers attack on sight = false