Remove deprecated GMST get* functions

pull/1902/head
Capostrophic 6 years ago
parent c280a71b33
commit 7ef6fa9f61

@ -142,14 +142,14 @@ namespace MWClass
const MWWorld::Store<ESM::GameSetting> &gmst = const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
float iWeight = floor(gmst.find(typeGmst)->getFloat()); float iWeight = floor(gmst.find(typeGmst)->mValue.getFloat());
float epsilon = 0.0005f; float epsilon = 0.0005f;
if (ref->mBase->mData.mWeight <= iWeight * gmst.find ("fLightMaxMod")->getFloat() + epsilon) if (ref->mBase->mData.mWeight <= iWeight * gmst.find ("fLightMaxMod")->mValue.getFloat() + epsilon)
return ESM::Skill::LightArmor; return ESM::Skill::LightArmor;
if (ref->mBase->mData.mWeight <= iWeight * gmst.find ("fMedMaxMod")->getFloat() + epsilon) if (ref->mBase->mData.mWeight <= iWeight * gmst.find ("fMedMaxMod")->mValue.getFloat() + epsilon)
return ESM::Skill::MediumArmor; return ESM::Skill::MediumArmor;
else else
@ -285,7 +285,7 @@ namespace MWClass
int armorSkill = actor.getClass().getSkill(actor, armorSkillType); int armorSkill = actor.getClass().getSkill(actor, armorSkillType);
const MWBase::World *world = MWBase::Environment::get().getWorld(); const MWBase::World *world = MWBase::Environment::get().getWorld();
int iBaseArmorSkill = world->getStore().get<ESM::GameSetting>().find("iBaseArmorSkill")->getInt(); int iBaseArmorSkill = world->getStore().get<ESM::GameSetting>().find("iBaseArmorSkill")->mValue.getInteger();
if(ref->mBase->mData.mWeight == 0) if(ref->mBase->mData.mWeight == 0)
return ref->mBase->mData.mArmor; return ref->mBase->mData.mArmor;

@ -247,7 +247,7 @@ namespace MWClass
MWMechanics::applyFatigueLoss(ptr, weapon, attackStrength); MWMechanics::applyFatigueLoss(ptr, weapon, attackStrength);
float dist = gmst.find("fCombatDistance")->getFloat(); float dist = gmst.find("fCombatDistance")->mValue.getFloat();
if (!weapon.isEmpty()) if (!weapon.isEmpty())
dist *= weapon.get<ESM::Weapon>()->mBase->mData.mReach; dist *= weapon.get<ESM::Weapon>()->mBase->mData.mReach;
@ -394,9 +394,9 @@ namespace MWClass
if (!attacker.isEmpty()) if (!attacker.isEmpty())
{ {
// Check for knockdown // Check for knockdown
float agilityTerm = stats.getAttribute(ESM::Attribute::Agility).getModified() * getGmst().fKnockDownMult->getFloat(); float agilityTerm = stats.getAttribute(ESM::Attribute::Agility).getModified() * getGmst().fKnockDownMult->mValue.getFloat();
float knockdownTerm = stats.getAttribute(ESM::Attribute::Agility).getModified() float knockdownTerm = stats.getAttribute(ESM::Attribute::Agility).getModified()
* getGmst().iKnockDownOddsMult->getInt() * 0.01f + getGmst().iKnockDownOddsBase->getInt(); * getGmst().iKnockDownOddsMult->mValue.getInteger() * 0.01f + getGmst().iKnockDownOddsBase->mValue.getInteger();
if (ishealth && agilityTerm <= damage && knockdownTerm <= Misc::Rng::roll0to99()) if (ishealth && agilityTerm <= damage && knockdownTerm <= Misc::Rng::roll0to99())
stats.setKnockedDown(true); stats.setKnockedDown(true);
else else
@ -516,8 +516,8 @@ namespace MWClass
const GMST& gmst = getGmst(); const GMST& gmst = getGmst();
float walkSpeed = gmst.fMinWalkSpeedCreature->getFloat() + 0.01f * stats.getAttribute(ESM::Attribute::Speed).getModified() float walkSpeed = gmst.fMinWalkSpeedCreature->mValue.getFloat() + 0.01f * stats.getAttribute(ESM::Attribute::Speed).getModified()
* (gmst.fMaxWalkSpeedCreature->getFloat() - gmst.fMinWalkSpeedCreature->getFloat()); * (gmst.fMaxWalkSpeedCreature->mValue.getFloat() - gmst.fMinWalkSpeedCreature->mValue.getFloat());
const MWBase::World *world = MWBase::Environment::get().getWorld(); const MWBase::World *world = MWBase::Environment::get().getWorld();
const MWMechanics::MagicEffects &mageffects = stats.getMagicEffects(); const MWMechanics::MagicEffects &mageffects = stats.getMagicEffects();
@ -536,9 +536,9 @@ namespace MWClass
{ {
float flySpeed = 0.01f*(stats.getAttribute(ESM::Attribute::Speed).getModified() + float flySpeed = 0.01f*(stats.getAttribute(ESM::Attribute::Speed).getModified() +
mageffects.get(ESM::MagicEffect::Levitate).getMagnitude()); mageffects.get(ESM::MagicEffect::Levitate).getMagnitude());
flySpeed = gmst.fMinFlySpeed->getFloat() + flySpeed*(gmst.fMaxFlySpeed->getFloat() - gmst.fMinFlySpeed->getFloat()); flySpeed = gmst.fMinFlySpeed->mValue.getFloat() + flySpeed*(gmst.fMaxFlySpeed->mValue.getFloat() - gmst.fMinFlySpeed->mValue.getFloat());
const float normalizedEncumbrance = getNormalizedEncumbrance(ptr); const float normalizedEncumbrance = getNormalizedEncumbrance(ptr);
flySpeed *= 1.0f - gmst.fEncumberedMoveEffect->getFloat() * normalizedEncumbrance; flySpeed *= 1.0f - gmst.fEncumberedMoveEffect->mValue.getFloat() * normalizedEncumbrance;
flySpeed = std::max(0.0f, flySpeed); flySpeed = std::max(0.0f, flySpeed);
moveSpeed = flySpeed; moveSpeed = flySpeed;
} }
@ -548,8 +548,8 @@ namespace MWClass
if(running) if(running)
swimSpeed = runSpeed; swimSpeed = runSpeed;
swimSpeed *= 1.0f + 0.01f * mageffects.get(ESM::MagicEffect::SwiftSwim).getMagnitude(); swimSpeed *= 1.0f + 0.01f * mageffects.get(ESM::MagicEffect::SwiftSwim).getMagnitude();
swimSpeed *= gmst.fSwimRunBase->getFloat() + 0.01f*getSkill(ptr, ESM::Skill::Athletics) * swimSpeed *= gmst.fSwimRunBase->mValue.getFloat() + 0.01f*getSkill(ptr, ESM::Skill::Athletics) *
gmst.fSwimRunAthleticsMult->getFloat(); gmst.fSwimRunAthleticsMult->mValue.getFloat();
moveSpeed = swimSpeed; moveSpeed = swimSpeed;
} }
else if(running) else if(running)
@ -814,8 +814,8 @@ namespace MWClass
return; return;
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
static const float fCorpseRespawnDelay = gmst.find("fCorpseRespawnDelay")->getFloat(); static const float fCorpseRespawnDelay = gmst.find("fCorpseRespawnDelay")->mValue.getFloat();
static const float fCorpseClearDelay = gmst.find("fCorpseClearDelay")->getFloat(); static const float fCorpseClearDelay = gmst.find("fCorpseClearDelay")->mValue.getFloat();
float delay = ptr.getRefData().getCount() == 0 ? fCorpseClearDelay : std::min(fCorpseRespawnDelay, fCorpseClearDelay); float delay = ptr.getRefData().getCount() == 0 ? fCorpseClearDelay : std::min(fCorpseRespawnDelay, fCorpseClearDelay);

@ -56,8 +56,8 @@ namespace MWClass
else if (creatureStats.isDead()) else if (creatureStats.isDead())
{ {
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
static const float fCorpseRespawnDelay = gmst.find("fCorpseRespawnDelay")->getFloat(); static const float fCorpseRespawnDelay = gmst.find("fCorpseRespawnDelay")->mValue.getFloat();
static const float fCorpseClearDelay = gmst.find("fCorpseClearDelay")->getFloat(); static const float fCorpseClearDelay = gmst.find("fCorpseClearDelay")->mValue.getFloat();
float delay = std::min(fCorpseRespawnDelay, fCorpseClearDelay); float delay = std::min(fCorpseRespawnDelay, fCorpseClearDelay);
if (creatureStats.getTimeOfDeath() + delay <= MWBase::Environment::get().getWorld()->getTimeStamp()) if (creatureStats.getTimeOfDeath() + delay <= MWBase::Environment::get().getWorld()->getTimeStamp())

@ -138,7 +138,7 @@ namespace MWClass
int alchemySkill = npcStats.getSkill (ESM::Skill::Alchemy).getBase(); int alchemySkill = npcStats.getSkill (ESM::Skill::Alchemy).getBase();
static const float fWortChanceValue = static const float fWortChanceValue =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fWortChanceValue")->getFloat(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fWortChanceValue")->mValue.getFloat();
MWGui::Widgets::SpellEffectList list; MWGui::Widgets::SpellEffectList list;
for (int i=0; i<4; ++i) for (int i=0; i<4; ++i)

@ -372,9 +372,9 @@ namespace MWClass
if (!ref->mBase->mFaction.empty()) if (!ref->mBase->mFaction.empty())
{ {
static const int iAutoRepFacMod = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() static const int iAutoRepFacMod = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("iAutoRepFacMod")->getInt(); .find("iAutoRepFacMod")->mValue.getInteger();
static const int iAutoRepLevMod = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() static const int iAutoRepLevMod = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("iAutoRepLevMod")->getInt(); .find("iAutoRepLevMod")->mValue.getInteger();
int rank = ref->mBase->getFactionRank(); int rank = ref->mBase->getFactionRank();
data->mNpcStats.setReputation(iAutoRepFacMod * (rank+1) + iAutoRepLevMod * (data->mNpcStats.getLevel()-1)); data->mNpcStats.setReputation(iAutoRepFacMod * (rank+1) + iAutoRepLevMod * (data->mNpcStats.getLevel()-1));
@ -528,7 +528,7 @@ namespace MWClass
const MWBase::World *world = MWBase::Environment::get().getWorld(); const MWBase::World *world = MWBase::Environment::get().getWorld();
const MWWorld::Store<ESM::GameSetting> &store = world->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting> &store = world->getStore().get<ESM::GameSetting>();
return store.find("sWerewolfPopup")->getString(); return store.find("sWerewolfPopup")->mValue.getString();
} }
const MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>(); const MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
@ -565,10 +565,10 @@ namespace MWClass
MWMechanics::applyFatigueLoss(ptr, weapon, attackStrength); MWMechanics::applyFatigueLoss(ptr, weapon, attackStrength);
const float fCombatDistance = store.find("fCombatDistance")->getFloat(); const float fCombatDistance = store.find("fCombatDistance")->mValue.getFloat();
float dist = fCombatDistance * (!weapon.isEmpty() ? float dist = fCombatDistance * (!weapon.isEmpty() ?
weapon.get<ESM::Weapon>()->mBase->mData.mReach : weapon.get<ESM::Weapon>()->mBase->mData.mReach :
store.find("fHandToHandReach")->getFloat()); store.find("fHandToHandReach")->mValue.getFloat());
// For AI actors, get combat targets to use in the ray cast. Only those targets will return a positive hit result. // For AI actors, get combat targets to use in the ray cast. Only those targets will return a positive hit result.
std::vector<MWWorld::Ptr> targetActors; std::vector<MWWorld::Ptr> targetActors;
@ -638,14 +638,14 @@ namespace MWClass
&& !MWBase::Environment::get().getMechanicsManager()->awarenessCheck(ptr, victim); && !MWBase::Environment::get().getMechanicsManager()->awarenessCheck(ptr, victim);
if(unaware) if(unaware)
{ {
damage *= store.find("fCombatCriticalStrikeMult")->getFloat(); damage *= store.find("fCombatCriticalStrikeMult")->mValue.getFloat();
MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}");
MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f); MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f);
} }
} }
if (othercls.getCreatureStats(victim).getKnockedDown()) if (othercls.getCreatureStats(victim).getKnockedDown())
damage *= store.find("fCombatKODamageMult")->getFloat(); damage *= store.find("fCombatKODamageMult")->mValue.getFloat();
// Apply "On hit" enchanted weapons // Apply "On hit" enchanted weapons
MWMechanics::applyOnStrikeEnchantment(ptr, victim, weapon, hitPosition); MWMechanics::applyOnStrikeEnchantment(ptr, victim, weapon, hitPosition);
@ -737,14 +737,14 @@ namespace MWClass
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
const GMST& gmst = getGmst(); const GMST& gmst = getGmst();
int chance = store.get<ESM::GameSetting>().find("iVoiceHitOdds")->getInt(); int chance = store.get<ESM::GameSetting>().find("iVoiceHitOdds")->mValue.getInteger();
if (Misc::Rng::roll0to99() < chance) if (Misc::Rng::roll0to99() < chance)
MWBase::Environment::get().getDialogueManager()->say(ptr, "hit"); MWBase::Environment::get().getDialogueManager()->say(ptr, "hit");
// Check for knockdown // Check for knockdown
float agilityTerm = stats.getAttribute(ESM::Attribute::Agility).getModified() * gmst.fKnockDownMult->getFloat(); float agilityTerm = stats.getAttribute(ESM::Attribute::Agility).getModified() * gmst.fKnockDownMult->mValue.getFloat();
float knockdownTerm = stats.getAttribute(ESM::Attribute::Agility).getModified() float knockdownTerm = stats.getAttribute(ESM::Attribute::Agility).getModified()
* gmst.iKnockDownOddsMult->getInt() * 0.01f + gmst.iKnockDownOddsBase->getInt(); * gmst.iKnockDownOddsMult->mValue.getInteger() * 0.01f + gmst.iKnockDownOddsBase->mValue.getInteger();
if (ishealth && agilityTerm <= damage && knockdownTerm <= Misc::Rng::roll0to99()) if (ishealth && agilityTerm <= damage && knockdownTerm <= Misc::Rng::roll0to99())
stats.setKnockedDown(true); stats.setKnockedDown(true);
else else
@ -772,7 +772,7 @@ namespace MWClass
float unmitigatedDamage = damage; float unmitigatedDamage = damage;
float x = damage / (damage + getArmorRating(ptr)); float x = damage / (damage + getArmorRating(ptr));
damage *= std::max(gmst.fCombatArmorMinMult->getFloat(), x); damage *= std::max(gmst.fCombatArmorMinMult->mValue.getFloat(), x);
int damageDiff = static_cast<int>(unmitigatedDamage - damage); int damageDiff = static_cast<int>(unmitigatedDamage - damage);
damage = std::max(1.f, damage); damage = std::max(1.f, damage);
damageDiff = std::max(1, damageDiff); damageDiff = std::max(1, damageDiff);
@ -941,15 +941,15 @@ namespace MWClass
bool sneaking = stats.getStance(MWMechanics::CreatureStats::Stance_Sneak); bool sneaking = stats.getStance(MWMechanics::CreatureStats::Stance_Sneak);
bool running = stats.getStance(MWMechanics::CreatureStats::Stance_Run); bool running = stats.getStance(MWMechanics::CreatureStats::Stance_Run);
float walkSpeed = gmst.fMinWalkSpeed->getFloat() + 0.01f*npcdata->mNpcStats.getAttribute(ESM::Attribute::Speed).getModified()* float walkSpeed = gmst.fMinWalkSpeed->mValue.getFloat() + 0.01f*npcdata->mNpcStats.getAttribute(ESM::Attribute::Speed).getModified()*
(gmst.fMaxWalkSpeed->getFloat() - gmst.fMinWalkSpeed->getFloat()); (gmst.fMaxWalkSpeed->mValue.getFloat() - gmst.fMinWalkSpeed->mValue.getFloat());
walkSpeed *= 1.0f - gmst.fEncumberedMoveEffect->getFloat()*normalizedEncumbrance; walkSpeed *= 1.0f - gmst.fEncumberedMoveEffect->mValue.getFloat()*normalizedEncumbrance;
walkSpeed = std::max(0.0f, walkSpeed); walkSpeed = std::max(0.0f, walkSpeed);
if(sneaking) if(sneaking)
walkSpeed *= gmst.fSneakSpeedMultiplier->getFloat(); walkSpeed *= gmst.fSneakSpeedMultiplier->mValue.getFloat();
float runSpeed = walkSpeed*(0.01f * npcdata->mNpcStats.getSkill(ESM::Skill::Athletics).getModified() * float runSpeed = walkSpeed*(0.01f * npcdata->mNpcStats.getSkill(ESM::Skill::Athletics).getModified() *
gmst.fAthleticsRunBonus->getFloat() + gmst.fBaseRunMultiplier->getFloat()); gmst.fAthleticsRunBonus->mValue.getFloat() + gmst.fBaseRunMultiplier->mValue.getFloat());
float moveSpeed; float moveSpeed;
if(getEncumbrance(ptr) > getCapacity(ptr)) if(getEncumbrance(ptr) > getCapacity(ptr))
@ -959,8 +959,8 @@ namespace MWClass
{ {
float flySpeed = 0.01f*(npcdata->mNpcStats.getAttribute(ESM::Attribute::Speed).getModified() + float flySpeed = 0.01f*(npcdata->mNpcStats.getAttribute(ESM::Attribute::Speed).getModified() +
mageffects.get(ESM::MagicEffect::Levitate).getMagnitude()); mageffects.get(ESM::MagicEffect::Levitate).getMagnitude());
flySpeed = gmst.fMinFlySpeed->getFloat() + flySpeed*(gmst.fMaxFlySpeed->getFloat() - gmst.fMinFlySpeed->getFloat()); flySpeed = gmst.fMinFlySpeed->mValue.getFloat() + flySpeed*(gmst.fMaxFlySpeed->mValue.getFloat() - gmst.fMinFlySpeed->mValue.getFloat());
flySpeed *= 1.0f - gmst.fEncumberedMoveEffect->getFloat() * normalizedEncumbrance; flySpeed *= 1.0f - gmst.fEncumberedMoveEffect->mValue.getFloat() * normalizedEncumbrance;
flySpeed = std::max(0.0f, flySpeed); flySpeed = std::max(0.0f, flySpeed);
moveSpeed = flySpeed; moveSpeed = flySpeed;
} }
@ -970,8 +970,8 @@ namespace MWClass
if(running) if(running)
swimSpeed = runSpeed; swimSpeed = runSpeed;
swimSpeed *= 1.0f + 0.01f * mageffects.get(ESM::MagicEffect::SwiftSwim).getMagnitude(); swimSpeed *= 1.0f + 0.01f * mageffects.get(ESM::MagicEffect::SwiftSwim).getMagnitude();
swimSpeed *= gmst.fSwimRunBase->getFloat() + 0.01f*npcdata->mNpcStats.getSkill(ESM::Skill::Athletics).getModified()* swimSpeed *= gmst.fSwimRunBase->mValue.getFloat() + 0.01f*npcdata->mNpcStats.getSkill(ESM::Skill::Athletics).getModified()*
gmst.fSwimRunAthleticsMult->getFloat(); gmst.fSwimRunAthleticsMult->mValue.getFloat();
moveSpeed = swimSpeed; moveSpeed = swimSpeed;
} }
else if(running && !sneaking) else if(running && !sneaking)
@ -982,7 +982,7 @@ namespace MWClass
moveSpeed *= 0.75f; moveSpeed *= 0.75f;
if(npcdata->mNpcStats.isWerewolf() && running && npcdata->mNpcStats.getDrawState() == MWMechanics::DrawState_Nothing) if(npcdata->mNpcStats.isWerewolf() && running && npcdata->mNpcStats.getDrawState() == MWMechanics::DrawState_Nothing)
moveSpeed *= gmst.fWereWolfRunMult->getFloat(); moveSpeed *= gmst.fWereWolfRunMult->mValue.getFloat();
return moveSpeed; return moveSpeed;
} }
@ -999,8 +999,8 @@ namespace MWClass
const NpcCustomData *npcdata = static_cast<const NpcCustomData*>(ptr.getRefData().getCustomData()); const NpcCustomData *npcdata = static_cast<const NpcCustomData*>(ptr.getRefData().getCustomData());
const GMST& gmst = getGmst(); const GMST& gmst = getGmst();
const MWMechanics::MagicEffects &mageffects = npcdata->mNpcStats.getMagicEffects(); const MWMechanics::MagicEffects &mageffects = npcdata->mNpcStats.getMagicEffects();
const float encumbranceTerm = gmst.fJumpEncumbranceBase->getFloat() + const float encumbranceTerm = gmst.fJumpEncumbranceBase->mValue.getFloat() +
gmst.fJumpEncumbranceMultiplier->getFloat() * gmst.fJumpEncumbranceMultiplier->mValue.getFloat() *
(1.0f - Npc::getNormalizedEncumbrance(ptr)); (1.0f - Npc::getNormalizedEncumbrance(ptr));
float a = static_cast<float>(npcdata->mNpcStats.getSkill(ESM::Skill::Acrobatics).getModified()); float a = static_cast<float>(npcdata->mNpcStats.getSkill(ESM::Skill::Acrobatics).getModified());
@ -1011,14 +1011,14 @@ namespace MWClass
a = 50.0f; a = 50.0f;
} }
float x = gmst.fJumpAcrobaticsBase->getFloat() + float x = gmst.fJumpAcrobaticsBase->mValue.getFloat() +
std::pow(a / 15.0f, gmst.fJumpAcroMultiplier->getFloat()); std::pow(a / 15.0f, gmst.fJumpAcroMultiplier->mValue.getFloat());
x += 3.0f * b * gmst.fJumpAcroMultiplier->getFloat(); x += 3.0f * b * gmst.fJumpAcroMultiplier->mValue.getFloat();
x += mageffects.get(ESM::MagicEffect::Jump).getMagnitude() * 64; x += mageffects.get(ESM::MagicEffect::Jump).getMagnitude() * 64;
x *= encumbranceTerm; x *= encumbranceTerm;
if(stats.getStance(MWMechanics::CreatureStats::Stance_Run)) if(stats.getStance(MWMechanics::CreatureStats::Stance_Run))
x *= gmst.fJumpRunMultiplier->getFloat(); x *= gmst.fJumpRunMultiplier->mValue.getFloat();
x *= npcdata->mNpcStats.getFatigueTerm(); x *= npcdata->mNpcStats.getFatigueTerm();
x -= -627.2f;/*gravity constant*/ x -= -627.2f;/*gravity constant*/
x /= 3.0f; x /= 3.0f;
@ -1083,7 +1083,7 @@ namespace MWClass
float Npc::getCapacity (const MWWorld::Ptr& ptr) const float Npc::getCapacity (const MWWorld::Ptr& ptr) const
{ {
const MWMechanics::CreatureStats& stats = getCreatureStats (ptr); const MWMechanics::CreatureStats& stats = getCreatureStats (ptr);
static const float fEncumbranceStrMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fEncumbranceStrMult")->getFloat(); static const float fEncumbranceStrMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fEncumbranceStrMult")->mValue.getFloat();
return stats.getAttribute(ESM::Attribute::Strength).getModified()*fEncumbranceStrMult; return stats.getAttribute(ESM::Attribute::Strength).getModified()*fEncumbranceStrMult;
} }
@ -1126,8 +1126,8 @@ namespace MWClass
MWMechanics::NpcStats &stats = getNpcStats(ptr); MWMechanics::NpcStats &stats = getNpcStats(ptr);
const MWWorld::InventoryStore &invStore = getInventoryStore(ptr); const MWWorld::InventoryStore &invStore = getInventoryStore(ptr);
float fUnarmoredBase1 = store.find("fUnarmoredBase1")->getFloat(); float fUnarmoredBase1 = store.find("fUnarmoredBase1")->mValue.getFloat();
float fUnarmoredBase2 = store.find("fUnarmoredBase2")->getFloat(); float fUnarmoredBase2 = store.find("fUnarmoredBase2")->mValue.getFloat();
int unarmoredSkill = stats.getSkill(ESM::Skill::Unarmored).getModified(); int unarmoredSkill = stats.getSkill(ESM::Skill::Unarmored).getModified();
float ratings[MWWorld::InventoryStore::Slots]; float ratings[MWWorld::InventoryStore::Slots];
@ -1367,8 +1367,8 @@ namespace MWClass
return; return;
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
static const float fCorpseRespawnDelay = gmst.find("fCorpseRespawnDelay")->getFloat(); static const float fCorpseRespawnDelay = gmst.find("fCorpseRespawnDelay")->mValue.getFloat();
static const float fCorpseClearDelay = gmst.find("fCorpseClearDelay")->getFloat(); static const float fCorpseClearDelay = gmst.find("fCorpseClearDelay")->mValue.getFloat();
float delay = ptr.getRefData().getCount() == 0 ? fCorpseClearDelay : std::min(fCorpseRespawnDelay, fCorpseClearDelay); float delay = ptr.getRefData().getCount() == 0 ? fCorpseClearDelay : std::min(fCorpseRespawnDelay, fCorpseClearDelay);

