|
|
|
@ -31,6 +31,22 @@ namespace
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string_view getGMSTString(const MWWorld::Store<ESM::GameSetting>& settings, std::string_view id)
|
|
|
|
|
{
|
|
|
|
|
const ESM::GameSetting* setting = settings.search(id);
|
|
|
|
|
if (setting && setting->mValue.getType() == ESM::VT_String)
|
|
|
|
|
return setting->mValue.getString();
|
|
|
|
|
return id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float getGMSTFloat(const MWWorld::Store<ESM::GameSetting>& settings, std::string_view id)
|
|
|
|
|
{
|
|
|
|
|
const ESM::GameSetting* setting = settings.search(id);
|
|
|
|
|
if (setting && (setting->mValue.getType() == ESM::VT_Float || setting->mValue.getType() == ESM::VT_Int))
|
|
|
|
|
return setting->mValue.getFloat();
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
@ -901,36 +917,37 @@ namespace MWWorld
|
|
|
|
|
|
|
|
|
|
Store<ESM::Skill>::Store() {}
|
|
|
|
|
|
|
|
|
|
void Store<ESM::Skill>::setUp(const MWWorld::Store<ESM::GameSetting> settings)
|
|
|
|
|
{
|
|
|
|
|
constexpr std::string_view skillNameIds[ESM::Skill::Length] = {
|
|
|
|
|
"sSkillBlock",
|
|
|
|
|
"sSkillArmorer",
|
|
|
|
|
"sSkillMediumarmor",
|
|
|
|
|
"sSkillHeavyarmor",
|
|
|
|
|
"sSkillBluntweapon",
|
|
|
|
|
"sSkillLongblade",
|
|
|
|
|
"sSkillAxe",
|
|
|
|
|
"sSkillSpear",
|
|
|
|
|
"sSkillAthletics",
|
|
|
|
|
"sSkillEnchant",
|
|
|
|
|
"sSkillDestruction",
|
|
|
|
|
"sSkillAlteration",
|
|
|
|
|
"sSkillIllusion",
|
|
|
|
|
"sSkillConjuration",
|
|
|
|
|
"sSkillMysticism",
|
|
|
|
|
"sSkillRestoration",
|
|
|
|
|
"sSkillAlchemy",
|
|
|
|
|
"sSkillUnarmored",
|
|
|
|
|
"sSkillSecurity",
|
|
|
|
|
"sSkillSneak",
|
|
|
|
|
"sSkillAcrobatics",
|
|
|
|
|
"sSkillLightarmor",
|
|
|
|
|
"sSkillShortblade",
|
|
|
|
|
"sSkillMarksman",
|
|
|
|
|
"sSkillMercantile",
|
|
|
|
|
"sSkillSpeechcraft",
|
|
|
|
|
"sSkillHandtohand",
|
|
|
|
|
void Store<ESM::Skill>::setUp(const MWWorld::Store<ESM::GameSetting>& settings)
|
|
|
|
|
{
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
@ -938,12 +955,9 @@ namespace MWWorld
|
|
|
|
|
if (found != mStatic.end())
|
|
|
|
|
{
|
|
|
|
|
ESM::Skill& skill = found->second;
|
|
|
|
|
std::string_view id = skillNameIds[i];
|
|
|
|
|
const ESM::GameSetting* setting = settings.search(id);
|
|
|
|
|
if (setting && setting->mValue.getType() == ESM::VT_String)
|
|
|
|
|
skill.mName = setting->mValue.getString();
|
|
|
|
|
else
|
|
|
|
|
skill.mName = id;
|
|
|
|
|
skill.mName = getGMSTString(settings, skillValues[i][0]);
|
|
|
|
|
skill.mIcon = skillValues[i][1];
|
|
|
|
|
skill.mWerewolfValue = getGMSTFloat(settings, skillValues[i][2]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -996,49 +1010,51 @@ namespace MWWorld
|
|
|
|
|
}
|
|
|
|
|
return ptr;
|
|
|
|
|
}
|
|
|
|
|
void Store<ESM::Attribute>::setUp()
|
|
|
|
|
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 = "sAttributeStrength",
|
|
|
|
|
.mDescription = "sStrDesc",
|
|
|
|
|
.mName = std::string{ getGMSTString(settings, "sAttributeStrength") },
|
|
|
|
|
.mDescription = std::string{ getGMSTString(settings, "sStrDesc") },
|
|
|
|
|
.mIcon = "icons\\k\\attribute_strength.dds",
|
|
|
|
|
.mWerewolfGMST = "fWerewolfStrength" });
|
|
|
|
|
.mWerewolfValue = getGMSTFloat(settings, "fWerewolfStrength") });
|
|
|
|
|
mStatic.push_back({ .mId = ESM::Attribute::Intelligence,
|
|
|
|
|
.mName = "sAttributeIntelligence",
|
|
|
|
|
.mDescription = "sIntDesc",
|
|
|
|
|
.mName = std::string{ getGMSTString(settings, "sAttributeIntelligence") },
|
|
|
|
|
.mDescription = std::string{ getGMSTString(settings, "sIntDesc") },
|
|
|
|
|
.mIcon = "icons\\k\\attribute_int.dds",
|
|
|
|
|
// Oh, Bethesda. It's "Intelligence".
|
|
|
|
|
.mWerewolfGMST = "fWerewolfIntellegence" });
|
|
|
|
|
.mWerewolfValue = getGMSTFloat(settings, "fWerewolfIntellegence") });
|
|
|
|
|
mStatic.push_back({ .mId = ESM::Attribute::Willpower,
|
|
|
|
|
.mName = "sAttributeWillpower",
|
|
|
|
|
.mDescription = "sWilDesc",
|
|
|
|
|
.mName = std::string{ getGMSTString(settings, "sAttributeWillpower") },
|
|
|
|
|
.mDescription = std::string{ getGMSTString(settings, "sWilDesc") },
|
|
|
|
|
.mIcon = "icons\\k\\attribute_wilpower.dds",
|
|
|
|
|
.mWerewolfGMST = "fWerewolfWillpower" });
|
|
|
|
|
.mWerewolfValue = getGMSTFloat(settings, "fWerewolfWillpower") });
|
|
|
|
|
mStatic.push_back({ .mId = ESM::Attribute::Agility,
|
|
|
|
|
.mName = "sAttributeAgility",
|
|
|
|
|
.mDescription = "sAgiDesc",
|
|
|
|
|
.mName = std::string{ getGMSTString(settings, "sAttributeAgility") },
|
|
|
|
|
.mDescription = std::string{ getGMSTString(settings, "sAgiDesc") },
|
|
|
|
|
.mIcon = "icons\\k\\attribute_agility.dds",
|
|
|
|
|
.mWerewolfGMST = "fWerewolfAgility" });
|
|
|
|
|
.mWerewolfValue = getGMSTFloat(settings, "fWerewolfAgility") });
|
|
|
|
|
mStatic.push_back({ .mId = ESM::Attribute::Speed,
|
|
|
|
|
.mName = "sAttributeSpeed",
|
|
|
|
|
.mDescription = "sSpdDesc",
|
|
|
|
|
.mName = std::string{ getGMSTString(settings, "sAttributeSpeed") },
|
|
|
|
|
.mDescription = std::string{ getGMSTString(settings, "sSpdDesc") },
|
|
|
|
|
.mIcon = "icons\\k\\attribute_speed.dds",
|
|
|
|
|
.mWerewolfGMST = "fWerewolfSpeed" });
|
|
|
|
|
.mWerewolfValue = getGMSTFloat(settings, "fWerewolfSpeed") });
|
|
|
|
|
mStatic.push_back({ .mId = ESM::Attribute::Endurance,
|
|
|
|
|
.mName = "sAttributeEndurance",
|
|
|
|
|
.mDescription = "sEndDesc",
|
|
|
|
|
.mName = std::string{ getGMSTString(settings, "sAttributeEndurance") },
|
|
|
|
|
.mDescription = std::string{ getGMSTString(settings, "sEndDesc") },
|
|
|
|
|
.mIcon = "icons\\k\\attribute_endurance.dds",
|
|
|
|
|
.mWerewolfGMST = "fWerewolfEndurance" });
|
|
|
|
|
.mWerewolfValue = getGMSTFloat(settings, "fWerewolfEndurance") });
|
|
|
|
|
mStatic.push_back({ .mId = ESM::Attribute::Personality,
|
|
|
|
|
.mName = "sAttributePersonality",
|
|
|
|
|
.mDescription = "sPerDesc",
|
|
|
|
|
.mName = std::string{ getGMSTString(settings, "sAttributePersonality") },
|
|
|
|
|
.mDescription = std::string{ getGMSTString(settings, "sPerDesc") },
|
|
|
|
|
.mIcon = "icons\\k\\attribute_personality.dds",
|
|
|
|
|
.mWerewolfGMST = "fWerewolfPersonality" });
|
|
|
|
|
.mWerewolfValue = getGMSTFloat(settings, "fWerewolfPersonality") });
|
|
|
|
|
mStatic.push_back({ .mId = ESM::Attribute::Luck,
|
|
|
|
|
.mName = "sAttributeLuck",
|
|
|
|
|
.mDescription = "sLucDesc",
|
|
|
|
|
.mName = std::string{ getGMSTString(settings, "sAttributeLuck") },
|
|
|
|
|
.mDescription = std::string{ getGMSTString(settings, "sLucDesc") },
|
|
|
|
|
.mIcon = "icons\\k\\attribute_luck.dds",
|
|
|
|
|
.mWerewolfGMST = "fWerewolfLuck" });
|
|
|
|
|
.mWerewolfValue = getGMSTFloat(settings, "fWerewolfLuck") });
|
|
|
|
|
}
|
|
|
|
|
size_t Store<ESM::Attribute>::getSize() const
|
|
|
|
|
{
|
|
|
|
|