mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
The 3 skill selected by a trainer are based on its 3 best skills.
The skills are sorted either on their base value or on their modified one depending on the new setting 'trainers training skills based on base skill'
This commit is contained in:
parent
0c2fea8254
commit
281cef9769
@ -14,6 +14,8 @@
|
||||
#include "../mwmechanics/npcstats.hpp"
|
||||
#include "../mwmechanics/actorutil.hpp"
|
||||
|
||||
#include <components/settings/settings.hpp>
|
||||
|
||||
#include "tooltips.hpp"
|
||||
|
||||
namespace
|
||||
@ -32,6 +34,17 @@ bool sortSkills (const std::pair<int, int>& left, const std::pair<int, int>& rig
|
||||
|
||||
return left.first < right.first;
|
||||
}
|
||||
|
||||
// Retrieve the base skill value if the setting 'training skills based on base skill' is set;
|
||||
// otherwise returns the modified skill
|
||||
float getSkillForTraining(const MWMechanics::NpcStats& stats, int i)
|
||||
{
|
||||
static const bool trainersTrainingSkillsBasedOnBaseSkill = Settings::Manager::getBool("trainers training skills based on base skill", "Game");
|
||||
if (trainersTrainingSkillsBasedOnBaseSkill)
|
||||
return stats.getSkill(i).getBase();
|
||||
return stats.getSkill(i).getModified();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace MWGui
|
||||
@ -76,9 +89,10 @@ namespace MWGui
|
||||
// NPC can train you in his best 3 skills
|
||||
std::vector< std::pair<int, float> > skills;
|
||||
|
||||
MWMechanics::NpcStats const& actorStats(actor.getClass().getNpcStats(actor));
|
||||
for (int i=0; i<ESM::Skill::Length; ++i)
|
||||
{
|
||||
float value = actor.getClass().getSkill(actor, i);
|
||||
float value = getSkillForTraining(actorStats, i);
|
||||
|
||||
skills.push_back(std::make_pair(i, value));
|
||||
}
|
||||
|
@ -310,6 +310,9 @@ uncapped damage fatigue = false
|
||||
# Turn lower body to movement direction. 'true' makes diagonal movement more realistic.
|
||||
turn to movement direction = false
|
||||
|
||||
# Make the training skills proposed by a trainer based on its base attribute instead of its modified ones
|
||||
trainers training skills based on base skill = false
|
||||
|
||||
[General]
|
||||
|
||||
# Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16).
|
||||
|
Loading…
x
Reference in New Issue
Block a user