@ -287,8 +287,8 @@ namespace MWClass
std::string type = mapping[ref->mBase->mData.mType].first; std::string type = mapping[ref->mBase->mData.mType].first;
std::string oneOrTwoHanded = mapping[ref->mBase->mData.mType].second; std::string oneOrTwoHanded = mapping[ref->mBase->mData.mType].second;
text += store.get<ESM::GameSetting>().find(type)->getString() + text += store.get<ESM::GameSetting>().find(type)->mValue.getString() +
((oneOrTwoHanded != "") ? ", " + store.get<ESM::GameSetting>().find(oneOrTwoHanded)->getString() : ""); ((oneOrTwoHanded != "") ? ", " + store.get<ESM::GameSetting>().find(oneOrTwoHanded)->mValue.getString() : "");
// weapon damage // weapon damage
if (ref->mBase->mData.mType >= 9) if (ref->mBase->mData.mType >= 9)
@ -326,7 +326,7 @@ namespace MWClass
if (ref->mBase->mData.mType < 9 && Settings::Manager::getBool("show melee info", "Game")) if (ref->mBase->mData.mType < 9 && Settings::Manager::getBool("show melee info", "Game"))
{ {
// 64 game units = 1 yard = 3 ft, display value in feet // 64 game units = 1 yard = 3 ft, display value in feet
const float combatDistance = store.get<ESM::GameSetting>().find("fCombatDistance")->getFloat() * ref->mBase->mData.mReach; const float combatDistance = store.get<ESM::GameSetting>().find("fCombatDistance")->mValue.getFloat() * ref->mBase->mData.mReach;
text += MWGui::ToolTips::getWeightString(combatDistance*3/64, "#{sRange}"); text += MWGui::ToolTips::getWeightString(combatDistance*3/64, "#{sRange}");
text += " #{sFeet}"; text += " #{sFeet}";

@ -261,7 +261,7 @@ namespace MWDialogue
const MWWorld::Store<ESM::GameSetting>& gmsts = const MWWorld::Store<ESM::GameSetting>& gmsts =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
title = gmsts.find (modifiedTopic)->getString(); title = gmsts.find (modifiedTopic)->mValue.getString();
} }
else else
title = topic; title = topic;
@ -537,7 +537,7 @@ namespace MWDialogue
MWScript::InterpreterContext interpreterContext(&mActor.getRefData().getLocals(),mActor); MWScript::InterpreterContext interpreterContext(&mActor.getRefData().getLocals(),mActor);
callback->addResponse(gmsts.find ("sServiceRefusal")->getString(), Interpreter::fixDefinesDialog(info->mResponse, interpreterContext)); callback->addResponse(gmsts.find ("sServiceRefusal")->mValue.getString(), Interpreter::fixDefinesDialog(info->mResponse, interpreterContext));
executeScript (info->mResultScript, mActor); executeScript (info->mResultScript, mActor);
return true; return true;

