mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-01 06:39:43 +00:00
Add ESM::Skill::mWerewolfValue
This commit is contained in:
parent
7b0680de5f
commit
08f35fe839
4 changed files with 43 additions and 42 deletions
|
@ -1924,11 +1924,11 @@ namespace MWMechanics
|
|||
|
||||
void MechanicsManager::applyWerewolfAcrobatics(const MWWorld::Ptr& actor)
|
||||
{
|
||||
const MWWorld::Store<ESM::GameSetting>& gmst
|
||||
= MWBase::Environment::get().getESMStore()->get<ESM::GameSetting>();
|
||||
const ESM::Skill* acrobatics
|
||||
= MWBase::Environment::get().getESMStore()->get<ESM::Skill>().find(ESM::Skill::Acrobatics);
|
||||
MWMechanics::NpcStats& stats = actor.getClass().getNpcStats(actor);
|
||||
auto& skill = stats.getSkill(ESM::Skill::Acrobatics);
|
||||
skill.setModifier(gmst.find("fWerewolfAcrobatics")->mValue.getFloat() - skill.getModified());
|
||||
auto& skill = stats.getSkill(acrobatics->mIndex);
|
||||
skill.setModifier(acrobatics->mWerewolfValue - skill.getModified());
|
||||
}
|
||||
|
||||
void MechanicsManager::cleanupSummonedCreature(const MWWorld::Ptr& caster, int creatureActorId)
|
||||
|
|
|
@ -103,18 +103,14 @@ namespace MWWorld
|
|||
npcStats.setAttribute(attribute.mId, value);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < ESM::Skill::Length; i++)
|
||||
for (const auto& [_, skill] : store->get<ESM::Skill>())
|
||||
{
|
||||
// Acrobatics is set separately for some reason.
|
||||
if (i == ESM::Skill::Acrobatics)
|
||||
if (skill.mIndex == ESM::Skill::Acrobatics)
|
||||
continue;
|
||||
|
||||
// "Mercantile"! >_<
|
||||
std::string name = "fWerewolf"
|
||||
+ ((i == ESM::Skill::Mercantile) ? std::string("Merchantile") : ESM::Skill::sSkillNames[i]);
|
||||
|
||||
MWMechanics::SkillValue& value = npcStats.getSkill(i);
|
||||
value.setModifier(gmst.find(name)->mValue.getFloat() - value.getModified());
|
||||
MWMechanics::SkillValue& value = npcStats.getSkill(skill.mIndex);
|
||||
value.setModifier(skill.mWerewolfValue - value.getModified());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -919,34 +919,35 @@ namespace MWWorld
|
|||
|
||||
void Store<ESM::Skill>::setUp(const MWWorld::Store<ESM::GameSetting>& settings)
|
||||
{
|
||||
constexpr std::string_view skillNameIdsAndIcons[ESM::Skill::Length][2] = {
|
||||
{ "sSkillBlock", "icons\\k\\combat_block.dds" },
|
||||
{ "sSkillArmorer", "icons\\k\\combat_armor.dds" },
|
||||
{ "sSkillMediumarmor", "icons\\k\\combat_mediumarmor.dds" },
|
||||
{ "sSkillHeavyarmor", "icons\\k\\combat_heavyarmor.dds" },
|
||||
{ "sSkillBluntweapon", "icons\\k\\combat_blunt.dds" },
|
||||
{ "sSkillLongblade", "icons\\k\\combat_longblade.dds" },
|
||||
{ "sSkillAxe", "icons\\k\\combat_axe.dds" },
|
||||
{ "sSkillSpear", "icons\\k\\combat_spear.dds" },
|
||||
{ "sSkillAthletics", "icons\\k\\combat_athletics.dds" },
|
||||
{ "sSkillEnchant", "icons\\k\\magic_enchant.dds" },
|
||||
{ "sSkillDestruction", "icons\\k\\magic_destruction.dds" },
|
||||
{ "sSkillAlteration", "icons\\k\\magic_alteration.dds" },
|
||||
{ "sSkillIllusion", "icons\\k\\magic_illusion.dds" },
|
||||
{ "sSkillConjuration", "icons\\k\\magic_conjuration.dds" },
|
||||
{ "sSkillMysticism", "icons\\k\\magic_mysticism.dds" },
|
||||
{ "sSkillRestoration", "icons\\k\\magic_restoration.dds" },
|
||||
{ "sSkillAlchemy", "icons\\k\\magic_alchemy.dds" },
|
||||
{ "sSkillUnarmored", "icons\\k\\magic_unarmored.dds" },
|
||||
{ "sSkillSecurity", "icons\\k\\stealth_security.dds" },
|
||||
{ "sSkillSneak", "icons\\k\\stealth_sneak.dds" },
|
||||
{ "sSkillAcrobatics", "icons\\k\\stealth_acrobatics.dds" },
|
||||
{ "sSkillLightarmor", "icons\\k\\stealth_lightarmor.dds" },
|
||||
{ "sSkillShortblade", "icons\\k\\stealth_shortblade.dds" },
|
||||
{ "sSkillMarksman", "icons\\k\\stealth_marksman.dds" },
|
||||
{ "sSkillMercantile", "icons\\k\\stealth_mercantile.dds" },
|
||||
{ "sSkillSpeechcraft", "icons\\k\\stealth_speechcraft.dds" },
|
||||
{ "sSkillHandtohand", "icons\\k\\stealth_handtohand.dds" },
|
||||
constexpr std::string_view skillValues[ESM::Skill::Length][3] = {
|
||||
{ "sSkillBlock", "icons\\k\\combat_block.dds", "fWerewolfBlock" },
|
||||
{ "sSkillArmorer", "icons\\k\\combat_armor.dds", "fWerewolfArmorer" },
|
||||
{ "sSkillMediumarmor", "icons\\k\\combat_mediumarmor.dds", "fWerewolfMediumarmor" },
|
||||
{ "sSkillHeavyarmor", "icons\\k\\combat_heavyarmor.dds", "fWerewolfHeavyarmor" },
|
||||
{ "sSkillBluntweapon", "icons\\k\\combat_blunt.dds", "fWerewolfBluntweapon" },
|
||||
{ "sSkillLongblade", "icons\\k\\combat_longblade.dds", "fWerewolfLongblade" },
|
||||
{ "sSkillAxe", "icons\\k\\combat_axe.dds", "fWerewolfAxe" },
|
||||
{ "sSkillSpear", "icons\\k\\combat_spear.dds", "fWerewolfSpear" },
|
||||
{ "sSkillAthletics", "icons\\k\\combat_athletics.dds", "fWerewolfAthletics" },
|
||||
{ "sSkillEnchant", "icons\\k\\magic_enchant.dds", "fWerewolfEnchant" },
|
||||
{ "sSkillDestruction", "icons\\k\\magic_destruction.dds", "fWerewolfDestruction" },
|
||||
{ "sSkillAlteration", "icons\\k\\magic_alteration.dds", "fWerewolfAlteration" },
|
||||
{ "sSkillIllusion", "icons\\k\\magic_illusion.dds", "fWerewolfIllusion" },
|
||||
{ "sSkillConjuration", "icons\\k\\magic_conjuration.dds", "fWerewolfConjuration" },
|
||||
{ "sSkillMysticism", "icons\\k\\magic_mysticism.dds", "fWerewolfMysticism" },
|
||||
{ "sSkillRestoration", "icons\\k\\magic_restoration.dds", "fWerewolfRestoration" },
|
||||
{ "sSkillAlchemy", "icons\\k\\magic_alchemy.dds", "fWerewolfAlchemy" },
|
||||
{ "sSkillUnarmored", "icons\\k\\magic_unarmored.dds", "fWerewolfUnarmored" },
|
||||
{ "sSkillSecurity", "icons\\k\\stealth_security.dds", "fWerewolfSecurity" },
|
||||
{ "sSkillSneak", "icons\\k\\stealth_sneak.dds", "fWerewolfSneak" },
|
||||
{ "sSkillAcrobatics", "icons\\k\\stealth_acrobatics.dds", "fWerewolfAcrobatics" },
|
||||
{ "sSkillLightarmor", "icons\\k\\stealth_lightarmor.dds", "fWerewolfLightarmor" },
|
||||
{ "sSkillShortblade", "icons\\k\\stealth_shortblade.dds", "fWerewolfShortblade" },
|
||||
{ "sSkillMarksman", "icons\\k\\stealth_marksman.dds", "fWerewolfMarksman" },
|
||||
// "Mercantile"! >_<
|
||||
{ "sSkillMercantile", "icons\\k\\stealth_mercantile.dds", "fWerewolfMerchantile" },
|
||||
{ "sSkillSpeechcraft", "icons\\k\\stealth_speechcraft.dds", "fWerewolfSpeechcraft" },
|
||||
{ "sSkillHandtohand", "icons\\k\\stealth_handtohand.dds", "fWerewolfHandtohand" },
|
||||
};
|
||||
for (int i = 0; i < ESM::Skill::Length; ++i)
|
||||
{
|
||||
|
@ -954,8 +955,9 @@ namespace MWWorld
|
|||
if (found != mStatic.end())
|
||||
{
|
||||
ESM::Skill& skill = found->second;
|
||||
skill.mName = getGMSTString(settings, skillNameIdsAndIcons[i][0]);
|
||||
skill.mIcon = skillNameIdsAndIcons[i][1];
|
||||
skill.mName = getGMSTString(settings, skillValues[i][0]);
|
||||
skill.mIcon = skillValues[i][1];
|
||||
skill.mWerewolfValue = getGMSTFloat(settings, skillValues[i][2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1010,6 +1012,8 @@ namespace MWWorld
|
|||
}
|
||||
void Store<ESM::Attribute>::setUp(const MWWorld::Store<ESM::GameSetting>& settings)
|
||||
{
|
||||
// TODO remove after !3084 gets merged
|
||||
mStatic.clear();
|
||||
mStatic.push_back({ .mId = ESM::Attribute::Strength,
|
||||
.mName = std::string{ getGMSTString(settings, "sAttributeStrength") },
|
||||
.mDescription = std::string{ getGMSTString(settings, "sStrDesc") },
|
||||
|
|
|
@ -46,6 +46,7 @@ namespace ESM
|
|||
std::string mDescription;
|
||||
std::string mName;
|
||||
std::string mIcon;
|
||||
float mWerewolfValue{};
|
||||
|
||||
enum SkillEnum
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue