From 5d66ced3af630a94100a50f71224f6c7d1b2ef83 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 15 Dec 2009 17:33:52 -0600 Subject: Revert "Remove hard skill pool cutoff." This reverts commit c652cbec1739a628f87aedc4874c782429f8d7ce. This really needs more discussion; the current implementation isn't reallly reasonable --- crawl-ref/source/command.cc | 2 +- crawl-ref/source/decks.cc | 8 +++----- crawl-ref/source/defines.h | 2 ++ crawl-ref/source/main.cc | 2 +- crawl-ref/source/output.cc | 5 ++--- crawl-ref/source/player.cc | 30 ++++++++---------------------- crawl-ref/source/player.h | 5 +---- 7 files changed, 18 insertions(+), 36 deletions(-) diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 272d34e6dc..521df47d13 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -2424,7 +2424,7 @@ int list_wizard_commands(bool do_redraw_screen) "A : set all skills to level\n" "g : exercise a skill\n" "r : change character's species\n" - "s : fill experience pool\n" + "s : gain 20000 skill points\n" "S : set skill to level\n" "x : gain an experience level\n" "Ctrl-L : change experience level\n" diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index bf52b877a7..360bf4652e 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -2082,11 +2082,9 @@ static void _experience_card(int power, deck_rarity_type rarity) mpr("You feel knowledgeable."); // Put some free XP into pool; power_level 2 means fill pool - if (power_level >= 2) - you.exp_available = you.exp_pool_cutoff(); - else - you.exp_available += power * 50; - you.step_down_exp_pool(); + you.exp_available += power * 50; + if (power_level >= 2 || you.exp_available > FULL_EXP_POOL) + you.exp_available = FULL_EXP_POOL; level_change(); } diff --git a/crawl-ref/source/defines.h b/crawl-ref/source/defines.h index 20809e552d..327d69af32 100644 --- a/crawl-ref/source/defines.h +++ b/crawl-ref/source/defines.h @@ -142,6 +142,8 @@ const int DEBUG_COOKIE = 32767; const int MAX_SKILL_LEVEL = 27; const unsigned int MAX_EXP_TOTAL = 8999999; +const unsigned int MAX_EXP_POOL = 20000; +const unsigned int FULL_EXP_POOL = MAX_EXP_POOL; const int MIN_HIT_MISS_PERCENTAGE = 5; diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc index d84d27aac4..86b5813784 100644 --- a/crawl-ref/source/main.cc +++ b/crawl-ref/source/main.cc @@ -553,7 +553,7 @@ static void _do_wizard_command(int wiz_command, bool silent_fail) break; case 's': - you.exp_available = you.exp_pool_cutoff(); + you.exp_available = FULL_EXP_POOL; you.redraw_experience = true; break; diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 6513cc0b17..ccad9bd3d9 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -848,10 +848,9 @@ static bool _need_stats_printed() static short _get_exp_pool_colour(int pool) { - int cutoff = you.exp_pool_cutoff(); - if (pool < cutoff*3/4) + if (pool < MAX_EXP_POOL/2) return (HUD_VALUE_COLOUR); - else if (pool < cutoff) + else if (pool < MAX_EXP_POOL*3/4) return (YELLOW); else return (RED); diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 7975d102f0..b74219279a 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2494,21 +2494,6 @@ void forget_map(unsigned char chance_forgotten, bool force) #endif } -int player::exp_pool_cutoff() const -{ - int total = std::max(total_skill_points, skill_cost_needed(2)); - // total = std::min(total, skill_cost_needed(27)); - return (total / 3); -} - -void player::step_down_exp_pool() -{ - int cutoff = you.exp_pool_cutoff(); - int step = cutoff/4; - you.exp_available = stepdown_value(you.exp_available, - cutoff, step, 3*step, 4*step); -} - void gain_exp( unsigned int exp_gained, unsigned int* actual_gain, unsigned int* actual_avail_gain) { @@ -2521,6 +2506,10 @@ void gain_exp( unsigned int exp_gained, unsigned int* actual_gain, 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 ); +#endif + if (you.experience + exp_gained > MAX_EXP_TOTAL) you.experience = MAX_EXP_TOTAL; else @@ -2536,13 +2525,10 @@ void gain_exp( unsigned int exp_gained, unsigned int* actual_gain, exp_gained /= 2; } - you.exp_available += exp_gained; - you.step_down_exp_pool(); - -#if DEBUG_DIAGNOSTICS - mprf(MSGCH_DIAGNOSTICS, "gain_exp: %d of %d", - you.exp_available - old_avail, exp_gained); -#endif + if (you.exp_available + exp_gained > MAX_EXP_POOL) + you.exp_available = MAX_EXP_POOL; + else + you.exp_available += exp_gained; level_change(); diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 8c57eee2d7..aebace1a3e 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -537,10 +537,7 @@ public: void set_duration(duration_type dur, int turns, int cap = 0, const char *msg = NULL); - // How large can the experience pool grow without loss? - int exp_pool_cutoff() const; - // Step down experience above cutoff. - void step_down_exp_pool(); + protected: void _removed_beholder(); -- cgit v1.2.3-54-g00ecf