@@ -414,9 +414,9 @@ Your skin is tough. Cutting damage is slightly reduced for you."},
{"Packmule", 3, 0, 0, "\
You can manage to find space for anything! You can carry 40%% more volume."},
{"Fast Learner", 3, 0, 0, "\
Your skill comprehension is 50%% higher, allowing you to learn skills much\n\
faster than others. Note that this only applies to real-world experience,\n\
not to skill gain from other sources like books."},
You have a flexible mind, allowing you to learn skills much faster than\n\
others. Note that this only applies to real-world experience, not to skill\n\
gain from other sources like books."},
{"Deft", 2, 0, 0, "\
While you're not any better at melee combat, you are better at recovering\n\
from a miss, and will be able to attempt another strike faster."},
@@ -111,50 +111,13 @@ SkillLevel::SkillLevel(int minLevel, int maxLevel, int minExercise, int maxExerc
}
}

int SkillLevel::comprehension(int intellect, bool fastLearner) {
if (intellect == 0)
return 0;
void SkillLevel::train(int amount) {
_exercise += amount;

int base_comprehension;

if (intellect <= 8) {
base_comprehension = intellect * 10;
} else {
base_comprehension = 80 + (intellect - 8) * 8;
}

if (fastLearner) {
base_comprehension = base_comprehension / 2 * 3;
}

int skill_penalty;

if (_level <= intellect / 2) {
skill_penalty = 0;
} else if (_level <= intellect) {
skill_penalty = _level;
} else {
skill_penalty = _level * 2;
}

if (skill_penalty >= base_comprehension) {
return 1;
} else {
return base_comprehension - skill_penalty;
}
}

int SkillLevel::train(int &level) {
++_exercise;

if (_exercise >= 100) {
if (_exercise >= 100 * (_level + 1)) {
_exercise = 0;
++_level;
}

level = _level;

return _exercise;
}

static int rustRate(int level)
@@ -180,11 +143,11 @@ bool SkillLevel::rust(const calendar& turn, bool forgetful, bool charged_bio_mem
if (OPTIONS[OPT_SKILL_RUST] == 0 || _exercise > 0)
{
if (charged_bio_mem) return one_in(5);
--_exercise;
_exercise -= _level;

if (_exercise < 0)
{
_exercise = 99;
_exercise = (100 * _level) - 1;
--_level;
}
}
@@ -198,23 +161,16 @@ void SkillLevel::practice(const calendar& turn)
_lastPracticed = turn;
}

int SkillLevel::readBook(int minimumGain, int maximumGain, const calendar& turn,
int maximumLevel)
void SkillLevel::readBook(int minimumGain, int maximumGain, const calendar &turn,
int maximumLevel)
{
int gain = rng(minimumGain, maximumGain);

int level;
int gain = rng(minimumGain, maximumGain);

for (int i = 0; i < gain; ++i) {
train(level);

if (level >= maximumLevel)
break;
}

practice(turn);

return _exercise;
if (_level < maximumLevel)
{
train(gain);
}
practice(turn);
}


@@ -73,18 +73,16 @@ class SkillLevel {
int level() const { return _level; }
int level(int plevel) { _level = plevel; return plevel; }

int exercise() const { return _exercise; }
int exercise() const { return _exercise / (_level + 1); }

int lastPracticed() const { return _lastPracticed; }

int comprehension(int intellect, bool fastLearner = false);

int train(int &level);
void train(int amount);
bool isRusting(const calendar& turn) const;
bool rust(const calendar& turn, bool forgetful, bool charged_bio_mem);
void practice(const calendar& turn);

int readBook(int minimumGain, int maximumGain, const calendar& turn, int maximumLevel = 0xFFFFFFFF);
void readBook(int minimumGain, int maximumGain, const calendar& turn, int maximumLevel = 0xFFFFFFFF);

bool operator==(const SkillLevel& b) const { return this->_level == b._level && this->_exercise == b._exercise; }
bool operator< (const SkillLevel& b) const { return this->_level < b._level || (this->_level == b._level && this->_exercise < b._exercise); }