@ -365,15 +365,15 @@ namespace MWGui
const MWWorld::Store<ESM::GameSetting> &gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting> &gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
const std::string sPersuasion = gmst.find("sPersuasion")->getString(); const std::string sPersuasion = gmst.find("sPersuasion")->mValue.getString();
const std::string sCompanionShare = gmst.find("sCompanionShare")->getString(); const std::string sCompanionShare = gmst.find("sCompanionShare")->mValue.getString();
const std::string sBarter = gmst.find("sBarter")->getString(); const std::string sBarter = gmst.find("sBarter")->mValue.getString();
const std::string sSpells = gmst.find("sSpells")->getString(); const std::string sSpells = gmst.find("sSpells")->mValue.getString();
const std::string sTravel = gmst.find("sTravel")->getString(); const std::string sTravel = gmst.find("sTravel")->mValue.getString();
const std::string sSpellMakingMenuTitle = gmst.find("sSpellMakingMenuTitle")->getString(); const std::string sSpellMakingMenuTitle = gmst.find("sSpellMakingMenuTitle")->mValue.getString();
const std::string sEnchanting = gmst.find("sEnchanting")->getString(); const std::string sEnchanting = gmst.find("sEnchanting")->mValue.getString();
const std::string sServiceTrainingTitle = gmst.find("sServiceTrainingTitle")->getString(); const std::string sServiceTrainingTitle = gmst.find("sServiceTrainingTitle")->mValue.getString();
const std::string sRepair = gmst.find("sRepair")->getString(); const std::string sRepair = gmst.find("sRepair")->mValue.getString();
if (topic != sPersuasion && topic != sCompanionShare && topic != sBarter if (topic != sPersuasion && topic != sCompanionShare && topic != sBarter
&& topic != sSpells && topic != sTravel && topic != sSpellMakingMenuTitle && topic != sSpells && topic != sTravel && topic != sSpellMakingMenuTitle
@ -458,7 +458,7 @@ namespace MWGui
void DialogueWindow::restock() void DialogueWindow::restock()
{ {
MWMechanics::CreatureStats &sellerStats = mPtr.getClass().getCreatureStats(mPtr); MWMechanics::CreatureStats &sellerStats = mPtr.getClass().getCreatureStats(mPtr);
float delay = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fBarterGoldResetDelay")->getFloat(); float delay = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fBarterGoldResetDelay")->mValue.getFloat();
// Gold is restocked every 24h // Gold is restocked every 24h
if (MWBase::Environment::get().getWorld()->getTimeStamp() >= sellerStats.getLastRestockTime() + delay) if (MWBase::Environment::get().getWorld()->getTimeStamp() >= sellerStats.getLastRestockTime() + delay)
@ -503,31 +503,31 @@ namespace MWGui
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
if (mPtr.getTypeName() == typeid(ESM::NPC).name()) if (mPtr.getTypeName() == typeid(ESM::NPC).name())
mTopicsList->addItem(gmst.find("sPersuasion")->getString()); mTopicsList->addItem(gmst.find("sPersuasion")->mValue.getString());
if (services & ESM::NPC::AllItems) if (services & ESM::NPC::AllItems)
mTopicsList->addItem(gmst.find("sBarter")->getString()); mTopicsList->addItem(gmst.find("sBarter")->mValue.getString());
if (services & ESM::NPC::Spells) if (services & ESM::NPC::Spells)
mTopicsList->addItem(gmst.find("sSpells")->getString()); mTopicsList->addItem(gmst.find("sSpells")->mValue.getString());
if (travel) if (travel)
mTopicsList->addItem(gmst.find("sTravel")->getString()); mTopicsList->addItem(gmst.find("sTravel")->mValue.getString());
if (services & ESM::NPC::Spellmaking) if (services & ESM::NPC::Spellmaking)
mTopicsList->addItem(gmst.find("sSpellmakingMenuTitle")->getString()); mTopicsList->addItem(gmst.find("sSpellmakingMenuTitle")->mValue.getString());
if (services & ESM::NPC::Enchanting) if (services & ESM::NPC::Enchanting)
mTopicsList->addItem(gmst.find("sEnchanting")->getString()); mTopicsList->addItem(gmst.find("sEnchanting")->mValue.getString());
if (services & ESM::NPC::Training) if (services & ESM::NPC::Training)
mTopicsList->addItem(gmst.find("sServiceTrainingTitle")->getString()); mTopicsList->addItem(gmst.find("sServiceTrainingTitle")->mValue.getString());
if (services & ESM::NPC::Repair) if (services & ESM::NPC::Repair)
mTopicsList->addItem(gmst.find("sRepair")->getString()); mTopicsList->addItem(gmst.find("sRepair")->mValue.getString());
if (isCompanion()) if (isCompanion())
mTopicsList->addItem(gmst.find("sCompanionShare")->getString()); mTopicsList->addItem(gmst.find("sCompanionShare")->mValue.getString());
if (mTopicsList->getItemCount() > 0) if (mTopicsList->getItemCount() > 0)
mTopicsList->addSeparator(); mTopicsList->addSeparator();
@ -592,7 +592,7 @@ namespace MWGui
Goodbye* link = new Goodbye(); Goodbye* link = new Goodbye();
link->eventActivated += MyGUI::newDelegate(this, &DialogueWindow::onGoodbyeActivated); link->eventActivated += MyGUI::newDelegate(this, &DialogueWindow::onGoodbyeActivated);
mLinks.push_back(link); mLinks.push_back(link);
std::string goodbye = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sGoodbye")->getString(); std::string goodbye = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sGoodbye")->mValue.getString();
BookTypesetter::Style* questionStyle = typesetter->createHotStyle(body, textColours.answer, textColours.answerOver, BookTypesetter::Style* questionStyle = typesetter->createHotStyle(body, textColours.answer, textColours.answerOver,
textColours.answerPressed, textColours.answerPressed,
TypesetBook::InteractiveId(link)); TypesetBook::InteractiveId(link));

@ -341,7 +341,7 @@ namespace MWGui
MWWorld::Ptr item = (i == 0) ? mEnchanting.getOldItem() : mEnchanting.getGem(); MWWorld::Ptr item = (i == 0) ? mEnchanting.getOldItem() : mEnchanting.getGem();
if (MWBase::Environment::get().getMechanicsManager()->isItemStolenFrom(item.getCellRef().getRefId(), mPtr)) if (MWBase::Environment::get().getMechanicsManager()->isItemStolenFrom(item.getCellRef().getRefId(), mPtr))
{ {
std::string msg = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sNotifyMessage49")->getString(); std::string msg = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sNotifyMessage49")->mValue.getString();
if (msg.find("%s") != std::string::npos) if (msg.find("%s") != std::string::npos)
msg.replace(msg.find("%s"), 2, item.getClass().getName(item)); msg.replace(msg.find("%s"), 2, item.getClass().getName(item));
MWBase::Environment::get().getWindowManager()->messageBox(msg); MWBase::Environment::get().getWindowManager()->messageBox(msg);

@ -611,7 +611,7 @@ namespace MWGui
// Therefore any value < 1 should show as an empty health bar. We do the same in statswindow :) // Therefore any value < 1 should show as an empty health bar. We do the same in statswindow :)
mEnemyHealth->setProgressPosition(static_cast<size_t>(stats.getHealth().getCurrent() / stats.getHealth().getModified() * 100)); mEnemyHealth->setProgressPosition(static_cast<size_t>(stats.getHealth().getCurrent() / stats.getHealth().getModified() * 100));
static const float fNPCHealthBarFade = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fNPCHealthBarFade")->getFloat(); static const float fNPCHealthBarFade = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fNPCHealthBarFade")->mValue.getFloat();
if (fNPCHealthBarFade > 0.f) if (fNPCHealthBarFade > 0.f)
mEnemyHealth->setAlpha(std::max(0.f, std::min(1.f, mEnemyHealthTimer/fNPCHealthBarFade))); mEnemyHealth->setAlpha(std::max(0.f, std::min(1.f, mEnemyHealthTimer/fNPCHealthBarFade)));
@ -620,7 +620,7 @@ namespace MWGui
void HUD::setEnemy(const MWWorld::Ptr &enemy) void HUD::setEnemy(const MWWorld::Ptr &enemy)
{ {
mEnemyActorId = enemy.getClass().getCreatureStats(enemy).getActorId(); mEnemyActorId = enemy.getClass().getCreatureStats(enemy).getActorId();
mEnemyHealthTimer = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fNPCHealthBarTime")->getFloat(); mEnemyHealthTimer = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fNPCHealthBarTime")->mValue.getFloat();
if (!mEnemyHealth->getVisible()) if (!mEnemyHealth->getVisible())
mWeaponSpellBox->setPosition(mWeaponSpellBox->getPosition() - MyGUI::IntPoint(0,20)); mWeaponSpellBox->setPosition(mWeaponSpellBox->getPosition() - MyGUI::IntPoint(0,20));
mEnemyHealth->setVisible(true); mEnemyHealth->setVisible(true);

@ -99,9 +99,9 @@ namespace MWGui
std::string message; std::string message;
if (mDays == 1) if (mDays == 1)
message = gmst.find("sNotifyMessage42")->getString(); message = gmst.find("sNotifyMessage42")->mValue.getString();
else else
message = gmst.find("sNotifyMessage43")->getString(); message = gmst.find("sNotifyMessage43")->mValue.getString();
std::stringstream dayStr; std::stringstream dayStr;
dayStr << mDays; dayStr << mDays;
@ -110,12 +110,12 @@ namespace MWGui
for (std::set<int>::iterator it = skills.begin(); it != skills.end(); ++it) for (std::set<int>::iterator it = skills.begin(); it != skills.end(); ++it)
{ {
std::string skillName = gmst.find(ESM::Skill::sSkillNameIds[*it])->getString(); std::string skillName = gmst.find(ESM::Skill::sSkillNameIds[*it])->mValue.getString();
std::stringstream skillValue; std::stringstream skillValue;
skillValue << player.getClass().getNpcStats(player).getSkill(*it).getBase(); skillValue << player.getClass().getNpcStats(player).getSkill(*it).getBase();
std::string skillMsg = gmst.find("sNotifyMessage44")->getString(); std::string skillMsg = gmst.find("sNotifyMessage44")->mValue.getString();
if (*it == ESM::Skill::Sneak || *it == ESM::Skill::Security) if (*it == ESM::Skill::Sneak || *it == ESM::Skill::Security)
skillMsg = gmst.find("sNotifyMessage39")->getString(); skillMsg = gmst.find("sNotifyMessage39")->mValue.getString();
if (skillMsg.find("%s") != std::string::npos) if (skillMsg.find("%s") != std::string::npos)
skillMsg.replace(skillMsg.find("%s"), 2, skillName); skillMsg.replace(skillMsg.find("%s"), 2, skillName);

@ -57,7 +57,7 @@ void MerchantRepair::setPtr(const MWWorld::Ptr &actor)
int basePrice = iter->getClass().getValue(*iter); int basePrice = iter->getClass().getValue(*iter);
float fRepairMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() float fRepairMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fRepairMult")->getFloat(); .find("fRepairMult")->mValue.getFloat();
float p = static_cast<float>(std::max(1, basePrice)); float p = static_cast<float>(std::max(1, basePrice));
float r = static_cast<float>(std::max(1, static_cast<int>(maxDurability / p))); float r = static_cast<float>(std::max(1, static_cast<int>(maxDurability / p)));
@ -71,7 +71,7 @@ void MerchantRepair::setPtr(const MWWorld::Ptr &actor)
std::string name = iter->getClass().getName(*iter) std::string name = iter->getClass().getName(*iter)
+ " - " + MyGUI::utility::toString(price) + " - " + MyGUI::utility::toString(price)
+ MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() + MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("sgp")->getString(); .find("sgp")->mValue.getString();
MyGUI::Button* button = MyGUI::Button* button =

@ -181,7 +181,7 @@ void Recharge::onItemClicked(MyGUI::Widget *sender, const MWWorld::Ptr& item)
if (gem.getRefData().getCount() == 0) if (gem.getRefData().getCount() == 0)
{ {
std::string message = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sNotifyMessage51")->getString(); std::string message = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sNotifyMessage51")->mValue.getString();
message = boost::str(boost::format(message) % gem.getClass().getName(gem)); message = boost::str(boost::format(message) % gem.getClass().getName(gem));
MWBase::Environment::get().getWindowManager()->messageBox(message); MWBase::Environment::get().getWindowManager()->messageBox(message);

@ -44,7 +44,7 @@ namespace MWGui
const MWWorld::ESMStore &store = const MWWorld::ESMStore &store =
MWBase::Environment::get().getWorld()->getStore(); MWBase::Environment::get().getWorld()->getStore();
int price = static_cast<int>(spell.mData.mCost*store.get<ESM::GameSetting>().find("fSpellValueMult")->getFloat()); int price = static_cast<int>(spell.mData.mCost*store.get<ESM::GameSetting>().find("fSpellValueMult")->mValue.getFloat());
price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr,price,true); price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr,price,true);
MWWorld::Ptr player = MWMechanics::getPlayer(); MWWorld::Ptr player = MWMechanics::getPlayer();

@ -32,8 +32,8 @@ namespace
const MWWorld::Store<ESM::GameSetting> &gmst = const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
return gmst.find(ESM::MagicEffect::effectIdToString (id1))->getString() return gmst.find(ESM::MagicEffect::effectIdToString (id1))->mValue.getString()
< gmst.find(ESM::MagicEffect::effectIdToString (id2))->getString(); < gmst.find(ESM::MagicEffect::effectIdToString (id2))->mValue.getString();
} }
void init(ESM::ENAMstruct& effect) void init(ESM::ENAMstruct& effect)
@ -469,7 +469,7 @@ namespace MWGui
mMagickaCost->setCaption(MyGUI::utility::toString(int(y))); mMagickaCost->setCaption(MyGUI::utility::toString(int(y)));
float fSpellMakingValueMult = float fSpellMakingValueMult =
store.get<ESM::GameSetting>().find("fSpellMakingValueMult")->getFloat(); store.get<ESM::GameSetting>().find("fSpellMakingValueMult")->mValue.getFloat();
int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, static_cast<int>(y * fSpellMakingValueMult),true); int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, static_cast<int>(y * fSpellMakingValueMult),true);
@ -547,7 +547,7 @@ namespace MWGui
for (std::vector<short>::const_iterator it = knownEffects.begin(); it != knownEffects.end(); ++it) for (std::vector<short>::const_iterator it = knownEffects.begin(); it != knownEffects.end(); ++it)
{ {
mAvailableEffectsList->addItem(MWBase::Environment::get().getWorld ()->getStore ().get<ESM::GameSetting>().find( mAvailableEffectsList->addItem(MWBase::Environment::get().getWorld ()->getStore ().get<ESM::GameSetting>().find(
ESM::MagicEffect::effectIdToString (*it))->getString()); ESM::MagicEffect::effectIdToString (*it))->mValue.getString());
mButtonMapping[i] = *it; mButtonMapping[i] = *it;
++i; ++i;
} }
@ -557,7 +557,7 @@ namespace MWGui
for (std::vector<short>::const_iterator it = knownEffects.begin(); it != knownEffects.end(); ++it) for (std::vector<short>::const_iterator it = knownEffects.begin(); it != knownEffects.end(); ++it)
{ {
std::string name = MWBase::Environment::get().getWorld ()->getStore ().get<ESM::GameSetting>().find( std::string name = MWBase::Environment::get().getWorld ()->getStore ().get<ESM::GameSetting>().find(
ESM::MagicEffect::effectIdToString (*it))->getString(); ESM::MagicEffect::effectIdToString (*it))->mValue.getString();
MyGUI::Widget* w = mAvailableEffectsList->getItemWidget(name); MyGUI::Widget* w = mAvailableEffectsList->getItemWidget(name);
ToolTips::createMagicEffectToolTip (w, *it); ToolTips::createMagicEffectToolTip (w, *it);

@ -75,7 +75,7 @@ namespace MWGui
std::string sourcesDescription; std::string sourcesDescription;
static const float fadeTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fMagicStartIconBlink")->getFloat(); static const float fadeTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fMagicStartIconBlink")->mValue.getFloat();
for (std::vector<MagicEffectInfo>::const_iterator effectIt = it->second.begin(); for (std::vector<MagicEffectInfo>::const_iterator effectIt = it->second.begin();
effectIt != it->second.end(); ++effectIt) effectIt != it->second.end(); ++effectIt)

@ -61,7 +61,7 @@ namespace MWGui
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
for (int i=0; names[i][0]; ++i) for (int i=0; names[i][0]; ++i)
{ {
setText (names[i][0], store.get<ESM::GameSetting>().find (names[i][1])->getString()); setText (names[i][0], store.get<ESM::GameSetting>().find (names[i][1])->mValue.getString());
} }
getWidget(mSkillView, "SkillView"); getWidget(mSkillView, "SkillView");
@ -306,7 +306,7 @@ namespace MWGui
MyGUI::Widget* levelWidget; MyGUI::Widget* levelWidget;
for (int i=0; i<2; ++i) for (int i=0; i<2; ++i)
{ {
int max = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iLevelUpTotal")->getInt(); int max = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iLevelUpTotal")->mValue.getInteger();
getWidget(levelWidget, i==0 ? "Level_str" : "LevelText"); getWidget(levelWidget, i==0 ? "Level_str" : "LevelText");
levelWidget->setUserString("RangePosition_LevelProgress", MyGUI::utility::toString(PCstats.getLevelProgress())); levelWidget->setUserString("RangePosition_LevelProgress", MyGUI::utility::toString(PCstats.getLevelProgress()));
levelWidget->setUserString("Range_LevelProgress", MyGUI::utility::toString(max)); levelWidget->setUserString("Range_LevelProgress", MyGUI::utility::toString(max));

@ -313,7 +313,7 @@ namespace MWGui
{ {
if (MWBase::Environment::get().getMechanicsManager()->isItemStolenFrom(it->mBase.getCellRef().getRefId(), mPtr)) if (MWBase::Environment::get().getMechanicsManager()->isItemStolenFrom(it->mBase.getCellRef().getRefId(), mPtr))
{ {
std::string msg = gmst.find("sNotifyMessage49")->getString(); std::string msg = gmst.find("sNotifyMessage49")->mValue.getString();
if (msg.find("%s") != std::string::npos) if (msg.find("%s") != std::string::npos)
msg.replace(msg.find("%s"), 2, it->mBase.getClass().getName(it->mBase)); msg.replace(msg.find("%s"), 2, it->mBase.getClass().getName(it->mBase));
MWBase::Environment::get().getWindowManager()->messageBox(msg); MWBase::Environment::get().getWindowManager()->messageBox(msg);
@ -331,8 +331,8 @@ namespace MWGui
// apply disposition change if merchant is NPC // apply disposition change if merchant is NPC
if ( mPtr.getClass().isNpc() ) { if ( mPtr.getClass().isNpc() ) {
int dispositionDelta = offerAccepted int dispositionDelta = offerAccepted
? gmst.find("iBarterSuccessDisposition")->getInt() ? gmst.find("iBarterSuccessDisposition")->mValue.getInteger()
: gmst.find("iBarterFailDisposition")->getInt(); : gmst.find("iBarterFailDisposition")->mValue.getInteger();
MWBase::Environment::get().getDialogueManager()->applyBarterDispositionChange(dispositionDelta); MWBase::Environment::get().getDialogueManager()->applyBarterDispositionChange(dispositionDelta);
} }

@ -98,7 +98,7 @@ namespace MWGui
for (int i=0; i<3; ++i) for (int i=0; i<3; ++i)
{ {
int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer
(mPtr,pcStats.getSkill (skills[i].first).getBase() * gmst.find("iTrainingMod")->getInt (),true); (mPtr,pcStats.getSkill (skills[i].first).getBase() * gmst.find("iTrainingMod")->mValue.getInteger(),true);
MyGUI::Button* button = mTrainingOptions->createWidget<MyGUI::Button>(price <= playerGold ? "SandTextButton" : "SandTextButtonDisabled", // can't use setEnabled since that removes tooltip MyGUI::Button* button = mTrainingOptions->createWidget<MyGUI::Button>(price <= playerGold ? "SandTextButton" : "SandTextButtonDisabled", // can't use setEnabled since that removes tooltip
MyGUI::IntCoord(5, 5+i*18, mTrainingOptions->getWidth()-10, 18), MyGUI::Align::Default); MyGUI::IntCoord(5, 5+i*18, mTrainingOptions->getWidth()-10, 18), MyGUI::Align::Default);
@ -136,7 +136,7 @@ namespace MWGui
const MWWorld::ESMStore &store = const MWWorld::ESMStore &store =
MWBase::Environment::get().getWorld()->getStore(); MWBase::Environment::get().getWorld()->getStore();
int price = pcStats.getSkill (skillId).getBase() * store.get<ESM::GameSetting>().find("iTrainingMod")->getInt (); int price = pcStats.getSkill (skillId).getBase() * store.get<ESM::GameSetting>().find("iTrainingMod")->mValue.getInteger();
price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr,price,true); price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr,price,true);
if (price > player.getClass().getContainerStore(player).count(MWWorld::ContainerStore::sGoldId)) if (price > player.getClass().getContainerStore(player).count(MWWorld::ContainerStore::sGoldId))

@ -58,13 +58,13 @@ namespace MWGui
if (!mPtr.getCell()->isExterior()) if (!mPtr.getCell()->isExterior())
{ {
price = gmst.find("fMagesGuildTravel")->getInt(); price = gmst.find("fMagesGuildTravel")->mValue.getInteger();
} }
else else
{ {
ESM::Position PlayerPos = player.getRefData().getPosition(); ESM::Position PlayerPos = player.getRefData().getPosition();
float d = sqrt(pow(pos.pos[0] - PlayerPos.pos[0], 2) + pow(pos.pos[1] - PlayerPos.pos[1], 2) + pow(pos.pos[2] - PlayerPos.pos[2], 2)); float d = sqrt(pow(pos.pos[0] - PlayerPos.pos[0], 2) + pow(pos.pos[1] - PlayerPos.pos[1], 2) + pow(pos.pos[2] - PlayerPos.pos[2], 2));
price = static_cast<int>(d / gmst.find("fTravelMult")->getFloat()); price = static_cast<int>(d / gmst.find("fTravelMult")->mValue.getFloat());
} }
price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, price, true); price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, price, true);
@ -176,7 +176,7 @@ namespace MWGui
{ {
ESM::Position playerPos = player.getRefData().getPosition(); ESM::Position playerPos = player.getRefData().getPosition();
float d = (osg::Vec3f(pos.pos[0], pos.pos[1], 0) - osg::Vec3f(playerPos.pos[0], playerPos.pos[1], 0)).length(); float d = (osg::Vec3f(pos.pos[0], pos.pos[1], 0) - osg::Vec3f(playerPos.pos[0], playerPos.pos[1], 0)).length();
int hours = static_cast<int>(d /MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fTravelTimeMult")->getFloat()); int hours = static_cast<int>(d /MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fTravelTimeMult")->mValue.getFloat());
for(int i = 0;i < hours;i++) for(int i = 0;i < hours;i++)
{ {
MWBase::Environment::get().getMechanicsManager ()->rest (true); MWBase::Environment::get().getMechanicsManager ()->rest (true);

@ -183,10 +183,10 @@ namespace MWGui
{ {
// figure out if player will be woken while sleeping // figure out if player will be woken while sleeping
int x = Misc::Rng::rollDice(hoursToWait); int x = Misc::Rng::rollDice(hoursToWait);
float fSleepRandMod = world->getStore().get<ESM::GameSetting>().find("fSleepRandMod")->getFloat(); float fSleepRandMod = world->getStore().get<ESM::GameSetting>().find("fSleepRandMod")->mValue.getFloat();
if (x < fSleepRandMod * hoursToWait) if (x < fSleepRandMod * hoursToWait)
{ {
float fSleepRestMod = world->getStore().get<ESM::GameSetting>().find("fSleepRestMod")->getFloat(); float fSleepRestMod = world->getStore().get<ESM::GameSetting>().find("fSleepRestMod")->mValue.getFloat();
int interruptAtHoursRemaining = int(fSleepRestMod * hoursToWait); int interruptAtHoursRemaining = int(fSleepRestMod * hoursToWait);
if (interruptAtHoursRemaining != 0) if (interruptAtHoursRemaining != 0)
{ {
@ -252,7 +252,7 @@ namespace MWGui
// trigger levelup if possible // trigger levelup if possible
const MWWorld::Store<ESM::GameSetting> &gmst = const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
if (mSleeping && pcstats.getLevelProgress () >= gmst.find("iLevelUpTotal")->getInt()) if (mSleeping && pcstats.getLevelProgress () >= gmst.find("iLevelUpTotal")->mValue.getInteger())
{ {
MWBase::Environment::get().getWindowManager()->pushGuiMode (GM_Levelup); MWBase::Environment::get().getWindowManager()->pushGuiMode (GM_Levelup);
} }

@ -358,7 +358,7 @@ namespace MWGui
mGuiModeStates[GM_Journal].mCloseSound = "book close"; mGuiModeStates[GM_Journal].mCloseSound = "book close";
mGuiModeStates[GM_Journal].mOpenSound = "book open"; mGuiModeStates[GM_Journal].mOpenSound = "book open";
mMessageBoxManager = new MessageBoxManager(mStore->get<ESM::GameSetting>().find("fMessageTimePerChar")->getFloat()); mMessageBoxManager = new MessageBoxManager(mStore->get<ESM::GameSetting>().find("fMessageTimePerChar")->mValue.getFloat());
SpellBuyingWindow* spellBuyingWindow = new SpellBuyingWindow(); SpellBuyingWindow* spellBuyingWindow = new SpellBuyingWindow();
mWindows.push_back(spellBuyingWindow); mWindows.push_back(spellBuyingWindow);

@ -1192,7 +1192,7 @@ namespace MWInput
void InputManager::updateIdleTime(float dt) void InputManager::updateIdleTime(float dt)
{ {
static const float vanityDelay = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() static const float vanityDelay = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fVanityDelay")->getFloat(); .find("fVanityDelay")->mValue.getFloat();
if (mTimeIdle >= 0.f) if (mTimeIdle >= 0.f)
mTimeIdle += dt; mTimeIdle += dt;
if (mTimeIdle > vanityDelay) { if (mTimeIdle > vanityDelay) {

@ -54,22 +54,22 @@ int getBoundItemSlot (const std::string& itemId)
static std::map<std::string, int> boundItemsMap; static std::map<std::string, int> boundItemsMap;
if (boundItemsMap.empty()) if (boundItemsMap.empty())
{ {
std::string boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundBootsID")->getString(); std::string boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundBootsID")->mValue.getString();
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Boots; boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Boots;
boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundCuirassID")->getString(); boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundCuirassID")->mValue.getString();
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Cuirass; boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Cuirass;
boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundLeftGauntletID")->getString(); boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundLeftGauntletID")->mValue.getString();
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_LeftGauntlet; boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_LeftGauntlet;
boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundRightGauntletID")->getString(); boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundRightGauntletID")->mValue.getString();
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_RightGauntlet; boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_RightGauntlet;
boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundHelmID")->getString(); boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundHelmID")->mValue.getString();
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Helmet; boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Helmet;
boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundShieldID")->getString(); boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundShieldID")->mValue.getString();
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_CarriedLeft; boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_CarriedLeft;
} }
@ -138,7 +138,7 @@ void getRestorationPerHourOfSleep (const MWWorld::Ptr& ptr, float& health, float
magicka = 0; magicka = 0;
if (!stunted) if (!stunted)
{ {
float fRestMagicMult = settings.find("fRestMagicMult")->getFloat (); float fRestMagicMult = settings.find("fRestMagicMult")->mValue.getFloat ();
magicka = fRestMagicMult * stats.getAttribute(ESM::Attribute::Intelligence).getModified(); magicka = fRestMagicMult * stats.getAttribute(ESM::Attribute::Intelligence).getModified();
} }
} }
@ -179,7 +179,7 @@ namespace MWMechanics
if (caster.isEmpty() || !caster.getClass().isActor()) if (caster.isEmpty() || !caster.getClass().isActor())
return; return;
static const float fSoulgemMult = world->getStore().get<ESM::GameSetting>().find("fSoulgemMult")->getFloat(); static const float fSoulgemMult = world->getStore().get<ESM::GameSetting>().find("fSoulgemMult")->mValue.getFloat();
int creatureSoulValue = mCreature.get<ESM::Creature>()->mBase->mData.mSoul; int creatureSoulValue = mCreature.get<ESM::Creature>()->mBase->mData.mSoul;
if (creatureSoulValue == 0) if (creatureSoulValue == 0)
@ -313,9 +313,9 @@ namespace MWMechanics
MWWorld::Ptr& headTrackTarget, float& sqrHeadTrackDistance) MWWorld::Ptr& headTrackTarget, float& sqrHeadTrackDistance)
{ {
static const float fMaxHeadTrackDistance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() static const float fMaxHeadTrackDistance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fMaxHeadTrackDistance")->getFloat(); .find("fMaxHeadTrackDistance")->mValue.getFloat();
static const float fInteriorHeadTrackMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() static const float fInteriorHeadTrackMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fInteriorHeadTrackMult")->getFloat(); .find("fInteriorHeadTrackMult")->mValue.getFloat();
float maxDistance = fMaxHeadTrackDistance; float maxDistance = fMaxHeadTrackDistance;
const ESM::Cell* currentCell = actor.getCell()->getCell(); const ESM::Cell* currentCell = actor.getCell()->getCell();
if (!currentCell->isExterior() && !(currentCell->mData.mFlags & ESM::Cell::QuasiEx)) if (!currentCell->isExterior() && !(currentCell->mData.mFlags & ESM::Cell::QuasiEx))
@ -470,7 +470,7 @@ namespace MWMechanics
if (actor1.getClass().isClass(actor1, "Guard") && !actor2.getClass().isNpc()) if (actor1.getClass().isClass(actor1, "Guard") && !actor2.getClass().isNpc())
{ {
// Check if the creature is too far // Check if the creature is too far
static const float fAlarmRadius = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fAlarmRadius")->getFloat(); static const float fAlarmRadius = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fAlarmRadius")->mValue.getFloat();
if (sqrDist > fAlarmRadius * fAlarmRadius) if (sqrDist > fAlarmRadius * fAlarmRadius)
return; return;
@ -534,9 +534,9 @@ namespace MWMechanics
float base = 1.f; float base = 1.f;
if (ptr == getPlayer()) if (ptr == getPlayer())
base = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fPCbaseMagickaMult")->getFloat(); base = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fPCbaseMagickaMult")->mValue.getFloat();
else else
base = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fNPCbaseMagickaMult")->getFloat(); base = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fNPCbaseMagickaMult")->mValue.getFloat();
double magickaFactor = base + double magickaFactor = base +
creatureStats.getMagicEffects().get (EffectKey (ESM::MagicEffect::FortifyMaximumMagicka)).getMagnitude() * 0.1; creatureStats.getMagicEffects().get (EffectKey (ESM::MagicEffect::FortifyMaximumMagicka)).getMagnitude() * 0.1;
@ -584,9 +584,9 @@ namespace MWMechanics
return; return;
// Restore fatigue // Restore fatigue
float fFatigueReturnBase = settings.find("fFatigueReturnBase")->getFloat (); float fFatigueReturnBase = settings.find("fFatigueReturnBase")->mValue.getFloat ();
float fFatigueReturnMult = settings.find("fFatigueReturnMult")->getFloat (); float fFatigueReturnMult = settings.find("fFatigueReturnMult")->mValue.getFloat ();
float fEndFatigueMult = settings.find("fEndFatigueMult")->getFloat (); float fEndFatigueMult = settings.find("fEndFatigueMult")->mValue.getFloat ();
float x = fFatigueReturnBase + fFatigueReturnMult * (1 - normalizedEncumbrance); float x = fFatigueReturnBase + fFatigueReturnMult * (1 - normalizedEncumbrance);
x *= fEndFatigueMult * endurance; x *= fEndFatigueMult * endurance;
@ -611,8 +611,8 @@ namespace MWMechanics
// Restore fatigue // Restore fatigue
int endurance = stats.getAttribute(ESM::Attribute::Endurance).getModified(); int endurance = stats.getAttribute(ESM::Attribute::Endurance).getModified();
const MWWorld::Store<ESM::GameSetting>& settings = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& settings = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
static const float fFatigueReturnBase = settings.find("fFatigueReturnBase")->getFloat (); static const float fFatigueReturnBase = settings.find("fFatigueReturnBase")->mValue.getFloat ();
static const float fFatigueReturnMult = settings.find("fFatigueReturnMult")->getFloat (); static const float fFatigueReturnMult = settings.find("fFatigueReturnMult")->mValue.getFloat ();
float x = fFatigueReturnBase + fFatigueReturnMult * endurance; float x = fFatigueReturnBase + fFatigueReturnMult * endurance;
@ -853,14 +853,14 @@ namespace MWMechanics
std::string itemGmst = it->second; std::string itemGmst = it->second;
std::string item = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find( std::string item = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
itemGmst)->getString(); itemGmst)->mValue.getString();
magnitude > 0 ? addBoundItem(item, ptr) : removeBoundItem(item, ptr); magnitude > 0 ? addBoundItem(item, ptr) : removeBoundItem(item, ptr);
if (it->first == ESM::MagicEffect::BoundGloves) if (it->first == ESM::MagicEffect::BoundGloves)
{ {
item = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find( item = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
"sMagicBoundRightGauntletID")->getString(); "sMagicBoundRightGauntletID")->mValue.getString();
magnitude > 0 ? addBoundItem(item, ptr) : removeBoundItem(item, ptr); magnitude > 0 ? addBoundItem(item, ptr) : removeBoundItem(item, ptr);
} }
} }
@ -936,7 +936,7 @@ namespace MWMechanics
NpcStats &stats = ptr.getClass().getNpcStats(ptr); NpcStats &stats = ptr.getClass().getNpcStats(ptr);
// When npc stats are just initialized, mTimeToStartDrowning == -1 and we should get value from GMST // When npc stats are just initialized, mTimeToStartDrowning == -1 and we should get value from GMST
static const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fHoldBreathTime")->getFloat(); static const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fHoldBreathTime")->mValue.getFloat();
if (stats.getTimeToStartDrowning() == -1.f) if (stats.getTimeToStartDrowning() == -1.f)
stats.setTimeToStartDrowning(fHoldBreathTime); stats.setTimeToStartDrowning(fHoldBreathTime);
@ -970,7 +970,7 @@ namespace MWMechanics
if(timeLeft == 0.0f && !godmode) if(timeLeft == 0.0f && !godmode)
{ {
// If drowning, apply 3 points of damage per second // If drowning, apply 3 points of damage per second
static const float fSuffocationDamage = world->getStore().get<ESM::GameSetting>().find("fSuffocationDamage")->getFloat(); static const float fSuffocationDamage = world->getStore().get<ESM::GameSetting>().find("fSuffocationDamage")->mValue.getFloat();
DynamicStat<float> health = stats.getHealth(); DynamicStat<float> health = stats.getHealth();
health.setCurrent(health.getCurrent() - fSuffocationDamage*duration); health.setCurrent(health.getCurrent() - fSuffocationDamage*duration);
stats.setHealth(health); stats.setHealth(health);
@ -1096,7 +1096,7 @@ namespace MWMechanics
&& creatureStats.getMagicEffects().get(ESM::MagicEffect::CalmHumanoid).getMagnitude() == 0) && creatureStats.getMagicEffects().get(ESM::MagicEffect::CalmHumanoid).getMagnitude() == 0)
{ {
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
static const int cutoff = esmStore.get<ESM::GameSetting>().find("iCrimeThreshold")->getInt(); static const int cutoff = esmStore.get<ESM::GameSetting>().find("iCrimeThreshold")->mValue.getInteger();
// Force dialogue on sight if bounty is greater than the cutoff // Force dialogue on sight if bounty is greater than the cutoff
// In vanilla morrowind, the greeting dialogue is scripted to either arrest the player (< 5000 bounty) or attack (>= 5000 bounty) // In vanilla morrowind, the greeting dialogue is scripted to either arrest the player (< 5000 bounty) or attack (>= 5000 bounty)
if ( player.getClass().getNpcStats(player).getBounty() >= cutoff if ( player.getClass().getNpcStats(player).getBounty() >= cutoff
@ -1104,7 +1104,7 @@ namespace MWMechanics
&& MWBase::Environment::get().getWorld()->getLOS(ptr, player) && MWBase::Environment::get().getWorld()->getLOS(ptr, player)
&& MWBase::Environment::get().getMechanicsManager()->awarenessCheck(player, ptr)) && MWBase::Environment::get().getMechanicsManager()->awarenessCheck(player, ptr))
{ {
static const int iCrimeThresholdMultiplier = esmStore.get<ESM::GameSetting>().find("iCrimeThresholdMultiplier")->getInt(); static const int iCrimeThresholdMultiplier = esmStore.get<ESM::GameSetting>().find("iCrimeThresholdMultiplier")->mValue.getInteger();
if (player.getClass().getNpcStats(player).getBounty() >= cutoff * iCrimeThresholdMultiplier) if (player.getClass().getNpcStats(player).getBounty() >= cutoff * iCrimeThresholdMultiplier)
{ {
MWBase::Environment::get().getMechanicsManager()->startCombat(ptr, player); MWBase::Environment::get().getMechanicsManager()->startCombat(ptr, player);
@ -1487,9 +1487,9 @@ namespace MWMechanics
static float sneakSkillTimer = 0.f; // times sneak skill progress from "avoid notice" static float sneakSkillTimer = 0.f; // times sneak skill progress from "avoid notice"
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
const int radius = esmStore.get<ESM::GameSetting>().find("fSneakUseDist")->getInt(); const int radius = esmStore.get<ESM::GameSetting>().find("fSneakUseDist")->mValue.getInteger();
static float fSneakUseDelay = esmStore.get<ESM::GameSetting>().find("fSneakUseDelay")->getFloat(); static float fSneakUseDelay = esmStore.get<ESM::GameSetting>().find("fSneakUseDelay")->mValue.getFloat();
if (sneakTimer >= fSneakUseDelay) if (sneakTimer >= fSneakUseDelay)
sneakTimer = 0.f; sneakTimer = 0.f;

@ -19,7 +19,7 @@ MWMechanics::AiBreathe::AiBreathe()
bool MWMechanics::AiBreathe::execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) bool MWMechanics::AiBreathe::execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration)
{ {
static const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fHoldBreathTime")->getFloat(); static const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fHoldBreathTime")->mValue.getFloat();
const MWWorld::Class& actorClass = actor.getClass(); const MWWorld::Class& actorClass = actor.getClass();
if (actorClass.isNpc()) if (actorClass.isNpc())

@ -351,7 +351,7 @@ namespace MWMechanics
case AiCombatStorage::FleeState_RunToDestination: case AiCombatStorage::FleeState_RunToDestination:
{ {
static const float fFleeDistance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fFleeDistance")->getFloat(); static const float fFleeDistance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fFleeDistance")->mValue.getFloat();
float dist = (actor.getRefData().getPosition().asVec3() - target.getRefData().getPosition().asVec3()).length(); float dist = (actor.getRefData().getPosition().asVec3() - target.getRefData().getPosition().asVec3()).length();
if ((dist > fFleeDistance && !storage.mLOS) if ((dist > fFleeDistance && !storage.mLOS)
@ -520,13 +520,13 @@ namespace MWMechanics
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
float baseDelay = store.get<ESM::GameSetting>().find("fCombatDelayCreature")->getFloat(); float baseDelay = store.get<ESM::GameSetting>().find("fCombatDelayCreature")->mValue.getFloat();
if (actor.getClass().isNpc()) if (actor.getClass().isNpc())
{ {
baseDelay = store.get<ESM::GameSetting>().find("fCombatDelayNPC")->getFloat(); baseDelay = store.get<ESM::GameSetting>().find("fCombatDelayNPC")->mValue.getFloat();
//say a provoking combat phrase //say a provoking combat phrase
int chance = store.get<ESM::GameSetting>().find("iVoiceAttackOdds")->getInt(); int chance = store.get<ESM::GameSetting>().find("iVoiceAttackOdds")->mValue.getInteger();
if (Misc::Rng::roll0to99() < chance) if (Misc::Rng::roll0to99() < chance)
{ {
MWBase::Environment::get().getDialogueManager()->say(actor, "attack"); MWBase::Environment::get().getDialogueManager()->say(actor, "attack");
@ -616,21 +616,21 @@ osg::Vec3f AimDirToMovingTarget(const MWWorld::Ptr& actor, const MWWorld::Ptr& t
// get projectile speed (depending on weapon type) // get projectile speed (depending on weapon type)
if (weapType == ESM::Weapon::MarksmanThrown) if (weapType == ESM::Weapon::MarksmanThrown)
{ {
static float fThrownWeaponMinSpeed = gmst.find("fThrownWeaponMinSpeed")->getFloat(); static float fThrownWeaponMinSpeed = gmst.find("fThrownWeaponMinSpeed")->mValue.getFloat();
static float fThrownWeaponMaxSpeed = gmst.find("fThrownWeaponMaxSpeed")->getFloat(); static float fThrownWeaponMaxSpeed = gmst.find("fThrownWeaponMaxSpeed")->mValue.getFloat();
projSpeed = fThrownWeaponMinSpeed + (fThrownWeaponMaxSpeed - fThrownWeaponMinSpeed) * strength; projSpeed = fThrownWeaponMinSpeed + (fThrownWeaponMaxSpeed - fThrownWeaponMinSpeed) * strength;
} }
else if (weapType != 0) else if (weapType != 0)
{ {
static float fProjectileMinSpeed = gmst.find("fProjectileMinSpeed")->getFloat(); static float fProjectileMinSpeed = gmst.find("fProjectileMinSpeed")->mValue.getFloat();
static float fProjectileMaxSpeed = gmst.find("fProjectileMaxSpeed")->getFloat(); static float fProjectileMaxSpeed = gmst.find("fProjectileMaxSpeed")->mValue.getFloat();
projSpeed = fProjectileMinSpeed + (fProjectileMaxSpeed - fProjectileMinSpeed) * strength; projSpeed = fProjectileMinSpeed + (fProjectileMaxSpeed - fProjectileMinSpeed) * strength;
} }
else // weapType is 0 ==> it's a target spell projectile else // weapType is 0 ==> it's a target spell projectile
{ {
projSpeed = gmst.find("fTargetSpellMaxSpeed")->getFloat(); projSpeed = gmst.find("fTargetSpellMaxSpeed")->mValue.getFloat();
} }
// idea: perpendicular to dir to target speed components of target move vector and projectile vector should be the same // idea: perpendicular to dir to target speed components of target move vector and projectile vector should be the same

@ -23,8 +23,8 @@ namespace MWMechanics
{ {
float suggestCombatRange(int rangeTypes) float suggestCombatRange(int rangeTypes)
{ {
static const float fCombatDistance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fCombatDistance")->getFloat(); static const float fCombatDistance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fCombatDistance")->mValue.getFloat();
static float fHandToHandReach = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fHandToHandReach")->getFloat(); static float fHandToHandReach = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fHandToHandReach")->mValue.getFloat();
// This distance is a possible distance of melee attack // This distance is a possible distance of melee attack
static float distance = fCombatDistance * std::max(2.f, fHandToHandReach); static float distance = fCombatDistance * std::max(2.f, fHandToHandReach);
@ -114,13 +114,13 @@ namespace MWMechanics
{ {
isRanged = false; isRanged = false;
static const float fCombatDistance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fCombatDistance")->getFloat(); static const float fCombatDistance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fCombatDistance")->mValue.getFloat();
static const float fProjectileMaxSpeed = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fProjectileMaxSpeed")->getFloat(); static const float fProjectileMaxSpeed = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fProjectileMaxSpeed")->mValue.getFloat();
if (mWeapon.isEmpty()) if (mWeapon.isEmpty())
{ {
static float fHandToHandReach = static float fHandToHandReach =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fHandToHandReach")->getFloat(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fHandToHandReach")->mValue.getFloat();
return fHandToHandReach * fCombatDistance; return fHandToHandReach * fCombatDistance;
} }
@ -336,7 +336,7 @@ namespace MWMechanics
float dist = 1.0f; float dist = 1.0f;
if (activeWeapon.isEmpty() && !selectedSpellId.empty() && !selectedEnchItem.isEmpty()) if (activeWeapon.isEmpty() && !selectedSpellId.empty() && !selectedEnchItem.isEmpty())
{ {
static const float fHandToHandReach = gmst.find("fHandToHandReach")->getFloat(); static const float fHandToHandReach = gmst.find("fHandToHandReach")->mValue.getFloat();
dist = fHandToHandReach; dist = fHandToHandReach;
} }
else if (stats.getDrawState() == MWMechanics::DrawState_Spell) else if (stats.getDrawState() == MWMechanics::DrawState_Spell)
@ -375,7 +375,7 @@ namespace MWMechanics
} }
} }
static const float fTargetSpellMaxSpeed = gmst.find("fTargetSpellMaxSpeed")->getFloat(); static const float fTargetSpellMaxSpeed = gmst.find("fTargetSpellMaxSpeed")->mValue.getFloat();
dist *= std::max(1000.0f, fTargetSpellMaxSpeed); dist *= std::max(1000.0f, fTargetSpellMaxSpeed);
} }
else if (!activeWeapon.isEmpty()) else if (!activeWeapon.isEmpty())
@ -383,7 +383,7 @@ namespace MWMechanics
const ESM::Weapon* esmWeap = activeWeapon.get<ESM::Weapon>()->mBase; const ESM::Weapon* esmWeap = activeWeapon.get<ESM::Weapon>()->mBase;
if (esmWeap->mData.mType >= ESM::Weapon::MarksmanBow) if (esmWeap->mData.mType >= ESM::Weapon::MarksmanBow)
{ {
static const float fTargetSpellMaxSpeed = gmst.find("fProjectileMaxSpeed")->getFloat(); static const float fTargetSpellMaxSpeed = gmst.find("fProjectileMaxSpeed")->mValue.getFloat();
dist = fTargetSpellMaxSpeed; dist = fTargetSpellMaxSpeed;
if (!activeAmmo.isEmpty()) if (!activeAmmo.isEmpty())
{ {
@ -399,8 +399,8 @@ namespace MWMechanics
dist = (dist > 0.f) ? dist : 1.0f; dist = (dist > 0.f) ? dist : 1.0f;
static const float fCombatDistance = gmst.find("fCombatDistance")->getFloat(); static const float fCombatDistance = gmst.find("fCombatDistance")->mValue.getFloat();
static const float fCombatDistanceWerewolfMod = gmst.find("fCombatDistanceWerewolfMod")->getFloat(); static const float fCombatDistanceWerewolfMod = gmst.find("fCombatDistanceWerewolfMod")->mValue.getFloat();
float combatDistance = fCombatDistance; float combatDistance = fCombatDistance;
if (actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) if (actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
@ -485,20 +485,20 @@ namespace MWMechanics
if (flee >= 100) if (flee >= 100)
return flee; return flee;
static const float fAIFleeHealthMult = gmst.find("fAIFleeHealthMult")->getFloat(); static const float fAIFleeHealthMult = gmst.find("fAIFleeHealthMult")->mValue.getFloat();
static const float fAIFleeFleeMult = gmst.find("fAIFleeFleeMult")->getFloat(); static const float fAIFleeFleeMult = gmst.find("fAIFleeFleeMult")->mValue.getFloat();
float healthPercentage = (stats.getHealth().getModified() == 0.0f) float healthPercentage = (stats.getHealth().getModified() == 0.0f)
? 1.0f : stats.getHealth().getCurrent() / stats.getHealth().getModified(); ? 1.0f : stats.getHealth().getCurrent() / stats.getHealth().getModified();
float rating = (1.0f - healthPercentage) * fAIFleeHealthMult + flee * fAIFleeFleeMult; float rating = (1.0f - healthPercentage) * fAIFleeHealthMult + flee * fAIFleeFleeMult;
static const int iWereWolfLevelToAttack = gmst.find("iWereWolfLevelToAttack")->getInt(); static const int iWereWolfLevelToAttack = gmst.find("iWereWolfLevelToAttack")->mValue.getInteger();
if (actor.getClass().isNpc() && enemy.getClass().isNpc()) if (actor.getClass().isNpc() && enemy.getClass().isNpc())
{ {
if (enemy.getClass().getNpcStats(enemy).isWerewolf() && stats.getLevel() < iWereWolfLevelToAttack) if (enemy.getClass().getNpcStats(enemy).isWerewolf() && stats.getLevel() < iWereWolfLevelToAttack)
{ {
static const int iWereWolfFleeMod = gmst.find("iWereWolfFleeMod")->getInt(); static const int iWereWolfFleeMod = gmst.find("iWereWolfFleeMod")->mValue.getInteger();
rating = iWereWolfFleeMod; rating = iWereWolfFleeMod;
} }
} }

@ -495,7 +495,7 @@ namespace MWMechanics
MWWorld::Ptr player = getPlayer(); MWWorld::Ptr player = getPlayer();
static float fVoiceIdleOdds = MWBase::Environment::get().getWorld()->getStore() static float fVoiceIdleOdds = MWBase::Environment::get().getWorld()->getStore()
.get<ESM::GameSetting>().find("fVoiceIdleOdds")->getFloat(); .get<ESM::GameSetting>().find("fVoiceIdleOdds")->mValue.getFloat();
float roll = Misc::Rng::rollProbability() * 10000.0f; float roll = Misc::Rng::rollProbability() * 10000.0f;
@ -522,7 +522,7 @@ namespace MWMechanics
int hello = actor.getClass().getCreatureStats(actor).getAiSetting(CreatureStats::AI_Hello).getModified(); int hello = actor.getClass().getCreatureStats(actor).getAiSetting(CreatureStats::AI_Hello).getModified();
float helloDistance = static_cast<float>(hello); float helloDistance = static_cast<float>(hello);
static int iGreetDistanceMultiplier = MWBase::Environment::get().getWorld()->getStore() static int iGreetDistanceMultiplier = MWBase::Environment::get().getWorld()->getStore()
.get<ESM::GameSetting>().find("iGreetDistanceMultiplier")->getInt(); .get<ESM::GameSetting>().find("iGreetDistanceMultiplier")->mValue.getInteger();
helloDistance *= iGreetDistanceMultiplier; helloDistance *= iGreetDistanceMultiplier;
@ -700,7 +700,7 @@ namespace MWMechanics
for(unsigned int counter = 0; counter < mIdle.size(); counter++) for(unsigned int counter = 0; counter < mIdle.size(); counter++)
{ {
static float fIdleChanceMultiplier = MWBase::Environment::get().getWorld()->getStore() static float fIdleChanceMultiplier = MWBase::Environment::get().getWorld()->getStore()
.get<ESM::GameSetting>().find("fIdleChanceMultiplier")->getFloat(); .get<ESM::GameSetting>().find("fIdleChanceMultiplier")->mValue.getFloat();
unsigned short idleChance = static_cast<unsigned short>(fIdleChanceMultiplier * mIdle[counter]); unsigned short idleChance = static_cast<unsigned short>(fIdleChanceMultiplier * mIdle[counter]);
unsigned short randSelect = (int)(Misc::Rng::rollProbability() * int(100 / fIdleChanceMultiplier)); unsigned short randSelect = (int)(Misc::Rng::rollProbability() * int(100 / fIdleChanceMultiplier));

@ -140,11 +140,11 @@ void MWMechanics::Alchemy::updateEffects()
float x = getAlchemyFactor(); float x = getAlchemyFactor();
x *= mTools[ESM::Apparatus::MortarPestle].get<ESM::Apparatus>()->mBase->mData.mQuality; x *= mTools[ESM::Apparatus::MortarPestle].get<ESM::Apparatus>()->mBase->mData.mQuality;
x *= MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionStrengthMult")->getFloat(); x *= MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionStrengthMult")->mValue.getFloat();
// value // value
mValue = static_cast<int> ( mValue = static_cast<int> (
x * MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("iAlchemyMod")->getFloat()); x * MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("iAlchemyMod")->mValue.getFloat());
// build quantified effect list // build quantified effect list
for (std::set<EffectKey>::const_iterator iter (effects.begin()); iter!=effects.end(); ++iter) for (std::set<EffectKey>::const_iterator iter (effects.begin()); iter!=effects.end(); ++iter)
@ -160,13 +160,13 @@ void MWMechanics::Alchemy::updateEffects()
} }
float fPotionT1MagMul = float fPotionT1MagMul =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionT1MagMult")->getFloat(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionT1MagMult")->mValue.getFloat();
if (fPotionT1MagMul<=0) if (fPotionT1MagMul<=0)
throw std::runtime_error ("invalid gmst: fPotionT1MagMul"); throw std::runtime_error ("invalid gmst: fPotionT1MagMul");
float fPotionT1DurMult = float fPotionT1DurMult =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionT1DurMult")->getFloat(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionT1DurMult")->mValue.getFloat();
if (fPotionT1DurMult<=0) if (fPotionT1DurMult<=0)
throw std::runtime_error ("invalid gmst: fPotionT1DurMult"); throw std::runtime_error ("invalid gmst: fPotionT1DurMult");
@ -449,7 +449,7 @@ bool MWMechanics::Alchemy::knownEffect(unsigned int potionEffectIndex, const MWW
MWMechanics::NpcStats& npcStats = npc.getClass().getNpcStats(npc); MWMechanics::NpcStats& npcStats = npc.getClass().getNpcStats(npc);
int alchemySkill = npcStats.getSkill (ESM::Skill::Alchemy).getBase(); int alchemySkill = npcStats.getSkill (ESM::Skill::Alchemy).getBase();
static const float fWortChanceValue = static const float fWortChanceValue =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fWortChanceValue")->getFloat(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fWortChanceValue")->mValue.getFloat();
return (potionEffectIndex <= 1 && alchemySkill >= fWortChanceValue) return (potionEffectIndex <= 1 && alchemySkill >= fWortChanceValue)
|| (potionEffectIndex <= 3 && alchemySkill >= fWortChanceValue*2) || (potionEffectIndex <= 3 && alchemySkill >= fWortChanceValue*2)
|| (potionEffectIndex <= 5 && alchemySkill >= fWortChanceValue*3) || (potionEffectIndex <= 5 && alchemySkill >= fWortChanceValue*3)
@ -503,5 +503,5 @@ std::string MWMechanics::Alchemy::suggestPotionName()
int effectId = effects.begin()->mId; int effectId = effects.begin()->mId;
return MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find( return MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
ESM::MagicEffect::effectIdToString(effectId))->getString(); ESM::MagicEffect::effectIdToString(effectId))->mValue.getString();
} }

@ -25,7 +25,7 @@ namespace MWMechanics
std::vector<std::string> autoCalcNpcSpells(const int *actorSkills, const int *actorAttributes, const ESM::Race* race) std::vector<std::string> autoCalcNpcSpells(const int *actorSkills, const int *actorAttributes, const ESM::Race* race)
{ {
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
static const float fNPCbaseMagickaMult = gmst.find("fNPCbaseMagickaMult")->getFloat(); static const float fNPCbaseMagickaMult = gmst.find("fNPCbaseMagickaMult")->mValue.getFloat();
float baseMagicka = fNPCbaseMagickaMult * actorAttributes[ESM::Attribute::Intelligence]; float baseMagicka = fNPCbaseMagickaMult * actorAttributes[ESM::Attribute::Intelligence];
static const std::string schools[] = { static const std::string schools[] = {
@ -38,7 +38,7 @@ namespace MWMechanics
for (int i=0; i<6; ++i) for (int i=0; i<6; ++i)
{ {
const std::string& gmstName = "iAutoSpell" + schools[i] + "Max"; const std::string& gmstName = "iAutoSpell" + schools[i] + "Max";
iAutoSpellSchoolMax[i] = gmst.find(gmstName)->getInt(); iAutoSpellSchoolMax[i] = gmst.find(gmstName)->mValue.getInteger();
} }
init = true; init = true;
} }
@ -70,7 +70,7 @@ namespace MWMechanics
continue; continue;
if (!(spell->mData.mFlags & ESM::Spell::F_Autocalc)) if (!(spell->mData.mFlags & ESM::Spell::F_Autocalc))
continue; continue;
static const int iAutoSpellTimesCanCast = gmst.find("iAutoSpellTimesCanCast")->getInt(); static const int iAutoSpellTimesCanCast = gmst.find("iAutoSpellTimesCanCast")->mValue.getInteger();
if (baseMagicka < iAutoSpellTimesCanCast * spell->mData.mCost) if (baseMagicka < iAutoSpellTimesCanCast * spell->mData.mCost)
continue; continue;
@ -89,7 +89,7 @@ namespace MWMechanics
if (cap.mReachedLimit && spell->mData.mCost <= cap.mMinCost) if (cap.mReachedLimit && spell->mData.mCost <= cap.mMinCost)
continue; continue;
static const float fAutoSpellChance = gmst.find("fAutoSpellChance")->getFloat(); static const float fAutoSpellChance = gmst.find("fAutoSpellChance")->mValue.getFloat();
if (calcAutoCastChance(spell, actorSkills, actorAttributes, school) < fAutoSpellChance) if (calcAutoCastChance(spell, actorSkills, actorAttributes, school) < fAutoSpellChance)
continue; continue;
@ -146,7 +146,7 @@ namespace MWMechanics
{ {
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
static const float fPCbaseMagickaMult = esmStore.get<ESM::GameSetting>().find("fPCbaseMagickaMult")->getFloat(); static const float fPCbaseMagickaMult = esmStore.get<ESM::GameSetting>().find("fPCbaseMagickaMult")->mValue.getFloat();
float baseMagicka = fPCbaseMagickaMult * actorAttributes[ESM::Attribute::Intelligence]; float baseMagicka = fPCbaseMagickaMult * actorAttributes[ESM::Attribute::Intelligence];
bool reachedLimit = false; bool reachedLimit = false;
@ -173,7 +173,7 @@ namespace MWMechanics
if (baseMagicka < spell->mData.mCost) if (baseMagicka < spell->mData.mCost)
continue; continue;
static const float fAutoPCSpellChance = esmStore.get<ESM::GameSetting>().find("fAutoPCSpellChance")->getFloat(); static const float fAutoPCSpellChance = esmStore.get<ESM::GameSetting>().find("fAutoPCSpellChance")->mValue.getFloat();
if (calcAutoCastChance(spell, actorSkills, actorAttributes, -1) < fAutoPCSpellChance) if (calcAutoCastChance(spell, actorSkills, actorAttributes, -1) < fAutoPCSpellChance)
continue; continue;
@ -206,7 +206,7 @@ namespace MWMechanics
weakestSpell = spell; weakestSpell = spell;
minCost = weakestSpell->mData.mCost; minCost = weakestSpell->mData.mCost;
} }
static const unsigned int iAutoPCSpellMax = esmStore.get<ESM::GameSetting>().find("iAutoPCSpellMax")->getInt(); static const unsigned int iAutoPCSpellMax = esmStore.get<ESM::GameSetting>().find("iAutoPCSpellMax")->mValue.getInteger();
if (selectedSpells.size() == iAutoPCSpellMax) if (selectedSpells.size() == iAutoPCSpellMax)
reachedLimit = true; reachedLimit = true;
} }
@ -221,7 +221,7 @@ namespace MWMechanics
for (std::vector<ESM::ENAMstruct>::const_iterator effectIt = effects.begin(); effectIt != effects.end(); ++effectIt) for (std::vector<ESM::ENAMstruct>::const_iterator effectIt = effects.begin(); effectIt != effects.end(); ++effectIt)
{ {
const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find(effectIt->mEffectID); const ESM::MagicEffect* magicEffect = MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find(effectIt->mEffectID);
static const int iAutoSpellAttSkillMin = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iAutoSpellAttSkillMin")->getInt(); static const int iAutoSpellAttSkillMin = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iAutoSpellAttSkillMin")->mValue.getInteger();
if ((magicEffect->mData.mFlags & ESM::MagicEffect::TargetSkill)) if ((magicEffect->mData.mFlags & ESM::MagicEffect::TargetSkill))
{ {
@ -278,7 +278,7 @@ namespace MWMechanics
duration = effect.mDuration; duration = effect.mDuration;
static const float fEffectCostMult = MWBase::Environment::get().getWorld()->getStore() static const float fEffectCostMult = MWBase::Environment::get().getWorld()->getStore()
.get<ESM::GameSetting>().find("fEffectCostMult")->getFloat(); .get<ESM::GameSetting>().find("fEffectCostMult")->mValue.getFloat();
float x = 0.5 * (std::max(1, minMagn) + std::max(1, maxMagn)); float x = 0.5 * (std::max(1, minMagn) + std::max(1, maxMagn));
x *= 0.1 * magicEffect->mData.mBaseCost; x *= 0.1 * magicEffect->mData.mBaseCost;

@ -123,16 +123,16 @@ float getFallDamage(const MWWorld::Ptr& ptr, float fallHeight)
MWBase::World *world = MWBase::Environment::get().getWorld(); MWBase::World *world = MWBase::Environment::get().getWorld();
const MWWorld::Store<ESM::GameSetting> &store = world->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting> &store = world->getStore().get<ESM::GameSetting>();
const float fallDistanceMin = store.find("fFallDamageDistanceMin")->getFloat(); const float fallDistanceMin = store.find("fFallDamageDistanceMin")->mValue.getFloat();
if (fallHeight >= fallDistanceMin) if (fallHeight >= fallDistanceMin)
{ {
const float acrobaticsSkill = static_cast<float>(ptr.getClass().getSkill(ptr, ESM::Skill::Acrobatics)); const float acrobaticsSkill = static_cast<float>(ptr.getClass().getSkill(ptr, ESM::Skill::Acrobatics));
const float jumpSpellBonus = ptr.getClass().getCreatureStats(ptr).getMagicEffects().get(ESM::MagicEffect::Jump).getMagnitude(); const float jumpSpellBonus = ptr.getClass().getCreatureStats(ptr).getMagicEffects().get(ESM::MagicEffect::Jump).getMagnitude();
const float fallAcroBase = store.find("fFallAcroBase")->getFloat(); const float fallAcroBase = store.find("fFallAcroBase")->mValue.getFloat();
const float fallAcroMult = store.find("fFallAcroMult")->getFloat(); const float fallAcroMult = store.find("fFallAcroMult")->mValue.getFloat();
const float fallDistanceBase = store.find("fFallDistanceBase")->getFloat(); const float fallDistanceBase = store.find("fFallDistanceBase")->mValue.getFloat();
const float fallDistanceMult = store.find("fFallDistanceMult")->getFloat(); const float fallDistanceMult = store.find("fFallDistanceMult")->mValue.getFloat();
float x = fallHeight - fallDistanceMin; float x = fallHeight - fallDistanceMin;
x -= (1.5f * acrobaticsSkill) + jumpSpellBonus; x -= (1.5f * acrobaticsSkill) + jumpSpellBonus;
@ -1907,14 +1907,14 @@ void CharacterController::update(float duration)
// reduce fatigue // reduce fatigue
const MWWorld::Store<ESM::GameSetting> &gmst = world->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting> &gmst = world->getStore().get<ESM::GameSetting>();
float fatigueLoss = 0; float fatigueLoss = 0;
static const float fFatigueRunBase = gmst.find("fFatigueRunBase")->getFloat(); static const float fFatigueRunBase = gmst.find("fFatigueRunBase")->mValue.getFloat();
static const float fFatigueRunMult = gmst.find("fFatigueRunMult")->getFloat(); static const float fFatigueRunMult = gmst.find("fFatigueRunMult")->mValue.getFloat();
static const float fFatigueSwimWalkBase = gmst.find("fFatigueSwimWalkBase")->getFloat(); static const float fFatigueSwimWalkBase = gmst.find("fFatigueSwimWalkBase")->mValue.getFloat();
static const float fFatigueSwimRunBase = gmst.find("fFatigueSwimRunBase")->getFloat(); static const float fFatigueSwimRunBase = gmst.find("fFatigueSwimRunBase")->mValue.getFloat();
static const float fFatigueSwimWalkMult = gmst.find("fFatigueSwimWalkMult")->getFloat(); static const float fFatigueSwimWalkMult = gmst.find("fFatigueSwimWalkMult")->mValue.getFloat();
static const float fFatigueSwimRunMult = gmst.find("fFatigueSwimRunMult")->getFloat(); static const float fFatigueSwimRunMult = gmst.find("fFatigueSwimRunMult")->mValue.getFloat();
static const float fFatigueSneakBase = gmst.find("fFatigueSneakBase")->getFloat(); static const float fFatigueSneakBase = gmst.find("fFatigueSneakBase")->mValue.getFloat();
static const float fFatigueSneakMult = gmst.find("fFatigueSneakMult")->getFloat(); static const float fFatigueSneakMult = gmst.find("fFatigueSneakMult")->mValue.getFloat();
if (cls.getEncumbrance(mPtr) <= cls.getCapacity(mPtr)) if (cls.getEncumbrance(mPtr) <= cls.getCapacity(mPtr))
{ {
@ -1954,8 +1954,8 @@ void CharacterController::update(float duration)
forcestateupdate = (mJumpState != JumpState_InAir); forcestateupdate = (mJumpState != JumpState_InAir);
jumpstate = JumpState_InAir; jumpstate = JumpState_InAir;
static const float fJumpMoveBase = gmst.find("fJumpMoveBase")->getFloat(); static const float fJumpMoveBase = gmst.find("fJumpMoveBase")->mValue.getFloat();
static const float fJumpMoveMult = gmst.find("fJumpMoveMult")->getFloat(); static const float fJumpMoveMult = gmst.find("fJumpMoveMult")->mValue.getFloat();
float factor = fJumpMoveBase + fJumpMoveMult * mPtr.getClass().getSkill(mPtr, ESM::Skill::Acrobatics)/100.f; float factor = fJumpMoveBase + fJumpMoveMult * mPtr.getClass().getSkill(mPtr, ESM::Skill::Acrobatics)/100.f;
factor = std::min(1.f, factor); factor = std::min(1.f, factor);
vec.x() *= factor; vec.x() *= factor;
@ -1982,8 +1982,8 @@ void CharacterController::update(float duration)
cls.skillUsageSucceeded(mPtr, ESM::Skill::Acrobatics, 0); cls.skillUsageSucceeded(mPtr, ESM::Skill::Acrobatics, 0);
// decrease fatigue // decrease fatigue
const float fatigueJumpBase = gmst.find("fFatigueJumpBase")->getFloat(); const float fatigueJumpBase = gmst.find("fFatigueJumpBase")->mValue.getFloat();
const float fatigueJumpMult = gmst.find("fFatigueJumpMult")->getFloat(); const float fatigueJumpMult = gmst.find("fFatigueJumpMult")->mValue.getFloat();
float normalizedEncumbrance = mPtr.getClass().getNormalizedEncumbrance(mPtr); float normalizedEncumbrance = mPtr.getClass().getNormalizedEncumbrance(mPtr);
if (normalizedEncumbrance > 1) if (normalizedEncumbrance > 1)
normalizedEncumbrance = 1; normalizedEncumbrance = 1;

@ -82,9 +82,9 @@ namespace MWMechanics
osg::Vec3f(0,0,1))); osg::Vec3f(0,0,1)));
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
if (angleDegrees < gmst.find("fCombatBlockLeftAngle")->getFloat()) if (angleDegrees < gmst.find("fCombatBlockLeftAngle")->mValue.getFloat())
return false; return false;
if (angleDegrees > gmst.find("fCombatBlockRightAngle")->getFloat()) if (angleDegrees > gmst.find("fCombatBlockRightAngle")->mValue.getFloat())
return false; return false;
MWMechanics::CreatureStats& attackerStats = attacker.getClass().getCreatureStats(attacker); MWMechanics::CreatureStats& attackerStats = attacker.getClass().getCreatureStats(attacker);
@ -92,11 +92,11 @@ namespace MWMechanics
float blockTerm = blocker.getClass().getSkill(blocker, ESM::Skill::Block) + 0.2f * blockerStats.getAttribute(ESM::Attribute::Agility).getModified() float blockTerm = blocker.getClass().getSkill(blocker, ESM::Skill::Block) + 0.2f * blockerStats.getAttribute(ESM::Attribute::Agility).getModified()
+ 0.1f * blockerStats.getAttribute(ESM::Attribute::Luck).getModified(); + 0.1f * blockerStats.getAttribute(ESM::Attribute::Luck).getModified();
float enemySwing = attackStrength; float enemySwing = attackStrength;
float swingTerm = enemySwing * gmst.find("fSwingBlockMult")->getFloat() + gmst.find("fSwingBlockBase")->getFloat(); float swingTerm = enemySwing * gmst.find("fSwingBlockMult")->mValue.getFloat() + gmst.find("fSwingBlockBase")->mValue.getFloat();
float blockerTerm = blockTerm * swingTerm; float blockerTerm = blockTerm * swingTerm;
if (blocker.getClass().getMovementSettings(blocker).mPosition[1] <= 0) if (blocker.getClass().getMovementSettings(blocker).mPosition[1] <= 0)
blockerTerm *= gmst.find("fBlockStillBonus")->getFloat(); blockerTerm *= gmst.find("fBlockStillBonus")->mValue.getFloat();
blockerTerm *= blockerStats.getFatigueTerm(); blockerTerm *= blockerStats.getFatigueTerm();
int attackerSkill = 0; int attackerSkill = 0;
@ -109,8 +109,8 @@ namespace MWMechanics
attackerTerm *= attackerStats.getFatigueTerm(); attackerTerm *= attackerStats.getFatigueTerm();
int x = int(blockerTerm - attackerTerm); int x = int(blockerTerm - attackerTerm);
int iBlockMaxChance = gmst.find("iBlockMaxChance")->getInt(); int iBlockMaxChance = gmst.find("iBlockMaxChance")->mValue.getInteger();
int iBlockMinChance = gmst.find("iBlockMinChance")->getInt(); int iBlockMinChance = gmst.find("iBlockMinChance")->mValue.getInteger();
x = std::min(iBlockMaxChance, std::max(iBlockMinChance, x)); x = std::min(iBlockMaxChance, std::max(iBlockMinChance, x));
if (Misc::Rng::roll0to99() < x) if (Misc::Rng::roll0to99() < x)
@ -126,9 +126,9 @@ namespace MWMechanics
inv.unequipItem(*shield, blocker); inv.unequipItem(*shield, blocker);
} }
// Reduce blocker fatigue // Reduce blocker fatigue
const float fFatigueBlockBase = gmst.find("fFatigueBlockBase")->getFloat(); const float fFatigueBlockBase = gmst.find("fFatigueBlockBase")->mValue.getFloat();
const float fFatigueBlockMult = gmst.find("fFatigueBlockMult")->getFloat(); const float fFatigueBlockMult = gmst.find("fFatigueBlockMult")->mValue.getFloat();
const float fWeaponFatigueBlockMult = gmst.find("fWeaponFatigueBlockMult")->getFloat(); const float fWeaponFatigueBlockMult = gmst.find("fWeaponFatigueBlockMult")->mValue.getFloat();
MWMechanics::DynamicStat<float> fatigue = blockerStats.getFatigue(); MWMechanics::DynamicStat<float> fatigue = blockerStats.getFatigue();
float normalizedEncumbrance = blocker.getClass().getNormalizedEncumbrance(blocker); float normalizedEncumbrance = blocker.getClass().getNormalizedEncumbrance(blocker);
normalizedEncumbrance = std::min(1.f, normalizedEncumbrance); normalizedEncumbrance = std::min(1.f, normalizedEncumbrance);
@ -166,7 +166,7 @@ namespace MWMechanics
if ((weapon.get<ESM::Weapon>()->mBase->mData.mFlags & ESM::Weapon::Silver) if ((weapon.get<ESM::Weapon>()->mBase->mData.mFlags & ESM::Weapon::Silver)
&& actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) && actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
damage *= MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fWereWolfSilverWeaponDamageMult")->getFloat(); damage *= MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fWereWolfSilverWeaponDamageMult")->mValue.getFloat();
if (damage == 0 && attacker == getPlayer()) if (damage == 0 && attacker == getPlayer())
MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicTargetResistsWeapons}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicTargetResistsWeapons}");
@ -219,14 +219,14 @@ namespace MWMechanics
if (unaware) if (unaware)
{ {
damage *= gmst.find("fCombatCriticalStrikeMult")->getFloat(); damage *= gmst.find("fCombatCriticalStrikeMult")->mValue.getFloat();
MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}");
MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f); MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f);
} }
} }
if (victim.getClass().getCreatureStats(victim).getKnockedDown()) if (victim.getClass().getCreatureStats(victim).getKnockedDown())
damage *= gmst.find("fCombatKODamageMult")->getFloat(); damage *= gmst.find("fCombatKODamageMult")->mValue.getFloat();
} }
reduceWeaponCondition(damage, validVictim, weapon, attacker); reduceWeaponCondition(damage, validVictim, weapon, attacker);
@ -241,7 +241,7 @@ namespace MWMechanics
// Non-enchanted arrows shot at enemies have a chance to turn up in their inventory // Non-enchanted arrows shot at enemies have a chance to turn up in their inventory
if (victim != getPlayer() && !appliedEnchantment) if (victim != getPlayer() && !appliedEnchantment)
{ {
float fProjectileThrownStoreChance = gmst.find("fProjectileThrownStoreChance")->getFloat(); float fProjectileThrownStoreChance = gmst.find("fProjectileThrownStoreChance")->mValue.getFloat();
if (Misc::Rng::rollProbability() < fProjectileThrownStoreChance / 100.f) if (Misc::Rng::rollProbability() < fProjectileThrownStoreChance / 100.f)
victim.getClass().getContainerStore(victim).add(projectile, 1, victim); victim.getClass().getContainerStore(victim).add(projectile, 1, victim);
} }
@ -273,10 +273,10 @@ namespace MWMechanics
defenseTerm = victimStats.getEvasion(); defenseTerm = victimStats.getEvasion();
} }
defenseTerm += std::min(100.f, defenseTerm += std::min(100.f,
gmst.find("fCombatInvisoMult")->getFloat() * gmst.find("fCombatInvisoMult")->mValue.getFloat() *
victimStats.getMagicEffects().get(ESM::MagicEffect::Chameleon).getMagnitude()); victimStats.getMagicEffects().get(ESM::MagicEffect::Chameleon).getMagnitude());
defenseTerm += std::min(100.f, defenseTerm += std::min(100.f,
gmst.find("fCombatInvisoMult")->getFloat() * gmst.find("fCombatInvisoMult")->mValue.getFloat() *
victimStats.getMagicEffects().get(ESM::MagicEffect::Invisibility).getMagnitude()); victimStats.getMagicEffects().get(ESM::MagicEffect::Invisibility).getMagnitude());
} }
float attackTerm = skillValue + float attackTerm = skillValue +
@ -322,7 +322,7 @@ namespace MWMechanics
x = std::min(100.f, x + elementResistance); x = std::min(100.f, x + elementResistance);
static const float fElementalShieldMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fElementalShieldMult")->getFloat(); static const float fElementalShieldMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fElementalShieldMult")->mValue.getFloat();
x = fElementalShieldMult * magnitude * (1.f - 0.01f * x); x = fElementalShieldMult * magnitude * (1.f - 0.01f * x);
// Note swapped victim and attacker, since the attacker takes the damage here. // Note swapped victim and attacker, since the attacker takes the damage here.
@ -352,7 +352,7 @@ namespace MWMechanics
// weapon condition does not degrade when godmode is on // weapon condition does not degrade when godmode is on
if (!godmode) if (!godmode)
{ {
const float fWeaponDamageMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fWeaponDamageMult")->getFloat(); const float fWeaponDamageMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fWeaponDamageMult")->mValue.getFloat();
float x = std::max(1.f, fWeaponDamageMult * damage); float x = std::max(1.f, fWeaponDamageMult * damage);
weaphealth -= std::min(int(x), weaphealth); weaphealth -= std::min(int(x), weaphealth);
@ -379,9 +379,9 @@ namespace MWMechanics
} }
static const float fDamageStrengthBase = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() static const float fDamageStrengthBase = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fDamageStrengthBase")->getFloat(); .find("fDamageStrengthBase")->mValue.getFloat();
static const float fDamageStrengthMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() static const float fDamageStrengthMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fDamageStrengthMult")->getFloat(); .find("fDamageStrengthMult")->mValue.getFloat();
damage *= fDamageStrengthBase + damage *= fDamageStrengthBase +
(attacker.getClass().getCreatureStats(attacker).getAttribute(ESM::Attribute::Strength).getModified() * fDamageStrengthMult * 0.1f); (attacker.getClass().getCreatureStats(attacker).getAttribute(ESM::Attribute::Strength).getModified() * fDamageStrengthMult * 0.1f);
} }
@ -389,8 +389,8 @@ namespace MWMechanics
void getHandToHandDamage(const MWWorld::Ptr &attacker, const MWWorld::Ptr &victim, float &damage, bool &healthdmg, float attackStrength) void getHandToHandDamage(const MWWorld::Ptr &attacker, const MWWorld::Ptr &victim, float &damage, bool &healthdmg, float attackStrength)
{ {
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
float minstrike = store.get<ESM::GameSetting>().find("fMinHandToHandMult")->getFloat(); float minstrike = store.get<ESM::GameSetting>().find("fMinHandToHandMult")->mValue.getFloat();
float maxstrike = store.get<ESM::GameSetting>().find("fMaxHandToHandMult")->getFloat(); float maxstrike = store.get<ESM::GameSetting>().find("fMaxHandToHandMult")->mValue.getFloat();
damage = static_cast<float>(attacker.getClass().getSkill(attacker, ESM::Skill::HandToHand)); damage = static_cast<float>(attacker.getClass().getSkill(attacker, ESM::Skill::HandToHand));
damage *= minstrike + ((maxstrike-minstrike)*attackStrength); damage *= minstrike + ((maxstrike-minstrike)*attackStrength);
@ -415,7 +415,7 @@ namespace MWMechanics
damage *= MWBase::Environment::get().getWorld()->getGlobalFloat("werewolfclawmult"); damage *= MWBase::Environment::get().getWorld()->getGlobalFloat("werewolfclawmult");
} }
if(healthdmg) if(healthdmg)
damage *= store.get<ESM::GameSetting>().find("fHandtoHandHealthPer")->getFloat(); damage *= store.get<ESM::GameSetting>().find("fHandtoHandHealthPer")->mValue.getFloat();
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager(); MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
if(isWerewolf) if(isWerewolf)
@ -432,9 +432,9 @@ namespace MWMechanics
{ {
// somewhat of a guess, but using the weapon weight makes sense // somewhat of a guess, but using the weapon weight makes sense
const MWWorld::Store<ESM::GameSetting>& store = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& store = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
const float fFatigueAttackBase = store.find("fFatigueAttackBase")->getFloat(); const float fFatigueAttackBase = store.find("fFatigueAttackBase")->mValue.getFloat();
const float fFatigueAttackMult = store.find("fFatigueAttackMult")->getFloat(); const float fFatigueAttackMult = store.find("fFatigueAttackMult")->mValue.getFloat();
const float fWeaponFatigueMult = store.find("fWeaponFatigueMult")->getFloat(); const float fWeaponFatigueMult = store.find("fWeaponFatigueMult")->mValue.getFloat();
CreatureStats& stats = attacker.getClass().getCreatureStats(attacker); CreatureStats& stats = attacker.getClass().getCreatureStats(attacker);
MWMechanics::DynamicStat<float> fatigue = stats.getFatigue(); MWMechanics::DynamicStat<float> fatigue = stats.getFatigue();
const float normalizedEncumbrance = attacker.getClass().getNormalizedEncumbrance(attacker); const float normalizedEncumbrance = attacker.getClass().getNormalizedEncumbrance(attacker);
@ -459,9 +459,9 @@ namespace MWMechanics
float d = (pos1 - pos2).length(); float d = (pos1 - pos2).length();
static const int iFightDistanceBase = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find( static const int iFightDistanceBase = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
"iFightDistanceBase")->getInt(); "iFightDistanceBase")->mValue.getInteger();
static const float fFightDistanceMultiplier = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find( static const float fFightDistanceMultiplier = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
"fFightDistanceMultiplier")->getFloat(); "fFightDistanceMultiplier")->mValue.getFloat();
return (iFightDistanceBase - fFightDistanceMultiplier * d); return (iFightDistanceBase - fFightDistanceMultiplier * d);
} }

