Implement fPCbaseMagickaMult and fNPCbaseMagickaMult

This commit is contained in:
scrawl 2014-09-18 14:56:43 +02:00
parent c05874e1ff
commit b39fe85a51

View file

@ -397,8 +397,14 @@ namespace MWMechanics
int agility = creatureStats.getAttribute(ESM::Attribute::Agility).getModified(); int agility = creatureStats.getAttribute(ESM::Attribute::Agility).getModified();
int endurance = creatureStats.getAttribute(ESM::Attribute::Endurance).getModified(); int endurance = creatureStats.getAttribute(ESM::Attribute::Endurance).getModified();
double magickaFactor = float base = 1.f;
creatureStats.getMagicEffects().get (EffectKey (ESM::MagicEffect::FortifyMaximumMagicka)).getMagnitude() * 0.1 + 1; if (ptr.getCellRef().getRefId() == "player")
base = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fPCbaseMagickaMult")->getFloat();
else
base = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fNPCbaseMagickaMult")->getFloat();
double magickaFactor = base +
creatureStats.getMagicEffects().get (EffectKey (ESM::MagicEffect::FortifyMaximumMagicka)).getMagnitude() * 0.1;
DynamicStat<float> magicka = creatureStats.getMagicka(); DynamicStat<float> magicka = creatureStats.getMagicka();
float diff = (static_cast<int>(magickaFactor*intelligence)) - magicka.getBase(); float diff = (static_cast<int>(magickaFactor*intelligence)) - magicka.getBase();