diff options
author | Neil Moore <neil@s-z.org> | 2012-08-03 20:49:16 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2012-08-03 20:54:33 -0400 |
commit | 383b96f35e5d3cbe8b208cc13dac2ee163635f19 (patch) | |
tree | 29439bce5a2ffc4ce2ea5a5166f3c94c3a70806d /crawl-ref/source/skills.cc | |
parent | daa519b60d1c3d341dfece4ea78e2cebeadb6359 (diff) | |
download | crawl-ref-383b96f35e5d3cbe8b208cc13dac2ee163635f19.tar.gz crawl-ref-383b96f35e5d3cbe8b208cc13dac2ee163635f19.zip |
Don't force Troglodytes to train magic skills.
Also, remove a few special cases that considered Spellcasting to be
non-magic below level one for Troglodytes; this hasn't been necessary
since scrolls stopped training Spellcasting in ee84c39.
This reverts commit 1d240c20e937d950ff3de459d85665fcc06969ff.
Diffstat (limited to 'crawl-ref/source/skills.cc')
-rw-r--r-- | crawl-ref/source/skills.cc | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/crawl-ref/source/skills.cc b/crawl-ref/source/skills.cc index 45a27c867c..3d7ae1e122 100644 --- a/crawl-ref/source/skills.cc +++ b/crawl-ref/source/skills.cc @@ -585,8 +585,11 @@ bool check_selected_skills() skill_type sk = static_cast<skill_type>(i); if (skill_trained(sk)) return false; - if (is_useless_skill(sk) || you.skill_points[sk] >= skill_exp_needed(27, sk)) + if (is_useless_skill(sk) || is_harmful_skill(sk) + || you.skill_points[sk] >= skill_exp_needed(27, sk)) + { continue; + } if (!you.can_train[sk]) { could_train = true; @@ -708,11 +711,8 @@ void exercise(skill_type exsk, int deg) // We look at skill points because actual level up comes later. static bool _level_up_check(skill_type sk, bool simu) { - // Don't overtrain spellcasting past level 1 with Trog and - // don't train past level 27. - if (sk == SK_SPELLCASTING && !you.skills[sk] && you.religion == GOD_TROG - && you.skill_points[sk] >= skill_exp_needed(1, sk) - || you.skill_points[sk] >= skill_exp_needed(27, sk)) + // Don't train past level 27. + if (you.skill_points[sk] >= skill_exp_needed(27, sk)) { you.training[sk] = 0; if (!simu) @@ -723,12 +723,8 @@ static bool _level_up_check(skill_type sk, bool simu) return false; } -static bool _is_magic_skill(skill_type sk) +bool is_magic_skill(skill_type sk) { - // Learning spellcasting with scrolls doesn't count for Trog. - if (you.religion == GOD_TROG && sk == SK_SPELLCASTING && !you.skills[sk]) - return false; - return (sk > SK_LAST_MUNDANE && sk <= SK_LAST_MAGIC); } @@ -816,7 +812,7 @@ static void _train_skills(int exp, const int cost, const bool simu) sk_exp[sk] = 0; } - if (gain && _is_magic_skill(sk)) + if (gain && is_magic_skill(sk)) magic_gain += gain; #ifdef DEBUG_DIAGNOSTICS @@ -848,7 +844,7 @@ static void _train_skills(int exp, const int cost, const bool simu) _level_up_check(sk, simu); - if (gain && _is_magic_skill(sk)) + if (gain && is_magic_skill(sk)) magic_gain += gain; #ifdef DEBUG_DIAGNOSTICS |