@ -48,8 +48,8 @@ namespace MWMechanics
const MWWorld::Store<ESM::GameSetting> &gmst = const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
static const float fFatigueBase = gmst.find("fFatigueBase")->getFloat(); static const float fFatigueBase = gmst.find("fFatigueBase")->mValue.getFloat();
static const float fFatigueMult = gmst.find("fFatigueMult")->getFloat(); static const float fFatigueMult = gmst.find("fFatigueMult")->mValue.getFloat();
return fFatigueBase - fFatigueMult * (1-normalised); return fFatigueBase - fFatigueMult * (1-normalised);
} }

@ -17,7 +17,7 @@ float scaleDamage(float damage, const MWWorld::Ptr& attacker, const MWWorld::Ptr
difficultySetting = std::min(difficultySetting, 500); difficultySetting = std::min(difficultySetting, 500);
difficultySetting = std::max(difficultySetting, -500); difficultySetting = std::max(difficultySetting, -500);
static const float fDifficultyMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fDifficultyMult")->getFloat(); static const float fDifficultyMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fDifficultyMult")->mValue.getFloat();
float difficultyTerm = 0.01f * difficultySetting; float difficultyTerm = 0.01f * difficultySetting;

@ -28,7 +28,7 @@ namespace MWMechanics
float fDiseaseXferChance = float fDiseaseXferChance =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find( MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
"fDiseaseXferChance")->getFloat(); "fDiseaseXferChance")->mValue.getFloat();
MagicEffects& actorEffects = actor.getClass().getCreatureStats(actor).getMagicEffects(); MagicEffects& actorEffects = actor.getClass().getCreatureStats(actor).getMagicEffects();
@ -59,7 +59,7 @@ namespace MWMechanics
actor.getClass().getCreatureStats(actor).getSpells().add(it->first); actor.getClass().getCreatureStats(actor).getSpells().add(it->first);
std::string msg = "sMagicContractDisease"; std::string msg = "sMagicContractDisease";
msg = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(msg)->getString(); msg = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(msg)->mValue.getString();
if (msg.find("%s") != std::string::npos) if (msg.find("%s") != std::string::npos)
msg.replace(msg.find("%s"), 2, spell->mName); msg.replace(msg.find("%s"), 2, spell->mName);
MWBase::Environment::get().getWindowManager()->messageBox(msg); MWBase::Environment::get().getWindowManager()->messageBox(msg);

