summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-30 11:04:07 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-30 11:04:07 +0000
commitbdcd305d09236d064dfd0dd695dd4f4a0f205030 (patch)
tree86ff506b5b47f1e6560f6686d130c06338c50554 /crawl-ref/source/player.cc
parentf6a1d5082c4ae9853ded65581030b86f5c7991fb (diff)
downloadcrawl-ref-bdcd305d09236d064dfd0dd695dd4f4a0f205030.tar.gz
crawl-ref-bdcd305d09236d064dfd0dd695dd4f4a0f205030.zip
Added Sage card, which boosts skill training.
[Side note: rm saves/ * is a bad idea.] git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2945 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 358b2ebee9..f38d9cc6a5 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2656,8 +2656,8 @@ void gain_exp( unsigned int exp_gained, unsigned int* actual_gain,
if (player_equip_ego_type( EQ_BODY_ARMOUR, SPARM_ARCHMAGI ))
exp_gained = div_rand_round( exp_gained, 4 );
- unsigned long old_exp = you.experience;
- int old_avail = you.exp_available;
+ const unsigned long old_exp = you.experience;
+ const int old_avail = you.exp_available;
#if DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "gain_exp: %d", exp_gained );
@@ -2668,12 +2668,23 @@ void gain_exp( unsigned int exp_gained, unsigned int* actual_gain,
else
you.experience += exp_gained;
+ if (you.duration[DUR_SAGE])
+ {
+ // Bonus skill training from Sage.
+ you.exp_available =
+ (exp_gained * you.sage_bonus_degree) / 100 + exp_gained / 2;
+ exercise(you.sage_bonus_skill, 20);
+ you.exp_available = old_avail;
+ exp_gained /= 2;
+ }
+
if (you.exp_available + exp_gained > 20000)
you.exp_available = 20000;
else
you.exp_available += exp_gained;
level_change();
+
// increase tutorial time-out now that it's actually
// become useful for a longer time
if (Options.tutorial_left && you.experience_level == 7)
@@ -3482,6 +3493,9 @@ void display_char_status()
else if (you.burden_state == BS_OVERLOADED)
mpr("You are overloaded with stuff.");
+ if (you.duration[DUR_SAGE])
+ mprf("You are studying %s.", skill_name(you.sage_bonus_skill));
+
if (you.duration[DUR_BREATH_WEAPON])
mpr( "You are short of breath." );