Hey there! So, I'm a beginner (just finished my first year of Computer Science...) and because of that I'm not too confident on the quality of my (small, probably around 13 lines) code. That and because I still haven't learned how to use git properly, I thought I'd share some small legwork I did on the forums, with adding an option to factor strength into hand-to-hand combat. I've added the option in the Advanced tab of the launcher.
By the way, do we have permission to use MCP's strength in hand-to-hand formula? (Final damage * (strength / 40))
Thought I'd ask too, since I've no idea. It might be a good idea to change it, just to be safe.
In the ui_advancedpage.h:
-
Spoiler: Show
-
Under
-
Spoiler: Show
Code: Select all
QComboBox *screenshotFormatComboBox;
Add Code: Select all
QCheckBox *strengthInfluencesHandToHand;
Under -
Spoiler: Show
Code: Select all
gameGroupVerticalLayout->addWidget(canLootDuringDeathAnimationCheckBox);
Add Code: Select all
strengthInfluencesHandToHand = new QCheckBox(gameGroup);
strengthInfluencesHandToHand->setObjectName(QStringLiteral("strengthInfluencesHandToHand"));
gameGroupVerticalLayout->addWidget(strengthInfluencesHandToHand);
Under -
Spoiler: Show
Code: Select all
canLootDuringDeathAnimationCheckBox->setText(QApplication::translate("AdvancedPage", "Can loot during death animation", 0));
Add Code: Select all
#ifndef QT_NO_TOOLTIP
strengthInfluencesHandToHand->setToolTip(QApplication::translate("AdvancedPage", "<html><head/><body><p>If this setting is true, strength will be factored into the Hand to Hand attack, as damage * (strength / 40).</p></body></html>", 0));
#endif //QT_NO_TOOLTIP
strengthInfluencesHandToHand->setText(QApplication::translate("AdvancedPage", "Strength influences Hand to Hand", 0));
Note that I'm using MCP's formula in the tooltip, but it might need to be changed.
In the advancedpage.cpp
-
Spoiler: Show
-
Under
-
Spoiler: Show
Code: Select all
loadSettingBool(rebalanceSoulGemValuesCheckBox, "rebalance soul gem values", "Game");
Add Code: Select all
loadSettingBool(strengthInfluencesHandToHand, "strength influences hand to hand", "Game");
Under -
Spoiler: Show
Code: Select all
saveSettingBool(rebalanceSoulGemValuesCheckBox, "rebalance soul gem values", "Game");
Add Code: Select all
saveSettingBool(strengthInfluencesHandToHand, "strength influences hand to hand", "Game");
In the settings-default.cfg:
-
Spoiler: Show
-
Under
-
Spoiler: Show
Add Code: Select all
# Factors the character's strength in hand-to-hand combat
strength influences hand to hand = false
In the combat.cpp of OpenMW:
-
Spoiler: Show
-
Under
-
Spoiler: Show
Code: Select all
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
float minstrike = store.get<ESM::GameSetting>().find("fMinHandToHandMult")->getFloat();
float maxstrike = store.get<ESM::GameSetting>().find("fMaxHandToHandMult")->getFloat();
damage = static_cast<float>(attacker.getClass().getSkill(attacker, ESM::Skill::HandToHand));
damage *= minstrike + ((maxstrike-minstrike)*attackStrength);
Add Code: Select all
if(Settings::Manager::getBool("strength influences hand to hand", "Game"))
damage *= attacker.getClass().getCreatureStats(attacker).getAttribute(ESM::Attribute::Strength).getModified() / 40.0;
Note that I've used the MCP formula, again. So, if permission is needed, it might be good to temporarily change it to something else.
Now, since I don't even know how to use git aside from cloning things (I'm reading about it right now), if anyone wants to go ahead and change/put these in the project it'd be fine with me. Hopefully I haven't forgotten about anything. In the end I think I just did this for the fun, with college I'm not completely sure I have the time to actually become a developer. Even so, since Morrowind was my first Elder Scrolls game I really wanted to contribute, even if just a little. Hopefully this'll help.
As a first time doing this I'm honestly scared of doing more bad than good by making a whole thread about this.