@ -107,7 +107,7 @@ namespace MWMechanics
} }
const bool powerfulSoul = getGemCharge() >= \ const bool powerfulSoul = getGemCharge() >= \
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("iSoulAmountForConstantEffect")->getInt(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("iSoulAmountForConstantEffect")->mValue.getInteger();
if ((mObjectType == typeid(ESM::Armor).name()) || (mObjectType == typeid(ESM::Clothing).name())) if ((mObjectType == typeid(ESM::Armor).name()) || (mObjectType == typeid(ESM::Clothing).name()))
{ // Armor or Clothing { // Armor or Clothing
switch(mCastStyle) switch(mCastStyle)
@ -184,7 +184,7 @@ namespace MWMechanics
float magnitudeCost = (magMin + magMax) * baseCost * 0.05f; float magnitudeCost = (magMin + magMax) * baseCost * 0.05f;
if (mCastStyle == ESM::Enchantment::ConstantEffect) if (mCastStyle == ESM::Enchantment::ConstantEffect)
{ {
magnitudeCost *= store.get<ESM::GameSetting>().find("fEnchantmentConstantDurationMult")->getFloat(); magnitudeCost *= store.get<ESM::GameSetting>().find("fEnchantmentConstantDurationMult")->mValue.getFloat();
} }
else else
{ {
@ -193,7 +193,7 @@ namespace MWMechanics
float areaCost = area * 0.05f * baseCost; float areaCost = area * 0.05f * baseCost;
const float fEffectCostMult = store.get<ESM::GameSetting>().find("fEffectCostMult")->getFloat(); const float fEffectCostMult = store.get<ESM::GameSetting>().find("fEffectCostMult")->mValue.getFloat();
cost += (magnitudeCost + areaCost) * fEffectCostMult; cost += (magnitudeCost + areaCost) * fEffectCostMult;
@ -230,7 +230,7 @@ namespace MWMechanics
if(mEnchanter.isEmpty()) if(mEnchanter.isEmpty())
return 0; return 0;
float priceMultipler = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fEnchantmentValueMult")->getFloat(); float priceMultipler = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fEnchantmentValueMult")->mValue.getFloat();
int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mEnchanter, static_cast<int>(getEnchantPoints() * priceMultipler), true); int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mEnchanter, static_cast<int>(getEnchantPoints() * priceMultipler), true);
return price; return price;
} }
@ -256,7 +256,7 @@ namespace MWMechanics
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
return static_cast<int>(mOldItemPtr.getClass().getEnchantmentPoints(mOldItemPtr) * store.get<ESM::GameSetting>().find("fEnchantmentMult")->getFloat()); return static_cast<int>(mOldItemPtr.getClass().getEnchantmentPoints(mOldItemPtr) * store.get<ESM::GameSetting>().find("fEnchantmentMult")->mValue.getFloat());
} }
bool Enchanting::soulEmpty() const bool Enchanting::soulEmpty() const
{ {
@ -288,8 +288,8 @@ namespace MWMechanics
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
float chance2 = 7.5f / (gmst.find("fEnchantmentChanceMult")->getFloat() * ((mCastStyle == ESM::Enchantment::ConstantEffect) ? float chance2 = 7.5f / (gmst.find("fEnchantmentChanceMult")->mValue.getFloat() * ((mCastStyle == ESM::Enchantment::ConstantEffect) ?
gmst.find("fEnchantmentConstantChanceMult")->getFloat() : 1.0f )) gmst.find("fEnchantmentConstantChanceMult")->mValue.getFloat() : 1.0f ))
* getEnchantPoints(); * getEnchantPoints();
return (chance1-chance2); return (chance1-chance2);

@ -36,7 +36,7 @@ namespace
float getFightDispositionBias(float disposition) float getFightDispositionBias(float disposition)
{ {
static const float fFightDispMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find( static const float fFightDispMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
"fFightDispMult")->getFloat(); "fFightDispMult")->mValue.getFloat();
return ((50.f - disposition) * fFightDispMult); return ((50.f - disposition) * fFightDispMult);
} }
@ -45,11 +45,11 @@ namespace
const MWWorld::Store<ESM::GameSetting> &gmst = const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
float persTerm = stats.getAttribute(ESM::Attribute::Personality).getModified() / gmst.find("fPersonalityMod")->getFloat(); float persTerm = stats.getAttribute(ESM::Attribute::Personality).getModified() / gmst.find("fPersonalityMod")->mValue.getFloat();
float luckTerm = stats.getAttribute(ESM::Attribute::Luck).getModified() / gmst.find("fLuckMod")->getFloat(); float luckTerm = stats.getAttribute(ESM::Attribute::Luck).getModified() / gmst.find("fLuckMod")->mValue.getFloat();
float repTerm = stats.getReputation() * gmst.find("fReputationMod")->getFloat(); float repTerm = stats.getReputation() * gmst.find("fReputationMod")->mValue.getFloat();
float fatigueTerm = stats.getFatigueTerm(); float fatigueTerm = stats.getFatigueTerm();
float levelTerm = stats.getLevel() * gmst.find("fLevelMod")->getFloat(); float levelTerm = stats.getLevel() * gmst.find("fLevelMod")->mValue.getFloat();
rating1 = (repTerm + luckTerm + persTerm + stats.getSkill(ESM::Skill::Speechcraft).getModified()) * fatigueTerm; rating1 = (repTerm + luckTerm + persTerm + stats.getSkill(ESM::Skill::Speechcraft).getModified()) * fatigueTerm;
@ -342,7 +342,7 @@ namespace MWMechanics
if(timeToDrown != mWatchedTimeToStartDrowning) if(timeToDrown != mWatchedTimeToStartDrowning)
{ {
static const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() static const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fHoldBreathTime")->getFloat(); .find("fHoldBreathTime")->mValue.getFloat();
mWatchedTimeToStartDrowning = timeToDrown; mWatchedTimeToStartDrowning = timeToDrown;
@ -543,12 +543,12 @@ namespace MWMechanics
const MWMechanics::NpcStats &playerStats = playerPtr.getClass().getNpcStats(playerPtr); const MWMechanics::NpcStats &playerStats = playerPtr.getClass().getNpcStats(playerPtr);
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
static const float fDispRaceMod = gmst.find("fDispRaceMod")->getFloat(); static const float fDispRaceMod = gmst.find("fDispRaceMod")->mValue.getFloat();
if (Misc::StringUtils::ciEqual(npc->mBase->mRace, player->mBase->mRace)) if (Misc::StringUtils::ciEqual(npc->mBase->mRace, player->mBase->mRace))
x += fDispRaceMod; x += fDispRaceMod;
static const float fDispPersonalityMult = gmst.find("fDispPersonalityMult")->getFloat(); static const float fDispPersonalityMult = gmst.find("fDispPersonalityMult")->mValue.getFloat();
static const float fDispPersonalityBase = gmst.find("fDispPersonalityBase")->getFloat(); static const float fDispPersonalityBase = gmst.find("fDispPersonalityBase")->mValue.getFloat();
x += fDispPersonalityMult * (playerStats.getAttribute(ESM::Attribute::Personality).getModified() - fDispPersonalityBase); x += fDispPersonalityMult * (playerStats.getAttribute(ESM::Attribute::Personality).getModified() - fDispPersonalityBase);
float reaction = 0; float reaction = 0;
@ -592,20 +592,20 @@ namespace MWMechanics
rank = 0; rank = 0;
} }
static const float fDispFactionRankMult = gmst.find("fDispFactionRankMult")->getFloat(); static const float fDispFactionRankMult = gmst.find("fDispFactionRankMult")->mValue.getFloat();
static const float fDispFactionRankBase = gmst.find("fDispFactionRankBase")->getFloat(); static const float fDispFactionRankBase = gmst.find("fDispFactionRankBase")->mValue.getFloat();
static const float fDispFactionMod = gmst.find("fDispFactionMod")->getFloat(); static const float fDispFactionMod = gmst.find("fDispFactionMod")->mValue.getFloat();
x += (fDispFactionRankMult * rank x += (fDispFactionRankMult * rank
+ fDispFactionRankBase) + fDispFactionRankBase)
* fDispFactionMod * reaction; * fDispFactionMod * reaction;
static const float fDispCrimeMod = gmst.find("fDispCrimeMod")->getFloat(); static const float fDispCrimeMod = gmst.find("fDispCrimeMod")->mValue.getFloat();
static const float fDispDiseaseMod = gmst.find("fDispDiseaseMod")->getFloat(); static const float fDispDiseaseMod = gmst.find("fDispDiseaseMod")->mValue.getFloat();
x -= fDispCrimeMod * playerStats.getBounty(); x -= fDispCrimeMod * playerStats.getBounty();
if (playerStats.hasCommonDisease() || playerStats.hasBlightDisease()) if (playerStats.hasCommonDisease() || playerStats.hasBlightDisease())
x += fDispDiseaseMod; x += fDispDiseaseMod;
static const float fDispWeaponDrawn = gmst.find("fDispWeaponDrawn")->getFloat(); static const float fDispWeaponDrawn = gmst.find("fDispWeaponDrawn")->mValue.getFloat();
if (playerStats.getDrawState() == MWMechanics::DrawState_Weapon) if (playerStats.getDrawState() == MWMechanics::DrawState_Weapon)
x += fDispWeaponDrawn; x += fDispWeaponDrawn;
@ -673,16 +673,16 @@ namespace MWMechanics
float target2 = d * (playerRating2 - npcRating2 + 50); float target2 = d * (playerRating2 - npcRating2 + 50);
float bribeMod; float bribeMod;
if (type == PT_Bribe10) bribeMod = gmst.find("fBribe10Mod")->getFloat(); if (type == PT_Bribe10) bribeMod = gmst.find("fBribe10Mod")->mValue.getFloat();
else if (type == PT_Bribe100) bribeMod = gmst.find("fBribe100Mod")->getFloat(); else if (type == PT_Bribe100) bribeMod = gmst.find("fBribe100Mod")->mValue.getFloat();
else bribeMod = gmst.find("fBribe1000Mod")->getFloat(); else bribeMod = gmst.find("fBribe1000Mod")->mValue.getFloat();
float target3 = d * (playerRating3 - npcRating3 + 50) + bribeMod; float target3 = d * (playerRating3 - npcRating3 + 50) + bribeMod;
float iPerMinChance = floor(gmst.find("iPerMinChance")->getFloat()); float iPerMinChance = floor(gmst.find("iPerMinChance")->mValue.getFloat());
float iPerMinChange = floor(gmst.find("iPerMinChange")->getFloat()); float iPerMinChange = floor(gmst.find("iPerMinChange")->mValue.getFloat());
float fPerDieRollMult = gmst.find("fPerDieRollMult")->getFloat(); float fPerDieRollMult = gmst.find("fPerDieRollMult")->mValue.getFloat();
float fPerTempMult = gmst.find("fPerTempMult")->getFloat(); float fPerTempMult = gmst.find("fPerTempMult")->mValue.getFloat();
float x = 0; float x = 0;
float y = 0; float y = 0;
@ -867,7 +867,7 @@ namespace MWMechanics
continue; continue;
// All sMagicBound* GMST's should be of type string // All sMagicBound* GMST's should be of type string
std::string currentGMSTValue = currentSetting.getString(); std::string currentGMSTValue = currentSetting.mValue.getString();
Misc::StringUtils::lowerCaseInPlace(currentGMSTValue); Misc::StringUtils::lowerCaseInPlace(currentGMSTValue);
boundItemIDCache.insert(currentGMSTValue); boundItemIDCache.insert(currentGMSTValue);
@ -1163,7 +1163,7 @@ namespace MWMechanics
osg::Vec3f from (player.getRefData().getPosition().asVec3()); osg::Vec3f from (player.getRefData().getPosition().asVec3());
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
float radius = esmStore.get<ESM::GameSetting>().find("fAlarmRadius")->getFloat(); float radius = esmStore.get<ESM::GameSetting>().find("fAlarmRadius")->mValue.getFloat();
mActors.getObjectsInRange(from, radius, neighbors); mActors.getObjectsInRange(from, radius, neighbors);
@ -1261,29 +1261,29 @@ namespace MWMechanics
float disp = 0.f, dispVictim = 0.f; float disp = 0.f, dispVictim = 0.f;
if (type == OT_Trespassing || type == OT_SleepingInOwnedBed) if (type == OT_Trespassing || type == OT_SleepingInOwnedBed)
{ {
arg = store.find("iCrimeTresspass")->getInt(); arg = store.find("iCrimeTresspass")->mValue.getInteger();
disp = dispVictim = store.find("iDispTresspass")->getFloat(); disp = dispVictim = store.find("iDispTresspass")->mValue.getFloat();
} }
else if (type == OT_Pickpocket) else if (type == OT_Pickpocket)
{ {
arg = store.find("iCrimePickPocket")->getInt(); arg = store.find("iCrimePickPocket")->mValue.getInteger();
disp = dispVictim = store.find("fDispPickPocketMod")->getFloat(); disp = dispVictim = store.find("fDispPickPocketMod")->mValue.getFloat();
} }
else if (type == OT_Assault) else if (type == OT_Assault)
{ {
arg = store.find("iCrimeAttack")->getInt(); arg = store.find("iCrimeAttack")->mValue.getInteger();
disp = store.find("iDispAttackMod")->getFloat(); disp = store.find("iDispAttackMod")->mValue.getFloat();
dispVictim = store.find("fDispAttacking")->getFloat(); dispVictim = store.find("fDispAttacking")->mValue.getFloat();
} }
else if (type == OT_Murder) else if (type == OT_Murder)
{ {
arg = store.find("iCrimeKilling")->getInt(); arg = store.find("iCrimeKilling")->mValue.getInteger();
disp = dispVictim = store.find("iDispKilling")->getFloat(); disp = dispVictim = store.find("iDispKilling")->mValue.getFloat();
} }
else if (type == OT_Theft) else if (type == OT_Theft)
{ {
disp = dispVictim = store.find("fDispStealing")->getFloat() * arg; disp = dispVictim = store.find("fDispStealing")->mValue.getFloat() * arg;
arg = static_cast<int>(arg * store.find("fCrimeStealing")->getFloat()); arg = static_cast<int>(arg * store.find("fCrimeStealing")->mValue.getFloat());
arg = std::max(1, arg); // Minimum bounty of 1, in case items with zero value are stolen arg = std::max(1, arg); // Minimum bounty of 1, in case items with zero value are stolen
} }
@ -1293,7 +1293,7 @@ namespace MWMechanics
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
osg::Vec3f from (player.getRefData().getPosition().asVec3()); osg::Vec3f from (player.getRefData().getPosition().asVec3());
float radius = esmStore.get<ESM::GameSetting>().find("fAlarmRadius")->getFloat(); float radius = esmStore.get<ESM::GameSetting>().find("fAlarmRadius")->mValue.getFloat();
mActors.getObjectsInRange(from, radius, neighbors); mActors.getObjectsInRange(from, radius, neighbors);
@ -1307,21 +1307,21 @@ namespace MWMechanics
// Controls whether witnesses will engage combat with the criminal. // Controls whether witnesses will engage combat with the criminal.
int fight = 0, fightVictim = 0; int fight = 0, fightVictim = 0;
if (type == OT_Trespassing || type == OT_SleepingInOwnedBed) if (type == OT_Trespassing || type == OT_SleepingInOwnedBed)
fight = fightVictim = esmStore.get<ESM::GameSetting>().find("iFightTrespass")->getInt(); fight = fightVictim = esmStore.get<ESM::GameSetting>().find("iFightTrespass")->mValue.getInteger();
else if (type == OT_Pickpocket) else if (type == OT_Pickpocket)
{ {
fight = esmStore.get<ESM::GameSetting>().find("iFightPickpocket")->getInt(); fight = esmStore.get<ESM::GameSetting>().find("iFightPickpocket")->mValue.getInteger();
fightVictim = esmStore.get<ESM::GameSetting>().find("iFightPickpocket")->getInt() * 4; // *4 according to research wiki fightVictim = esmStore.get<ESM::GameSetting>().find("iFightPickpocket")->mValue.getInteger() * 4; // *4 according to research wiki
} }
else if (type == OT_Assault) else if (type == OT_Assault)
{ {
fight = esmStore.get<ESM::GameSetting>().find("iFightAttacking")->getInt(); fight = esmStore.get<ESM::GameSetting>().find("iFightAttacking")->mValue.getInteger();
fightVictim = esmStore.get<ESM::GameSetting>().find("iFightAttack")->getInt(); fightVictim = esmStore.get<ESM::GameSetting>().find("iFightAttack")->mValue.getInteger();
} }
else if (type == OT_Murder) else if (type == OT_Murder)
fight = fightVictim = esmStore.get<ESM::GameSetting>().find("iFightKilling")->getInt(); fight = fightVictim = esmStore.get<ESM::GameSetting>().find("iFightKilling")->mValue.getInteger();
else if (type == OT_Theft) else if (type == OT_Theft)
fight = fightVictim = esmStore.get<ESM::GameSetting>().find("fFightStealing")->getInt(); fight = fightVictim = esmStore.get<ESM::GameSetting>().find("fFightStealing")->mValue.getInteger();
bool reported = false; bool reported = false;
@ -1552,8 +1552,8 @@ namespace MWMechanics
&& !MWBase::Environment::get().getWorld()->isSwimming(ptr) && !MWBase::Environment::get().getWorld()->isSwimming(ptr)
&& MWBase::Environment::get().getWorld()->isOnGround(ptr)) && MWBase::Environment::get().getWorld()->isOnGround(ptr))
{ {
static float fSneakSkillMult = store.find("fSneakSkillMult")->getFloat(); static float fSneakSkillMult = store.find("fSneakSkillMult")->mValue.getFloat();
static float fSneakBootMult = store.find("fSneakBootMult")->getFloat(); static float fSneakBootMult = store.find("fSneakBootMult")->mValue.getFloat();
float sneak = static_cast<float>(ptr.getClass().getSkill(ptr, ESM::Skill::Sneak)); float sneak = static_cast<float>(ptr.getClass().getSkill(ptr, ESM::Skill::Sneak));
int agility = stats.getAttribute(ESM::Attribute::Agility).getModified(); int agility = stats.getAttribute(ESM::Attribute::Agility).getModified();
int luck = stats.getAttribute(ESM::Attribute::Luck).getModified(); int luck = stats.getAttribute(ESM::Attribute::Luck).getModified();
@ -1568,8 +1568,8 @@ namespace MWMechanics
sneakTerm = fSneakSkillMult * sneak + 0.2f * agility + 0.1f * luck + bootWeight * fSneakBootMult; sneakTerm = fSneakSkillMult * sneak + 0.2f * agility + 0.1f * luck + bootWeight * fSneakBootMult;
} }
static float fSneakDistBase = store.find("fSneakDistanceBase")->getFloat(); static float fSneakDistBase = store.find("fSneakDistanceBase")->mValue.getFloat();
static float fSneakDistMult = store.find("fSneakDistanceMultiplier")->getFloat(); static float fSneakDistMult = store.find("fSneakDistanceMultiplier")->mValue.getFloat();
osg::Vec3f pos1 (ptr.getRefData().getPosition().asVec3()); osg::Vec3f pos1 (ptr.getRefData().getPosition().asVec3());
osg::Vec3f pos2 (observer.getRefData().getPosition().asVec3()); osg::Vec3f pos2 (observer.getRefData().getPosition().asVec3());
@ -1587,8 +1587,8 @@ namespace MWMechanics
float obsTerm = obsSneak + 0.2f * obsAgility + 0.1f * obsLuck - obsBlind; float obsTerm = obsSneak + 0.2f * obsAgility + 0.1f * obsLuck - obsBlind;
// is ptr behind the observer? // is ptr behind the observer?
static float fSneakNoViewMult = store.find("fSneakNoViewMult")->getFloat(); static float fSneakNoViewMult = store.find("fSneakNoViewMult")->mValue.getFloat();
static float fSneakViewMult = store.find("fSneakViewMult")->getFloat(); static float fSneakViewMult = store.find("fSneakViewMult")->mValue.getFloat();
float y = 0; float y = 0;
osg::Vec3f vec = pos1 - pos2; osg::Vec3f vec = pos1 - pos2;
if (observer.getRefData().getBaseNode()) if (observer.getRefData().getBaseNode())
@ -1748,7 +1748,7 @@ namespace MWMechanics
MWBase::Environment::get().getWorld()->getGlobalInt("pcknownwerewolf"))) MWBase::Environment::get().getWorld()->getGlobalInt("pcknownwerewolf")))
{ {
const ESM::GameSetting * iWerewolfFightMod = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iWerewolfFightMod"); const ESM::GameSetting * iWerewolfFightMod = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iWerewolfFightMod");
fight += iWerewolfFightMod->getInt(); fight += iWerewolfFightMod->mValue.getInteger();
} }
} }
@ -1841,7 +1841,7 @@ namespace MWMechanics
// Witnesses of the player's transformation will make them a globally known werewolf // Witnesses of the player's transformation will make them a globally known werewolf
std::vector<MWWorld::Ptr> closeActors; std::vector<MWWorld::Ptr> closeActors;
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
getActorsInRange(actor.getRefData().getPosition().asVec3(), gmst.find("fAlarmRadius")->getFloat(), closeActors); getActorsInRange(actor.getRefData().getPosition().asVec3(), gmst.find("fAlarmRadius")->mValue.getFloat(), closeActors);
bool detected = false, reported = false; bool detected = false, reported = false;
for (std::vector<MWWorld::Ptr>::const_iterator it = closeActors.begin(); it != closeActors.end(); ++it) for (std::vector<MWWorld::Ptr>::const_iterator it = closeActors.begin(); it != closeActors.end(); ++it)
@ -1866,7 +1866,7 @@ namespace MWMechanics
if (reported) if (reported)
{ {
npcStats.setBounty(npcStats.getBounty()+ npcStats.setBounty(npcStats.getBounty()+
gmst.find("iWereWolfBounty")->getInt()); gmst.find("iWereWolfBounty")->mValue.getInteger());
windowManager->messageBox("#{sCrimeMessage}"); windowManager->messageBox("#{sCrimeMessage}");
} }
} }
@ -1878,7 +1878,7 @@ namespace MWMechanics
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
MWMechanics::NpcStats &stats = actor.getClass().getNpcStats(actor); MWMechanics::NpcStats &stats = actor.getClass().getNpcStats(actor);
stats.getSkill(ESM::Skill::Acrobatics).setBase(gmst.find("fWerewolfAcrobatics")->getInt()); stats.getSkill(ESM::Skill::Acrobatics).setBase(gmst.find("fWerewolfAcrobatics")->mValue.getInteger());
} }
void MechanicsManager::cleanupSummonedCreature(const MWWorld::Ptr &caster, int creatureActorId) void MechanicsManager::cleanupSummonedCreature(const MWWorld::Ptr &caster, int creatureActorId)

