mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 07:21:12 +00:00
Add mWerewolfGMST
This commit is contained in:
parent
a5e1c87fb8
commit
90a3a7b62f
@ -90,22 +90,17 @@ namespace MWWorld
|
|||||||
|
|
||||||
void Player::setWerewolfStats()
|
void Player::setWerewolfStats()
|
||||||
{
|
{
|
||||||
const MWWorld::Store<ESM::GameSetting>& gmst
|
const auto& store = MWBase::Environment::get().getESMStore();
|
||||||
= MWBase::Environment::get().getESMStore()->get<ESM::GameSetting>();
|
const MWWorld::Store<ESM::GameSetting>& gmst = store->get<ESM::GameSetting>();
|
||||||
MWMechanics::CreatureStats& creatureStats = getPlayer().getClass().getCreatureStats(getPlayer());
|
MWMechanics::CreatureStats& creatureStats = getPlayer().getClass().getCreatureStats(getPlayer());
|
||||||
MWMechanics::NpcStats& npcStats = getPlayer().getClass().getNpcStats(getPlayer());
|
MWMechanics::NpcStats& npcStats = getPlayer().getClass().getNpcStats(getPlayer());
|
||||||
MWMechanics::DynamicStat<float> health = creatureStats.getDynamic(0);
|
MWMechanics::DynamicStat<float> health = creatureStats.getDynamic(0);
|
||||||
creatureStats.setHealth(health.getBase() * gmst.find("fWereWolfHealth")->mValue.getFloat());
|
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".
|
MWMechanics::AttributeValue value = npcStats.getAttribute(attribute.mId);
|
||||||
std::string name = "fWerewolf"
|
value.setModifier(gmst.find(attribute.mWerewolfGMST)->mValue.getFloat() - value.getModified());
|
||||||
+ ((i == ESM::Attribute::Intelligence) ? std::string("Intellegence")
|
npcStats.setAttribute(attribute.mId, value);
|
||||||
: ESM::Attribute::sAttributeNames[i]);
|
|
||||||
|
|
||||||
MWMechanics::AttributeValue value = npcStats.getAttribute(i);
|
|
||||||
value.setModifier(gmst.find(name)->mValue.getFloat() - value.getModified());
|
|
||||||
npcStats.setAttribute(i, value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < ESM::Skill::Length; i++)
|
for (size_t i = 0; i < ESM::Skill::Length; i++)
|
||||||
|
@ -951,35 +951,44 @@ namespace MWWorld
|
|||||||
mStatic.push_back({ .mId = ESM::Attribute::Strength,
|
mStatic.push_back({ .mId = ESM::Attribute::Strength,
|
||||||
.mName = "sAttributeStrength",
|
.mName = "sAttributeStrength",
|
||||||
.mDescription = "sStrDesc",
|
.mDescription = "sStrDesc",
|
||||||
.mIcon = "icons\\k\\attribute_strength.dds" });
|
.mIcon = "icons\\k\\attribute_strength.dds",
|
||||||
|
.mWerewolfGMST = "fWerewolfStrength" });
|
||||||
mStatic.push_back({ .mId = ESM::Attribute::Intelligence,
|
mStatic.push_back({ .mId = ESM::Attribute::Intelligence,
|
||||||
.mName = "sAttributeIntelligence",
|
.mName = "sAttributeIntelligence",
|
||||||
.mDescription = "sIntDesc",
|
.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,
|
mStatic.push_back({ .mId = ESM::Attribute::Willpower,
|
||||||
.mName = "sAttributeWillpower",
|
.mName = "sAttributeWillpower",
|
||||||
.mDescription = "sWilDesc",
|
.mDescription = "sWilDesc",
|
||||||
.mIcon = "icons\\k\\attribute_wilpower.dds" });
|
.mIcon = "icons\\k\\attribute_wilpower.dds",
|
||||||
|
.mWerewolfGMST = "fWerewolfWillpower" });
|
||||||
mStatic.push_back({ .mId = ESM::Attribute::Agility,
|
mStatic.push_back({ .mId = ESM::Attribute::Agility,
|
||||||
.mName = "sAttributeAgility",
|
.mName = "sAttributeAgility",
|
||||||
.mDescription = "sAgiDesc",
|
.mDescription = "sAgiDesc",
|
||||||
.mIcon = "icons\\k\\attribute_agility.dds" });
|
.mIcon = "icons\\k\\attribute_agility.dds",
|
||||||
|
.mWerewolfGMST = "fWerewolfAgility" });
|
||||||
mStatic.push_back({ .mId = ESM::Attribute::Speed,
|
mStatic.push_back({ .mId = ESM::Attribute::Speed,
|
||||||
.mName = "sAttributeSpeed",
|
.mName = "sAttributeSpeed",
|
||||||
.mDescription = "sSpdDesc",
|
.mDescription = "sSpdDesc",
|
||||||
.mIcon = "icons\\k\\attribute_speed.dds" });
|
.mIcon = "icons\\k\\attribute_speed.dds",
|
||||||
|
.mWerewolfGMST = "fWerewolfSpeed" });
|
||||||
mStatic.push_back({ .mId = ESM::Attribute::Endurance,
|
mStatic.push_back({ .mId = ESM::Attribute::Endurance,
|
||||||
.mName = "sAttributeEndurance",
|
.mName = "sAttributeEndurance",
|
||||||
.mDescription = "sEndDesc",
|
.mDescription = "sEndDesc",
|
||||||
.mIcon = "icons\\k\\attribute_endurance.dds" });
|
.mIcon = "icons\\k\\attribute_endurance.dds",
|
||||||
|
.mWerewolfGMST = "fWerewolfEndurance" });
|
||||||
mStatic.push_back({ .mId = ESM::Attribute::Personality,
|
mStatic.push_back({ .mId = ESM::Attribute::Personality,
|
||||||
.mName = "sAttributePersonality",
|
.mName = "sAttributePersonality",
|
||||||
.mDescription = "sPerDesc",
|
.mDescription = "sPerDesc",
|
||||||
.mIcon = "icons\\k\\attribute_personality.dds" });
|
.mIcon = "icons\\k\\attribute_personality.dds",
|
||||||
|
.mWerewolfGMST = "fWerewolfPersonality" });
|
||||||
mStatic.push_back({ .mId = ESM::Attribute::Luck,
|
mStatic.push_back({ .mId = ESM::Attribute::Luck,
|
||||||
.mName = "sAttributeLuck",
|
.mName = "sAttributeLuck",
|
||||||
.mDescription = "sLucDesc",
|
.mDescription = "sLucDesc",
|
||||||
.mIcon = "icons\\k\\attribute_luck.dds" });
|
.mIcon = "icons\\k\\attribute_luck.dds",
|
||||||
|
.mWerewolfGMST = "fWerewolfLuck" });
|
||||||
}
|
}
|
||||||
size_t Store<ESM::Attribute>::getSize() const
|
size_t Store<ESM::Attribute>::getSize() const
|
||||||
{
|
{
|
||||||
|
@ -26,7 +26,7 @@ namespace ESM
|
|||||||
};
|
};
|
||||||
|
|
||||||
AttributeID mId;
|
AttributeID mId;
|
||||||
std::string mName, mDescription, mIcon;
|
std::string mName, mDescription, mIcon, mWerewolfGMST;
|
||||||
|
|
||||||
static const std::string sAttributeNames[Length];
|
static const std::string sAttributeNames[Length];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user