mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-20 00:41:33 +00:00
Use Rebalance soulgem values option to set soulgem value
This commit is contained in:
parent
0320f9a74d
commit
9346a552fa
1 changed files with 16 additions and 11 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include "misc.hpp"
|
#include "misc.hpp"
|
||||||
|
|
||||||
#include <components/esm/loadmisc.hpp>
|
#include <components/esm/loadmisc.hpp>
|
||||||
|
#include <components/settings/settings.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
@ -84,9 +85,10 @@ namespace MWClass
|
||||||
if (ptr.getCellRef().getSoul() != "")
|
if (ptr.getCellRef().getSoul() != "")
|
||||||
{
|
{
|
||||||
const ESM::Creature *creature = MWBase::Environment::get().getWorld()->getStore().get<ESM::Creature>().search(ref->mRef.getSoul());
|
const ESM::Creature *creature = MWBase::Environment::get().getWorld()->getStore().get<ESM::Creature>().search(ref->mRef.getSoul());
|
||||||
if (creature) {
|
if (creature)
|
||||||
// value *= creature->mData.mSoul;
|
{
|
||||||
|
if (Settings::Manager::getBool("rebalance soulgem values", "Game"))
|
||||||
|
{
|
||||||
// use soulgem value rebalance formula from morrowind code patch
|
// use soulgem value rebalance formula from morrowind code patch
|
||||||
int soul = creature->mData.mSoul;
|
int soul = creature->mData.mSoul;
|
||||||
float soulValue = 0.0001 * pow(soul, 3) + 2 * soul;
|
float soulValue = 0.0001 * pow(soul, 3) + 2 * soul;
|
||||||
|
@ -97,6 +99,9 @@ namespace MWClass
|
||||||
else
|
else
|
||||||
value = soulValue;
|
value = soulValue;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
value *= creature->mData.mSoul;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
|
Loading…
Reference in a new issue