@ -149,12 +149,12 @@ float MWMechanics::NpcStats::getSkillProgressRequirement (int skillIndex, const
const MWWorld::Store<ESM::GameSetting> &gmst = const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
float typeFactor = gmst.find ("fMiscSkillBonus")->getFloat(); float typeFactor = gmst.find ("fMiscSkillBonus")->mValue.getFloat();
for (int i=0; i<5; ++i) for (int i=0; i<5; ++i)
if (class_.mData.mSkills[i][0]==skillIndex) if (class_.mData.mSkills[i][0]==skillIndex)
{ {
typeFactor = gmst.find ("fMinorSkillBonus")->getFloat(); typeFactor = gmst.find ("fMinorSkillBonus")->mValue.getFloat();
break; break;
} }
@ -162,7 +162,7 @@ float MWMechanics::NpcStats::getSkillProgressRequirement (int skillIndex, const
for (int i=0; i<5; ++i) for (int i=0; i<5; ++i)
if (class_.mData.mSkills[i][1]==skillIndex) if (class_.mData.mSkills[i][1]==skillIndex)
{ {
typeFactor = gmst.find ("fMajorSkillBonus")->getFloat(); typeFactor = gmst.find ("fMajorSkillBonus")->mValue.getFloat();
break; break;
} }
@ -178,7 +178,7 @@ float MWMechanics::NpcStats::getSkillProgressRequirement (int skillIndex, const
MWBase::Environment::get().getWorld()->getStore().get<ESM::Skill>().find (skillIndex); MWBase::Environment::get().getWorld()->getStore().get<ESM::Skill>().find (skillIndex);
if (skill->mData.mSpecialization==class_.mData.mSpecialization) if (skill->mData.mSpecialization==class_.mData.mSpecialization)
{ {
specialisationFactor = gmst.find ("fSpecialSkillBonus")->getFloat(); specialisationFactor = gmst.find ("fSpecialSkillBonus")->mValue.getFloat();
if (specialisationFactor<=0) if (specialisationFactor<=0)
throw std::runtime_error ("invalid skill specialisation factor"); throw std::runtime_error ("invalid skill specialisation factor");
@ -227,21 +227,21 @@ void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &clas
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
// is this a minor or major skill? // is this a minor or major skill?
int increase = gmst.find("iLevelupMiscMultAttriubte")->getInt(); // Note: GMST has a typo int increase = gmst.find("iLevelupMiscMultAttriubte")->mValue.getInteger(); // Note: GMST has a typo
for (int k=0; k<5; ++k) for (int k=0; k<5; ++k)
{ {
if (class_.mData.mSkills[k][0] == skillIndex) if (class_.mData.mSkills[k][0] == skillIndex)
{ {
mLevelProgress += gmst.find("iLevelUpMinorMult")->getInt(); mLevelProgress += gmst.find("iLevelUpMinorMult")->mValue.getInteger();
increase = gmst.find("iLevelUpMajorMultAttribute")->getInt(); increase = gmst.find("iLevelUpMajorMultAttribute")->mValue.getInteger();
} }
} }
for (int k=0; k<5; ++k) for (int k=0; k<5; ++k)
{ {
if (class_.mData.mSkills[k][1] == skillIndex) if (class_.mData.mSkills[k][1] == skillIndex)
{ {
mLevelProgress += gmst.find("iLevelUpMajorMult")->getInt(); mLevelProgress += gmst.find("iLevelUpMajorMult")->mValue.getInteger();
increase = gmst.find("iLevelUpMinorMultAttribute")->getInt(); increase = gmst.find("iLevelUpMinorMultAttribute")->mValue.getInteger();
} }
} }
@ -249,7 +249,7 @@ void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &clas
MWBase::Environment::get().getWorld ()->getStore ().get<ESM::Skill>().find(skillIndex); MWBase::Environment::get().getWorld ()->getStore ().get<ESM::Skill>().find(skillIndex);
mSkillIncreases[skill->mData.mAttribute] += increase; mSkillIncreases[skill->mData.mAttribute] += increase;
mSpecIncreases[skill->mData.mSpecialization] += gmst.find("iLevelupSpecialization")->getInt(); mSpecIncreases[skill->mData.mSpecialization] += gmst.find("iLevelupSpecialization")->mValue.getInteger();
// Play sound & skill progress notification // Play sound & skill progress notification
/// \todo check if character is the player, if levelling is ever implemented for NPCs /// \todo check if character is the player, if levelling is ever implemented for NPCs
@ -266,7 +266,7 @@ void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &clas
MWBase::Environment::get().getWindowManager ()->messageBox(message.str(), MWGui::ShowInDialogueMode_Never); MWBase::Environment::get().getWindowManager ()->messageBox(message.str(), MWGui::ShowInDialogueMode_Never);
if (mLevelProgress >= gmst.find("iLevelUpTotal")->getInt()) if (mLevelProgress >= gmst.find("iLevelUpTotal")->mValue.getInteger())
{ {
// levelup is possible now // levelup is possible now
MWBase::Environment::get().getWindowManager ()->messageBox ("#{sLevelUpMsg}", MWGui::ShowInDialogueMode_Never); MWBase::Environment::get().getWindowManager ()->messageBox ("#{sLevelUpMsg}", MWGui::ShowInDialogueMode_Never);
@ -287,7 +287,7 @@ void MWMechanics::NpcStats::levelUp()
const MWWorld::Store<ESM::GameSetting> &gmst = const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
mLevelProgress -= gmst.find("iLevelUpTotal")->getInt(); mLevelProgress -= gmst.find("iLevelUpTotal")->mValue.getInteger();
mLevelProgress = std::max(0, mLevelProgress); // might be necessary when levelup was invoked via console mLevelProgress = std::max(0, mLevelProgress); // might be necessary when levelup was invoked via console
for (int i=0; i<ESM::Attribute::Length; ++i) for (int i=0; i<ESM::Attribute::Length; ++i)
@ -298,7 +298,7 @@ void MWMechanics::NpcStats::levelUp()
// "When you gain a level, in addition to increasing three primary attributes, your Health // "When you gain a level, in addition to increasing three primary attributes, your Health
// will automatically increase by 10% of your Endurance attribute. If you increased Endurance this level, // will automatically increase by 10% of your Endurance attribute. If you increased Endurance this level,
// the Health increase is calculated from the increased Endurance" // the Health increase is calculated from the increased Endurance"
setHealth(getHealth().getBase() + endurance * gmst.find("fLevelUpHealthEndMult")->getFloat()); setHealth(getHealth().getBase() + endurance * gmst.find("fLevelUpHealthEndMult")->mValue.getFloat());
setLevel(getLevel()+1); setLevel(getLevel()+1);
} }
@ -324,7 +324,7 @@ int MWMechanics::NpcStats::getLevelupAttributeMultiplier(int attribute) const
std::stringstream gmst; std::stringstream gmst;
gmst << "iLevelUp" << std::setfill('0') << std::setw(2) << num << "Mult"; gmst << "iLevelUp" << std::setfill('0') << std::setw(2) << num << "Mult";
return MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(gmst.str())->getInt(); return MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(gmst.str())->mValue.getInteger();
} }
int MWMechanics::NpcStats::getSkillIncreasesForSpecialization(int spec) const int MWMechanics::NpcStats::getSkillIncreasesForSpecialization(int spec) const

@ -37,9 +37,9 @@ namespace MWMechanics
float pcSneak = static_cast<float>(mThief.getClass().getSkill(mThief, ESM::Skill::Sneak)); float pcSneak = static_cast<float>(mThief.getClass().getSkill(mThief, ESM::Skill::Sneak));
int iPickMinChance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() int iPickMinChance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("iPickMinChance")->getInt(); .find("iPickMinChance")->mValue.getInteger();
int iPickMaxChance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() int iPickMaxChance = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("iPickMaxChance")->getInt(); .find("iPickMaxChance")->mValue.getInteger();
int roll = Misc::Rng::roll0to99(); int roll = Misc::Rng::roll0to99();
if (t < pcSneak / iPickMinChance) if (t < pcSneak / iPickMinChance)
@ -57,7 +57,7 @@ namespace MWMechanics
{ {
float stackValue = static_cast<float>(item.getClass().getValue(item) * count); float stackValue = static_cast<float>(item.getClass().getValue(item) * count);
float fPickPocketMod = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() float fPickPocketMod = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fPickPocketMod")->getFloat(); .find("fPickPocketMod")->mValue.getFloat();
float valueTerm = 10 * fPickPocketMod * stackValue; float valueTerm = 10 * fPickPocketMod * stackValue;
return getDetected(valueTerm); return getDetected(valueTerm);

@ -42,7 +42,7 @@ void Repair::repair(const MWWorld::Ptr &itemToRepair)
int armorerSkill = npcStats.getSkill(ESM::Skill::Armorer).getModified(); int armorerSkill = npcStats.getSkill(ESM::Skill::Armorer).getModified();
float fRepairAmountMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() float fRepairAmountMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fRepairAmountMult")->getFloat(); .find("fRepairAmountMult")->mValue.getFloat();
float toolQuality = ref->mBase->mData.mQuality; float toolQuality = ref->mBase->mData.mQuality;
@ -87,7 +87,7 @@ void Repair::repair(const MWWorld::Ptr &itemToRepair)
store.remove(mTool, 1, player); store.remove(mTool, 1, player);
std::string message = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() std::string message = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("sNotifyMessage51")->getString(); .find("sNotifyMessage51")->mValue.getString();
MWBase::Environment::get().getWindowManager()->messageBox((boost::format(message) % mTool.getClass().getName(mTool)).str()); MWBase::Environment::get().getWindowManager()->messageBox((boost::format(message) % mTool.getClass().getName(mTool)).str());

@ -40,7 +40,7 @@ namespace MWMechanics
float pickQuality = lockpick.get<ESM::Lockpick>()->mBase->mData.mQuality; float pickQuality = lockpick.get<ESM::Lockpick>()->mBase->mData.mQuality;
float fPickLockMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fPickLockMult")->getFloat(); float fPickLockMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fPickLockMult")->mValue.getFloat();
float x = 0.2f * mAgility + 0.1f * mLuck + mSecuritySkill; float x = 0.2f * mAgility + 0.1f * mLuck + mSecuritySkill;
x *= pickQuality * mFatigueTerm; x *= pickQuality * mFatigueTerm;
@ -81,7 +81,7 @@ namespace MWMechanics
const ESM::Spell* trapSpell = MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(trap.getCellRef().getTrap()); const ESM::Spell* trapSpell = MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(trap.getCellRef().getTrap());
int trapSpellPoints = trapSpell->mData.mCost; int trapSpellPoints = trapSpell->mData.mCost;
float fTrapCostMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fTrapCostMult")->getFloat(); float fTrapCostMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fTrapCostMult")->mValue.getFloat();
float x = 0.2f * mAgility + 0.1f * mLuck + mSecuritySkill; float x = 0.2f * mAgility + 0.1f * mLuck + mSecuritySkill;
x += fTrapCostMult * trapSpellPoints; x += fTrapCostMult * trapSpellPoints;

@ -62,7 +62,7 @@ namespace MWMechanics
duration = effect.mDuration; duration = effect.mDuration;
static const float fEffectCostMult = MWBase::Environment::get().getWorld()->getStore() static const float fEffectCostMult = MWBase::Environment::get().getWorld()->getStore()
.get<ESM::GameSetting>().find("fEffectCostMult")->getFloat(); .get<ESM::GameSetting>().find("fEffectCostMult")->mValue.getFloat();
float x = 0.5 * (std::max(1, minMagn) + std::max(1, maxMagn)); float x = 0.5 * (std::max(1, minMagn) + std::max(1, maxMagn));
x *= 0.1 * magicEffect->mData.mBaseCost; x *= 0.1 * magicEffect->mData.mBaseCost;
@ -93,7 +93,7 @@ namespace MWMechanics
if (it->mRange == ESM::RT_Target) if (it->mRange == ESM::RT_Target)
x *= 1.5f; x *= 1.5f;
static const float fEffectCostMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find( static const float fEffectCostMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
"fEffectCostMult")->getFloat(); "fEffectCostMult")->mValue.getFloat();
x *= fEffectCostMult; x *= fEffectCostMult;
float s = 2.0f * actor.getClass().getSkill(actor, spellSchoolToSkill(magicEffect->mData.mSchool)); float s = 2.0f * actor.getClass().getSkill(actor, spellSchoolToSkill(magicEffect->mData.mSchool));
@ -883,8 +883,8 @@ namespace MWMechanics
if (!godmode) if (!godmode)
{ {
// Reduce fatigue (note that in the vanilla game, both GMSTs are 0, and there's no fatigue loss) // Reduce fatigue (note that in the vanilla game, both GMSTs are 0, and there's no fatigue loss)
static const float fFatigueSpellBase = store.get<ESM::GameSetting>().find("fFatigueSpellBase")->getFloat(); static const float fFatigueSpellBase = store.get<ESM::GameSetting>().find("fFatigueSpellBase")->mValue.getFloat();
static const float fFatigueSpellMult = store.get<ESM::GameSetting>().find("fFatigueSpellMult")->getFloat(); static const float fFatigueSpellMult = store.get<ESM::GameSetting>().find("fFatigueSpellMult")->mValue.getFloat();
DynamicStat<float> fatigue = stats.getFatigue(); DynamicStat<float> fatigue = stats.getFatigue();
const float normalizedEncumbrance = mCaster.getClass().getNormalizedEncumbrance(mCaster); const float normalizedEncumbrance = mCaster.getClass().getNormalizedEncumbrance(mCaster);
@ -968,7 +968,7 @@ namespace MWMechanics
if (roll > x) if (roll > x)
{ {
// "X has no effect on you" // "X has no effect on you"
std::string message = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sNotifyMessage50")->getString(); std::string message = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sNotifyMessage50")->mValue.getString();
message = boost::str(boost::format(message) % ingredient->mName); message = boost::str(boost::format(message) % ingredient->mName);
MWBase::Environment::get().getWindowManager()->messageBox(message); MWBase::Environment::get().getWindowManager()->messageBox(message);
return false; return false;
@ -1251,7 +1251,7 @@ namespace MWMechanics
float damageScale = 1.f - timeDiff / 7.f; float damageScale = 1.f - timeDiff / 7.f;
// When cloudy, the sun damage effect is halved // When cloudy, the sun damage effect is halved
static float fMagicSunBlockedMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find( static float fMagicSunBlockedMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
"fMagicSunBlockedMult")->getFloat(); "fMagicSunBlockedMult")->mValue.getFloat();
int weather = MWBase::Environment::get().getWorld()->getCurrentWeather(); int weather = MWBase::Environment::get().getWorld()->getCurrentWeather();
if (weather > 1) if (weather > 1)
@ -1348,7 +1348,7 @@ namespace MWMechanics
if (it == summonMap.end()) if (it == summonMap.end())
return std::string(); return std::string();
else else
return MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(it->second)->getString(); return MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(it->second)->mValue.getString();
} }
void ApplyLoopingParticlesVisitor::visit (MWMechanics::EffectKey key, void ApplyLoopingParticlesVisitor::visit (MWMechanics::EffectKey key,

@ -593,8 +593,8 @@ namespace MWMechanics
{ {
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
static const float fAIMagicSpellMult = gmst.find("fAIMagicSpellMult")->getFloat(); static const float fAIMagicSpellMult = gmst.find("fAIMagicSpellMult")->mValue.getFloat();
static const float fAIRangeMagicSpellMult = gmst.find("fAIRangeMagicSpellMult")->getFloat(); static const float fAIRangeMagicSpellMult = gmst.find("fAIRangeMagicSpellMult")->mValue.getFloat();
float mult = fAIMagicSpellMult; float mult = fAIMagicSpellMult;

@ -50,11 +50,11 @@ namespace MWMechanics
float e1 = 0.1f * merchantStats.getAttribute(ESM::Attribute::Luck).getModified(); float e1 = 0.1f * merchantStats.getAttribute(ESM::Attribute::Luck).getModified();
float f1 = 0.2f * merchantStats.getAttribute(ESM::Attribute::Personality).getModified(); float f1 = 0.2f * merchantStats.getAttribute(ESM::Attribute::Personality).getModified();
float dispositionTerm = gmst.find("fDispositionMod")->getFloat() * (clampedDisposition - 50); float dispositionTerm = gmst.find("fDispositionMod")->mValue.getFloat() * (clampedDisposition - 50);
float pcTerm = (dispositionTerm + a1 + b1 + c1) * playerStats.getFatigueTerm(); float pcTerm = (dispositionTerm + a1 + b1 + c1) * playerStats.getFatigueTerm();
float npcTerm = (d1 + e1 + f1) * merchantStats.getFatigueTerm(); float npcTerm = (d1 + e1 + f1) * merchantStats.getFatigueTerm();
float x = gmst.find("fBargainOfferMulti")->getFloat() * d float x = gmst.find("fBargainOfferMulti")->mValue.getFloat() * d
+ gmst.find("fBargainOfferBase")->getFloat() + gmst.find("fBargainOfferBase")->mValue.getFloat()
+ int(pcTerm - npcTerm); + int(pcTerm - npcTerm);
int roll = Misc::Rng::rollDice(100) + 1; int roll = Misc::Rng::rollDice(100) + 1;

@ -157,9 +157,9 @@ namespace MWMechanics
{ {
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
static const float fAIMeleeWeaponMult = gmst.find("fAIMeleeWeaponMult")->getFloat(); static const float fAIMeleeWeaponMult = gmst.find("fAIMeleeWeaponMult")->mValue.getFloat();
static const float fAIMeleeArmorMult = gmst.find("fAIMeleeArmorMult")->getFloat(); static const float fAIMeleeArmorMult = gmst.find("fAIMeleeArmorMult")->mValue.getFloat();
static const float fAIRangeMeleeWeaponMult = gmst.find("fAIRangeMeleeWeaponMult")->getFloat(); static const float fAIRangeMeleeWeaponMult = gmst.find("fAIRangeMeleeWeaponMult")->mValue.getFloat();
if (weapon.isEmpty()) if (weapon.isEmpty())
return 0.f; return 0.f;

@ -303,7 +303,7 @@ namespace MWPhysics
position.z() += halfExtents.z(); position.z() += halfExtents.z();
static const float fSwimHeightScale = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() static const float fSwimHeightScale = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fSwimHeightScale")->getFloat(); .find("fSwimHeightScale")->mValue.getFloat();
float swimlevel = waterlevel + halfExtents.z() - (physicActor->getRenderingHalfExtents().z() * 2 * fSwimHeightScale); float swimlevel = waterlevel + halfExtents.z() - (physicActor->getRenderingHalfExtents().z() * 2 * fSwimHeightScale);
ActorTracer tracer; ActorTracer tracer;
@ -339,7 +339,7 @@ namespace MWPhysics
osg::Vec3f stormDirection = MWBase::Environment::get().getWorld()->getStormDirection(); osg::Vec3f stormDirection = MWBase::Environment::get().getWorld()->getStormDirection();
float angleDegrees = osg::RadiansToDegrees(std::acos(stormDirection * velocity / (stormDirection.length() * velocity.length()))); float angleDegrees = osg::RadiansToDegrees(std::acos(stormDirection * velocity / (stormDirection.length() * velocity.length())));
static const float fStromWalkMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() static const float fStromWalkMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fStromWalkMult")->getFloat(); .find("fStromWalkMult")->mValue.getFloat();
velocity *= 1.f-(fStromWalkMult * (angleDegrees/180.f)); velocity *= 1.f-(fStromWalkMult * (angleDegrees/180.f));
} }
@ -860,8 +860,8 @@ namespace MWPhysics
// Use cone shape as fallback // Use cone shape as fallback
const MWWorld::Store<ESM::GameSetting> &store = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting> &store = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
btConeShape shape (osg::DegreesToRadians(store.find("fCombatAngleXY")->getFloat()/2.0f), queryDistance); btConeShape shape (osg::DegreesToRadians(store.find("fCombatAngleXY")->mValue.getFloat()/2.0f), queryDistance);
shape.setLocalScaling(btVector3(1, 1, osg::DegreesToRadians(store.find("fCombatAngleZ")->getFloat()/2.0f) / shape.setLocalScaling(btVector3(1, 1, osg::DegreesToRadians(store.find("fCombatAngleZ")->mValue.getFloat()/2.0f) /
shape.getRadius())); shape.getRadius()));
// The shape origin is its center, so we have to move it forward by half the length. The // The shape origin is its center, so we have to move it forward by half the length. The

@ -119,8 +119,8 @@ void WeaponAnimation::releaseArrow(MWWorld::Ptr actor, float attackStrength)
return; return;
osg::Vec3f launchPos = osg::computeLocalToWorld(nodepaths[0]).getTrans(); osg::Vec3f launchPos = osg::computeLocalToWorld(nodepaths[0]).getTrans();
float fThrownWeaponMinSpeed = gmst.find("fThrownWeaponMinSpeed")->getFloat(); float fThrownWeaponMinSpeed = gmst.find("fThrownWeaponMinSpeed")->mValue.getFloat();
float fThrownWeaponMaxSpeed = gmst.find("fThrownWeaponMaxSpeed")->getFloat(); float fThrownWeaponMaxSpeed = gmst.find("fThrownWeaponMaxSpeed")->mValue.getFloat();
float speed = fThrownWeaponMinSpeed + (fThrownWeaponMaxSpeed - fThrownWeaponMinSpeed) * attackStrength; float speed = fThrownWeaponMinSpeed + (fThrownWeaponMaxSpeed - fThrownWeaponMinSpeed) * attackStrength;
MWWorld::Ptr weaponPtr = *weapon; MWWorld::Ptr weaponPtr = *weapon;
@ -146,8 +146,8 @@ void WeaponAnimation::releaseArrow(MWWorld::Ptr actor, float attackStrength)
return; return;
osg::Vec3f launchPos = osg::computeLocalToWorld(nodepaths[0]).getTrans(); osg::Vec3f launchPos = osg::computeLocalToWorld(nodepaths[0]).getTrans();
float fProjectileMinSpeed = gmst.find("fProjectileMinSpeed")->getFloat(); float fProjectileMinSpeed = gmst.find("fProjectileMinSpeed")->mValue.getFloat();
float fProjectileMaxSpeed = gmst.find("fProjectileMaxSpeed")->getFloat(); float fProjectileMaxSpeed = gmst.find("fProjectileMaxSpeed")->mValue.getFloat();
float speed = fProjectileMinSpeed + (fProjectileMaxSpeed - fProjectileMinSpeed) * attackStrength; float speed = fProjectileMinSpeed + (fProjectileMaxSpeed - fProjectileMinSpeed) * attackStrength;
MWWorld::Ptr weaponPtr = *weapon; MWWorld::Ptr weaponPtr = *weapon;

@ -139,10 +139,10 @@ namespace MWSound
Sound_Buffer *SoundManager::insertSound(const std::string &soundId, const ESM::Sound *sound) Sound_Buffer *SoundManager::insertSound(const std::string &soundId, const ESM::Sound *sound)
{ {
MWBase::World* world = MWBase::Environment::get().getWorld(); MWBase::World* world = MWBase::Environment::get().getWorld();
static const float fAudioDefaultMinDistance = world->getStore().get<ESM::GameSetting>().find("fAudioDefaultMinDistance")->getFloat(); static const float fAudioDefaultMinDistance = world->getStore().get<ESM::GameSetting>().find("fAudioDefaultMinDistance")->mValue.getFloat();
static const float fAudioDefaultMaxDistance = world->getStore().get<ESM::GameSetting>().find("fAudioDefaultMaxDistance")->getFloat(); static const float fAudioDefaultMaxDistance = world->getStore().get<ESM::GameSetting>().find("fAudioDefaultMaxDistance")->mValue.getFloat();
static const float fAudioMinDistanceMult = world->getStore().get<ESM::GameSetting>().find("fAudioMinDistanceMult")->getFloat(); static const float fAudioMinDistanceMult = world->getStore().get<ESM::GameSetting>().find("fAudioMinDistanceMult")->mValue.getFloat();
static const float fAudioMaxDistanceMult = world->getStore().get<ESM::GameSetting>().find("fAudioMaxDistanceMult")->getFloat(); static const float fAudioMaxDistanceMult = world->getStore().get<ESM::GameSetting>().find("fAudioMaxDistanceMult")->mValue.getFloat();
float volume, min, max; float volume, min, max;
volume = static_cast<float>(pow(10.0, (sound->mData.mVolume / 255.0*3348.0 - 3348.0) / 2000.0)); volume = static_cast<float>(pow(10.0, (sound->mData.mVolume / 255.0*3348.0 - 3348.0) / 2000.0));
@ -296,10 +296,10 @@ namespace MWSound
Stream *SoundManager::playVoice(DecoderPtr decoder, const osg::Vec3f &pos, bool playlocal) Stream *SoundManager::playVoice(DecoderPtr decoder, const osg::Vec3f &pos, bool playlocal)
{ {
MWBase::World* world = MWBase::Environment::get().getWorld(); MWBase::World* world = MWBase::Environment::get().getWorld();
static const float fAudioMinDistanceMult = world->getStore().get<ESM::GameSetting>().find("fAudioMinDistanceMult")->getFloat(); static const float fAudioMinDistanceMult = world->getStore().get<ESM::GameSetting>().find("fAudioMinDistanceMult")->mValue.getFloat();
static const float fAudioMaxDistanceMult = world->getStore().get<ESM::GameSetting>().find("fAudioMaxDistanceMult")->getFloat(); static const float fAudioMaxDistanceMult = world->getStore().get<ESM::GameSetting>().find("fAudioMaxDistanceMult")->mValue.getFloat();
static const float fAudioVoiceDefaultMinDistance = world->getStore().get<ESM::GameSetting>().find("fAudioVoiceDefaultMinDistance")->getFloat(); static const float fAudioVoiceDefaultMinDistance = world->getStore().get<ESM::GameSetting>().find("fAudioVoiceDefaultMinDistance")->mValue.getFloat();
static const float fAudioVoiceDefaultMaxDistance = world->getStore().get<ESM::GameSetting>().find("fAudioVoiceDefaultMaxDistance")->getFloat(); static const float fAudioVoiceDefaultMaxDistance = world->getStore().get<ESM::GameSetting>().find("fAudioVoiceDefaultMaxDistance")->mValue.getFloat();
static float minDistance = std::max(fAudioVoiceDefaultMinDistance * fAudioMinDistanceMult, 1.0f); static float minDistance = std::max(fAudioVoiceDefaultMinDistance * fAudioMinDistanceMult, 1.0f);
static float maxDistance = std::max(fAudioVoiceDefaultMaxDistance * fAudioMaxDistanceMult, minDistance); static float maxDistance = std::max(fAudioVoiceDefaultMaxDistance * fAudioMaxDistanceMult, minDistance);

@ -944,7 +944,7 @@ namespace MWWorld
void clearCorpse(const MWWorld::Ptr& ptr) void clearCorpse(const MWWorld::Ptr& ptr)
{ {
const MWMechanics::CreatureStats& creatureStats = ptr.getClass().getCreatureStats(ptr); const MWMechanics::CreatureStats& creatureStats = ptr.getClass().getCreatureStats(ptr);
static const float fCorpseClearDelay = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fCorpseClearDelay")->getFloat(); static const float fCorpseClearDelay = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fCorpseClearDelay")->mValue.getFloat();
if (creatureStats.isDead() && if (creatureStats.isDead() &&
creatureStats.isDeathAnimationFinished() && creatureStats.isDeathAnimationFinished() &&
!ptr.getClass().isPersistent(ptr) && !ptr.getClass().isPersistent(ptr) &&
@ -958,7 +958,7 @@ namespace MWWorld
{ {
if (mState == State_Loaded) if (mState == State_Loaded)
{ {
static const int iMonthsToRespawn = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iMonthsToRespawn")->getInt(); static const int iMonthsToRespawn = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("iMonthsToRespawn")->mValue.getInteger();
if (MWBase::Environment::get().getWorld()->getTimeStamp() - mLastRespawn > 24*30*iMonthsToRespawn) if (MWBase::Environment::get().getWorld()->getTimeStamp() - mLastRespawn > 24*30*iMonthsToRespawn)
{ {
mLastRespawn = MWBase::Environment::get().getWorld()->getTimeStamp(); mLastRespawn = MWBase::Environment::get().getWorld()->getTimeStamp();

@ -252,8 +252,8 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
const MWWorld::Store<ESM::GameSetting> &store = world->getStore().get<ESM::GameSetting>(); const MWWorld::Store<ESM::GameSetting> &store = world->getStore().get<ESM::GameSetting>();
MWMechanics::NpcStats& stats = actor.getClass().getNpcStats(actor); MWMechanics::NpcStats& stats = actor.getClass().getNpcStats(actor);
static float fUnarmoredBase1 = store.find("fUnarmoredBase1")->getFloat(); static float fUnarmoredBase1 = store.find("fUnarmoredBase1")->mValue.getFloat();
static float fUnarmoredBase2 = store.find("fUnarmoredBase2")->getFloat(); static float fUnarmoredBase2 = store.find("fUnarmoredBase2")->mValue.getFloat();
int unarmoredSkill = stats.getSkill(ESM::Skill::Unarmored).getModified(); int unarmoredSkill = stats.getSkill(ESM::Skill::Unarmored).getModified();
float unarmoredRating = (fUnarmoredBase1 * unarmoredSkill) * (fUnarmoredBase2 * unarmoredSkill); float unarmoredRating = (fUnarmoredBase1 * unarmoredSkill) * (fUnarmoredBase2 * unarmoredSkill);
@ -921,7 +921,7 @@ void MWWorld::InventoryStore::rechargeItems(float duration)
continue; continue;
static float fMagicItemRechargePerSecond = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find( static float fMagicItemRechargePerSecond = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(
"fMagicItemRechargePerSecond")->getFloat(); "fMagicItemRechargePerSecond")->mValue.getFloat();
if (it->first->getCellRef().getEnchantmentCharge() <= it->second) if (it->first->getCellRef().getEnchantmentCharge() <= it->second)
{ {

@ -64,7 +64,7 @@ namespace MWWorld
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(int(health.getBase() / gmst.find("fWereWolfHealth")->getFloat())); creatureStats.setHealth(int(health.getBase() / gmst.find("fWereWolfHealth")->mValue.getFloat()));
for (int i=0; i<ESM::Skill::Length; ++i) for (int i=0; i<ESM::Skill::Length; ++i)
npcStats.setSkill(i, mSaveSkills[i]); npcStats.setSkill(i, mSaveSkills[i]);
for (int i=0; i<ESM::Attribute::Length; ++i) for (int i=0; i<ESM::Attribute::Length; ++i)
@ -77,7 +77,7 @@ namespace MWWorld
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(int(health.getBase() * gmst.find("fWereWolfHealth")->getFloat())); creatureStats.setHealth(int(health.getBase() * gmst.find("fWereWolfHealth")->mValue.getFloat()));
for(size_t i = 0;i < ESM::Attribute::Length;++i) for(size_t i = 0;i < ESM::Attribute::Length;++i)
{ {
// Oh, Bethesda. It's "Intelligence". // Oh, Bethesda. It's "Intelligence".
@ -85,7 +85,7 @@ namespace MWWorld
ESM::Attribute::sAttributeNames[i]); ESM::Attribute::sAttributeNames[i]);
MWMechanics::AttributeValue value = npcStats.getAttribute(i); MWMechanics::AttributeValue value = npcStats.getAttribute(i);
value.setBase(int(gmst.find(name)->getFloat())); value.setBase(int(gmst.find(name)->mValue.getFloat()));
npcStats.setAttribute(i, value); npcStats.setAttribute(i, value);
} }
@ -100,7 +100,7 @@ namespace MWWorld
ESM::Skill::sSkillNames[i]); ESM::Skill::sSkillNames[i]);
MWMechanics::SkillValue value = npcStats.getSkill(i); MWMechanics::SkillValue value = npcStats.getSkill(i);
value.setBase(int(gmst.find(name)->getFloat())); value.setBase(int(gmst.find(name)->mValue.getFloat()));
npcStats.setSkill(i, value); npcStats.setSkill(i, value);
} }
} }

@ -385,7 +385,7 @@ namespace MWWorld
{ {
osg::Quat orient = it->mNode->getAttitude(); osg::Quat orient = it->mNode->getAttitude();
static float fTargetSpellMaxSpeed = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>() static float fTargetSpellMaxSpeed = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("fTargetSpellMaxSpeed")->getFloat(); .find("fTargetSpellMaxSpeed")->mValue.getFloat();
float speed = fTargetSpellMaxSpeed * it->mSpeed; float speed = fTargetSpellMaxSpeed * it->mSpeed;
osg::Vec3f direction = orient * osg::Vec3f(0,1,0); osg::Vec3f direction = orient * osg::Vec3f(0,1,0);
direction.normalize(); direction.normalize();

@ -911,7 +911,7 @@ inline void WeatherManager::addWeather(const std::string& name,
float dlFactor, float dlOffset, float dlFactor, float dlOffset,
const std::string& particleEffect) const std::string& particleEffect)
{ {
static const float fStromWindSpeed = mStore.get<ESM::GameSetting>().find("fStromWindSpeed")->getFloat(); static const float fStromWindSpeed = mStore.get<ESM::GameSetting>().find("fStromWindSpeed")->mValue.getFloat();
Weather weather(name, fallback, fStromWindSpeed, mRainSpeed, dlFactor, dlOffset, particleEffect); Weather weather(name, fallback, fStromWindSpeed, mRainSpeed, dlFactor, dlOffset, particleEffect);

@ -190,7 +190,7 @@ namespace MWWorld
mStore.setUp(true); mStore.setUp(true);
mStore.movePlayerRecord(); mStore.movePlayerRecord();
mSwimHeightScale = mStore.get<ESM::GameSetting>().find("fSwimHeightScale")->getFloat(); mSwimHeightScale = mStore.get<ESM::GameSetting>().find("fSwimHeightScale")->mValue.getFloat();
mWeatherManager.reset(new MWWorld::WeatherManager(*mRendering, mFallback, mStore)); mWeatherManager.reset(new MWWorld::WeatherManager(*mRendering, mFallback, mStore));
@ -1026,7 +1026,7 @@ namespace MWWorld
if (mActivationDistanceOverride >= 0) if (mActivationDistanceOverride >= 0)
return static_cast<float>(mActivationDistanceOverride); return static_cast<float>(mActivationDistanceOverride);
static const int iMaxActivateDist = getStore().get<ESM::GameSetting>().find("iMaxActivateDist")->getInt(); static const int iMaxActivateDist = getStore().get<ESM::GameSetting>().find("iMaxActivateDist")->mValue.getInteger();
return static_cast<float>(iMaxActivateDist); return static_cast<float>(iMaxActivateDist);
} }
@ -1709,7 +1709,7 @@ namespace MWWorld
bool swimming = isSwimming(player); bool swimming = isSwimming(player);
bool flying = isFlying(player); bool flying = isFlying(player);
static const float i1stPersonSneakDelta = getStore().get<ESM::GameSetting>().find("i1stPersonSneakDelta")->getFloat(); static const float i1stPersonSneakDelta = getStore().get<ESM::GameSetting>().find("i1stPersonSneakDelta")->mValue.getFloat();
if (sneaking && !swimming && !flying) if (sneaking && !swimming && !flying)
mRendering->getCamera()->setSneakOffset(i1stPersonSneakDelta); mRendering->getCamera()->setSneakOffset(i1stPersonSneakDelta);
else else
@ -2803,7 +2803,7 @@ namespace MWWorld
if (!actor.isEmpty() && actor != MWMechanics::getPlayer() && !manualSpell) if (!actor.isEmpty() && actor != MWMechanics::getPlayer() && !manualSpell)
stats.getAiSequence().getCombatTargets(targetActors); stats.getAiSequence().getCombatTargets(targetActors);
const float fCombatDistance = getStore().get<ESM::GameSetting>().find("fCombatDistance")->getFloat(); const float fCombatDistance = getStore().get<ESM::GameSetting>().find("fCombatDistance")->mValue.getFloat();
osg::Vec3f hitPosition = actor.getRefData().getPosition().asVec3(); osg::Vec3f hitPosition = actor.getRefData().getPosition().asVec3();
@ -3267,8 +3267,8 @@ namespace MWWorld
int bounty = player.getClass().getNpcStats(player).getBounty(); int bounty = player.getClass().getNpcStats(player).getBounty();
int playerGold = player.getClass().getContainerStore(player).count(ContainerStore::sGoldId); int playerGold = player.getClass().getContainerStore(player).count(ContainerStore::sGoldId);
float fCrimeGoldDiscountMult = getStore().get<ESM::GameSetting>().find("fCrimeGoldDiscountMult")->getFloat(); float fCrimeGoldDiscountMult = getStore().get<ESM::GameSetting>().find("fCrimeGoldDiscountMult")->mValue.getFloat();
float fCrimeGoldTurnInMult = getStore().get<ESM::GameSetting>().find("fCrimeGoldTurnInMult")->getFloat(); float fCrimeGoldTurnInMult = getStore().get<ESM::GameSetting>().find("fCrimeGoldTurnInMult")->mValue.getFloat();
int discount = static_cast<int>(bounty * fCrimeGoldDiscountMult); int discount = static_cast<int>(bounty * fCrimeGoldDiscountMult);
int turnIn = static_cast<int>(bounty * fCrimeGoldTurnInMult); int turnIn = static_cast<int>(bounty * fCrimeGoldTurnInMult);
@ -3333,7 +3333,7 @@ namespace MWWorld
mPlayer->recordCrimeId(); mPlayer->recordCrimeId();
confiscateStolenItems(player); confiscateStolenItems(player);
int iDaysinPrisonMod = getStore().get<ESM::GameSetting>().find("iDaysinPrisonMod")->getInt(); int iDaysinPrisonMod = getStore().get<ESM::GameSetting>().find("iDaysinPrisonMod")->mValue.getInteger();
mDaysInPrison = std::max(1, bounty / iDaysinPrisonMod); mDaysInPrison = std::max(1, bounty / iDaysinPrisonMod);
return; return;
@ -3391,7 +3391,7 @@ namespace MWWorld
{ {
const ESM::CreatureLevList* list = getStore().get<ESM::CreatureLevList>().find(creatureList); const ESM::CreatureLevList* list = getStore().get<ESM::CreatureLevList>().find(creatureList);
int iNumberCreatures = getStore().get<ESM::GameSetting>().find("iNumberCreatures")->getInt(); int iNumberCreatures = getStore().get<ESM::GameSetting>().find("iNumberCreatures")->mValue.getInteger();
int numCreatures = 1 + Misc::Rng::rollDice(iNumberCreatures); // [1, iNumberCreatures] int numCreatures = 1 + Misc::Rng::rollDice(iNumberCreatures); // [1, iNumberCreatures]
for (int i=0; i<numCreatures; ++i) for (int i=0; i<numCreatures; ++i)

@ -22,21 +22,6 @@ namespace ESM
mValue.write (esm, ESM::Variant::Format_Gmst); mValue.write (esm, ESM::Variant::Format_Gmst);
} }
int GameSetting::getInt() const
{
return mValue.getInteger();
}
float GameSetting::getFloat() const
{
return mValue.getFloat();
}
std::string GameSetting::getString() const
{
return mValue.getString();
}
void GameSetting::blank() void GameSetting::blank()
{ {
mValue.setType (ESM::VT_None); mValue.setType (ESM::VT_None);

@ -28,17 +28,6 @@ struct GameSetting
void load(ESMReader &esm, bool &isDeleted); void load(ESMReader &esm, bool &isDeleted);
/// \todo remove the get* functions (redundant, since mValue has equivalent functions now).
int getInt() const;
///< Throws an exception if GMST is not of type int or float.
float getFloat() const;
///< Throws an exception if GMST is not of type int or float.
std::string getString() const;
///< Throwns an exception if GMST is not of type string.
void save(ESMWriter &esm, bool isDeleted = false) const; void save(ESMWriter &esm, bool isDeleted = false) const;
void blank(); void blank();

Loading…
Cancel
Save