From d19cbdb652dd135230714f6b1cb6dd94af678260 Mon Sep 17 00:00:00 2001 From: Yohaulticetl Date: Fri, 27 Jul 2018 21:13:04 -0300 Subject: [PATCH] Factored strength into hand-to-hand combat --- apps/launcher/advancedpage.cpp | 2 ++ apps/openmw/mwmechanics/combat.cpp | 6 +++--- files/settings-default.cfg | 3 +++ files/ui/advancedpage.ui | 6 ++++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp index ff229e02d9..5406201b96 100644 --- a/apps/launcher/advancedpage.cpp +++ b/apps/launcher/advancedpage.cpp @@ -76,6 +76,7 @@ bool Launcher::AdvancedPage::loadSettings() loadSettingBool(chargeForEveryFollowerCheckBox, "charge for every follower travelling", "Game"); loadSettingBool(enchantedWeaponsMagicalCheckBox, "enchanted weapons are magical", "Game"); loadSettingBool(permanentBarterDispositionChangeCheckBox, "barter disposition change is permanent", "Game"); + loadSettingBool(strengthInfluencesHandToHand, "strength influences hand to hand", "Game"); // Input Settings loadSettingBool(allowThirdPersonZoomCheckBox, "allow third person zoom", "Input"); @@ -131,6 +132,7 @@ void Launcher::AdvancedPage::saveSettings() saveSettingBool(chargeForEveryFollowerCheckBox, "charge for every follower travelling", "Game"); saveSettingBool(enchantedWeaponsMagicalCheckBox, "enchanted weapons are magical", "Game"); saveSettingBool(permanentBarterDispositionChangeCheckBox, "barter disposition change is permanent", "Game"); + saveSettingBool(strengthInfluencesHandToHand, "strength influences hand to hand", "Game"); // Input Settings saveSettingBool(allowThirdPersonZoomCheckBox, "allow third person zoom", "Input"); diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index 5910dbacd0..51e7eefddd 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -388,14 +388,14 @@ namespace MWMechanics void getHandToHandDamage(const MWWorld::Ptr &attacker, const MWWorld::Ptr &victim, float &damage, bool &healthdmg, float attackStrength) { - // Note: MCP contains an option to include Strength in hand-to-hand damage - // calculations. Some mods recommend using it, so we may want to include an - // option for it. const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); float minstrike = store.get().find("fMinHandToHandMult")->getFloat(); float maxstrike = store.get().find("fMaxHandToHandMult")->getFloat(); damage = static_cast(attacker.getClass().getSkill(attacker, ESM::Skill::HandToHand)); damage *= minstrike + ((maxstrike-minstrike)*attackStrength); + if (Settings::Manager::getBool("strength influences hand to hand", "Game")){ + damage *= attacker.getClass().getCreatureStats(attacker).getAttribute(ESM::Attribute::Strength).getModified() / 40.0f; + } MWMechanics::CreatureStats& otherstats = victim.getClass().getCreatureStats(victim); healthdmg = otherstats.isParalyzed() diff --git a/files/settings-default.cfg b/files/settings-default.cfg index b0ddd52239..d974d8b68f 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -225,6 +225,9 @@ use additional anim sources = false # Make the disposition change of merchants caused by barter dealings permanent barter disposition change is permanent = false +# Factors Strength into hand-to-hand combat. Uses the MCP formula (damage * (strength / 40)). +strength influences hand to hand = 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 553c244d38..811bc5f868 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -99,6 +99,12 @@ Barter disposition change is permanent + + + <html><head/><body><p>Uses the MCP formula (damage * (strength / 40)) to factor the Strength attribute into hand-to-hand combat.</p><p>The default value is false.</p></body></html> + + + Factor strength into hand-to-hand combat