Add mWerewolfGMST

macos_ci
Evil Eye 2 years ago
parent a5e1c87fb8
commit 90a3a7b62f

@ -90,22 +90,17 @@ namespace MWWorld
void Player::setWerewolfStats()
{
const MWWorld::Store<ESM::GameSetting>& gmst
= MWBase::Environment::get().getESMStore()->get<ESM::GameSetting>();
const auto& store = MWBase::Environment::get().getESMStore();
const MWWorld::Store<ESM::GameSetting>& gmst = store->get<ESM::GameSetting>();
MWMechanics::CreatureStats& creatureStats = getPlayer().getClass().getCreatureStats(getPlayer());
MWMechanics::NpcStats& npcStats = getPlayer().getClass().getNpcStats(getPlayer());
MWMechanics::DynamicStat<float> health = creatureStats.getDynamic(0);
creatureStats.setHealth(health.getBase() * gmst.find("fWereWolfHealth")->mValue.getFloat());
for (size_t i = 0; i < ESM::Attribute::Length; ++i)
for (const auto& attribute : store->get<ESM::Attribute>())
{
// Oh, Bethesda. It's "Intelligence".
std::string name = "fWerewolf"
+ ((i == ESM::Attribute::Intelligence) ? std::string("Intellegence")
: ESM::Attribute::sAttributeNames[i]);
MWMechanics::AttributeValue value = npcStats.getAttribute(i);
value.setModifier(gmst.find(name)->mValue.getFloat() - value.getModified());
npcStats.setAttribute(i, value);
MWMechanics::AttributeValue value = npcStats.getAttribute(attribute.mId);
value.setModifier(gmst.find(attribute.mWerewolfGMST)->mValue.getFloat() - value.getModified());
npcStats.setAttribute(attribute.mId, value);
}
for (size_t i = 0; i < ESM::Skill::Length; i++)

@ -951,35 +951,44 @@ namespace MWWorld
mStatic.push_back({ .mId = ESM::Attribute::Strength,
.mName = "sAttributeStrength",
.mDescription = "sStrDesc",
.mIcon = "icons\\k\\attribute_strength.dds" });
.mIcon = "icons\\k\\attribute_strength.dds",
.mWerewolfGMST = "fWerewolfStrength" });
mStatic.push_back({ .mId = ESM::Attribute::Intelligence,
.mName = "sAttributeIntelligence",
.mDescription = "sIntDesc",
.mIcon = "icons\\k\\attribute_int.dds" });
.mIcon = "icons\\k\\attribute_int.dds",
// Oh, Bethesda. It's "Intelligence".
.mWerewolfGMST = "fWerewolfIntellegence" });
mStatic.push_back({ .mId = ESM::Attribute::Willpower,
.mName = "sAttributeWillpower",
.mDescription = "sWilDesc",
.mIcon = "icons\\k\\attribute_wilpower.dds" });
.mIcon = "icons\\k\\attribute_wilpower.dds",
.mWerewolfGMST = "fWerewolfWillpower" });
mStatic.push_back({ .mId = ESM::Attribute::Agility,
.mName = "sAttributeAgility",
.mDescription = "sAgiDesc",
.mIcon = "icons\\k\\attribute_agility.dds" });
.mIcon = "icons\\k\\attribute_agility.dds",
.mWerewolfGMST = "fWerewolfAgility" });
mStatic.push_back({ .mId = ESM::Attribute::Speed,
.mName = "sAttributeSpeed",
.mDescription = "sSpdDesc",
.mIcon = "icons\\k\\attribute_speed.dds" });
.mIcon = "icons\\k\\attribute_speed.dds",
.mWerewolfGMST = "fWerewolfSpeed" });
mStatic.push_back({ .mId = ESM::Attribute::Endurance,
.mName = "sAttributeEndurance",
.mDescription = "sEndDesc",
.mIcon = "icons\\k\\attribute_endurance.dds" });
.mIcon = "icons\\k\\attribute_endurance.dds",
.mWerewolfGMST = "fWerewolfEndurance" });
mStatic.push_back({ .mId = ESM::Attribute::Personality,
.mName = "sAttributePersonality",
.mDescription = "sPerDesc",
.mIcon = "icons\\k\\attribute_personality.dds" });
.mIcon = "icons\\k\\attribute_personality.dds",
.mWerewolfGMST = "fWerewolfPersonality" });
mStatic.push_back({ .mId = ESM::Attribute::Luck,
.mName = "sAttributeLuck",
.mDescription = "sLucDesc",
.mIcon = "icons\\k\\attribute_luck.dds" });
.mIcon = "icons\\k\\attribute_luck.dds",
.mWerewolfGMST = "fWerewolfLuck" });
}
size_t Store<ESM::Attribute>::getSize() const
{

@ -26,7 +26,7 @@ namespace ESM
};
AttributeID mId;
std::string mName, mDescription, mIcon;
std::string mName, mDescription, mIcon, mWerewolfGMST;
static const std::string sAttributeNames[Length];

Loading…
Cancel
Save