summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-22 18:43:00 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-22 20:36:05 +0100
commitc652cbec1739a628f87aedc4874c782429f8d7ce (patch)
tree181fa692ff6cd5e22bc2f49faa44f8a07c7ed027 /crawl-ref/source/player.cc
parent1b497b95a98e15058beba1a4304f7dfd9832930b (diff)
downloadcrawl-ref-c652cbec1739a628f87aedc4874c782429f8d7ce.tar.gz
crawl-ref-c652cbec1739a628f87aedc4874c782429f8d7ce.zip
Remove hard skill pool cutoff.
There's now a soft cutoff at player::exp_pool_cutoff() that scales with you.total_skill_points. Above that, you.exp_available is stepped down. It currently starts at ~800 skill points for a new character. A human melee fighter (weapon skill 27, fighting 15, traps 8, armour 15, invo 12) gets around 18000 points (skill level 21). The cutoff is not currently limited. Side-effects are a nerf to the experience card -- it could easily be changed to still give the usual 20000 points.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc30
1 files changed, 22 insertions, 8 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index cc00765afe..fcc151096f 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2465,6 +2465,21 @@ 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)
{
@@ -2477,10 +2492,6 @@ 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
@@ -2496,10 +2507,13 @@ void gain_exp( unsigned int exp_gained, unsigned int* actual_gain,
exp_gained /= 2;
}
- if (you.exp_available + exp_gained > MAX_EXP_POOL)
- you.exp_available = MAX_EXP_POOL;
- else
- you.exp_available += exp_gained;
+ 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
level_change();