diff --git a/CHANGELOG.md b/CHANGELOG.md index 00d526a335..185fae9336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -189,6 +189,7 @@ Feature #6706: Save the size of the Options window Feature #6721: [OpenMW-CS] Add option to open records in new window Feature #6867: Add a way to localize hardcoded strings in GUI + Feature #6888: Add switch for armor degradation fix. Task #6078: First person should not clear depth buffer Task #6161: Refactor Sky to use shaders and be GLES/GL3 friendly Task #6162: Refactor GUI to use shaders and to be GLES and GL3+ friendly diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp index 9f1c0c6a03..c4e438edae 100644 --- a/apps/launcher/advancedpage.cpp +++ b/apps/launcher/advancedpage.cpp @@ -108,6 +108,7 @@ bool Launcher::AdvancedPage::loadSettings() if (numPhysicsThreads >= 0) physicsThreadsSpinBox->setValue(numPhysicsThreads); loadSettingBool(allowNPCToFollowOverWaterSurfaceCheckBox, "allow actors to follow over water surface", "Game"); + loadSettingBool(unarmedCreatureAttacksDamageArmorCheckBox, "unarmed creature attacks damage armor", "Game"); } // Visuals @@ -262,6 +263,7 @@ void Launcher::AdvancedPage::saveSettings() saveSettingBool(enableNavigatorCheckBox, "enable", "Navigator"); saveSettingInt(physicsThreadsSpinBox, "async num threads", "Physics"); saveSettingBool(allowNPCToFollowOverWaterSurfaceCheckBox, "allow actors to follow over water surface", "Game"); + saveSettingBool(unarmedCreatureAttacksDamageArmorCheckBox, "unarmed creature attacks damage armor", "Game"); } // Visuals diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 2c98b4dd3c..2969c605ff 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -805,7 +805,12 @@ namespace MWClass } if (hasArmor) { - if (!object.isEmpty() || attacker.isEmpty() || attacker.getClass().isNpc()) // Unarmed creature attacks don't affect armor condition + static const bool creatureDamage = Settings::Manager::getBool("unarmed creature attacks damage armor", "Game"); + + if (!object.isEmpty() || + attacker.isEmpty() || + attacker.getClass().isNpc() || + creatureDamage) // Unarmed creature attacks don't affect armor condition unless it was explicitly requested. { int armorhealth = armor.getClass().getItemHealth(armor); armorhealth -= std::min(damageDiff, armorhealth); diff --git a/docs/source/reference/modding/settings/game.rst b/docs/source/reference/modding/settings/game.rst index f407c6a126..2f8cbbf91d 100644 --- a/docs/source/reference/modding/settings/game.rst +++ b/docs/source/reference/modding/settings/game.rst @@ -474,3 +474,16 @@ day night switches :Default: True Some mods add models which change visuals based on time of day. When this setting is enabled, supporting models will automatically make use of Day/night state. + +unarmed creature attacks damage armor +----------------------------------------- + +:Type: boolean +:Range: True/False +:Default: False + +If disabled unarmed creature attacks do not reduce armor condition, just as with vanilla engine. + +If enabled unarmed creature attacks reduce armor condition, the same as attacks from NPCs and armed creatures. + +This setting can be controlled in Advanced tab of the launcher, under Game Mechanics. diff --git a/files/settings-default.cfg b/files/settings-default.cfg index d7cdde2022..27a1063279 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -360,6 +360,9 @@ default actor pathfind half extents = 29.27999496459961 28.479997634887695 66.5 # Enables use of day/night switch nodes day night switches = true +# Enables degradation of NPC's armor from unarmed creature attacks. +unarmed creature attacks damage armor = false + [General] # Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16). diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui index 3fdf80e52f..42dfbb2bfa 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -175,6 +175,16 @@ + + + + <html><head/><body><p>Makes unarmed creature attacks able to reduce armor condition, just as attacks from NPCs and armed creatures.</p></body></html> + + + Unarmed creature attacks damage armor + + +