From bdcd305d09236d064dfd0dd695dd4f4a0f205030 Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 30 Nov 2007 11:04:07 +0000 Subject: 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 --- crawl-ref/source/player.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/player.cc') 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." ); -- cgit v1.2.3-54-g00ecf