mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-12 12:38:02 +00:00
Use fWortChanceValue for making ingredient/potion effects visible
This commit is contained in:
parent
320ba98097
commit
61ab6e1739
@ -156,6 +156,9 @@ namespace MWClass
|
||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
|
||||
int alchemySkill = npcStats.getSkill (ESM::Skill::Alchemy).getBase();
|
||||
|
||||
static const float fWortChanceValue =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fWortChanceValue")->getFloat();
|
||||
|
||||
MWGui::Widgets::SpellEffectList list;
|
||||
for (int i=0; i<4; ++i)
|
||||
{
|
||||
@ -166,10 +169,10 @@ namespace MWClass
|
||||
params.mAttribute = ref->mBase->mData.mAttributes[i];
|
||||
params.mSkill = ref->mBase->mData.mSkills[i];
|
||||
|
||||
params.mKnown = ( (i == 0 && alchemySkill >= 15)
|
||||
|| (i == 1 && alchemySkill >= 30)
|
||||
|| (i == 2 && alchemySkill >= 45)
|
||||
|| (i == 3 && alchemySkill >= 60));
|
||||
params.mKnown = ( (i == 0 && alchemySkill >= fWortChanceValue)
|
||||
|| (i == 1 && alchemySkill >= fWortChanceValue*2)
|
||||
|| (i == 2 && alchemySkill >= fWortChanceValue*3)
|
||||
|| (i == 3 && alchemySkill >= fWortChanceValue*4));
|
||||
|
||||
list.push_back(params);
|
||||
}
|
||||
|
@ -137,13 +137,14 @@ namespace MWClass
|
||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
|
||||
int alchemySkill = npcStats.getSkill (ESM::Skill::Alchemy).getBase();
|
||||
int i=0;
|
||||
static const float fWortChanceValue =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fWortChanceValue")->getFloat();
|
||||
for (MWGui::Widgets::SpellEffectList::iterator it = info.effects.begin(); it != info.effects.end(); ++it)
|
||||
{
|
||||
/// \todo this code is duplicated from mwclass/ingredient, put it in a helper function
|
||||
it->mKnown = ( (i == 0 && alchemySkill >= 15)
|
||||
|| (i == 1 && alchemySkill >= 30)
|
||||
|| (i == 2 && alchemySkill >= 45)
|
||||
|| (i == 3 && alchemySkill >= 60));
|
||||
it->mKnown = ( (i == 0 && alchemySkill >= fWortChanceValue)
|
||||
|| (i == 1 && alchemySkill >= fWortChanceValue*2)
|
||||
|| (i == 2 && alchemySkill >= fWortChanceValue*3)
|
||||
|| (i == 3 && alchemySkill >= fWortChanceValue*4));
|
||||
|
||||
++i;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user