summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/skills2.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-08 16:36:57 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-08 16:36:57 +0000
commit459e277ada7ab661190d4a3497a374d76e30c5a4 (patch)
tree76831767628f80206b9116ff4ee7708dc5b745b5 /crawl-ref/source/skills2.cc
parentb5d57494a0e21209f23208562f960dd8f1cebebe (diff)
downloadcrawl-ref-459e277ada7ab661190d4a3497a374d76e30c5a4.tar.gz
crawl-ref-459e277ada7ab661190d4a3497a374d76e30c5a4.zip
Redo potions of magic again. They are now effectively potions of heal wounds
for MP; there is never any max-MP gain. Classes no longer influence max MP. Instead, you get an extra MP point for each level of Spellcasting between 1 and 5. (This might be too good.) Invocations does not get this boost. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8981 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/skills2.cc')
-rw-r--r--crawl-ref/source/skills2.cc23
1 files changed, 9 insertions, 14 deletions
diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc
index e33b7643e5..300b190b84 100644
--- a/crawl-ref/source/skills2.cc
+++ b/crawl-ref/source/skills2.cc
@@ -2152,28 +2152,23 @@ void init_skill_order( void )
int calc_hp(bool real_hp)
{
int hitp = get_real_hp(!real_hp, false);
-
you.hp_max = hitp;
-
- deflate_hp( you.hp_max, false );
-
+ deflate_hp(you.hp_max, false);
return (hitp);
-} // end calc_hp()
+}
int calc_mp(bool real_mp)
{
- int enp;
+ // base_magic_points2 accounts for species
+ int enp = (you.base_magic_points2 - 5000);
- // base_magic_points2 accounts for species and magic potions
- enp = (you.base_magic_points2 - 5000);
+ // You get 1 bonus MP for each of the first five levels of Spellcasting.
+ int spell_extra = (you.experience_level * you.skills[SK_SPELLCASTING]) / 4
+ + std::min<int>(you.skills[SK_SPELLCASTING], 5);
- int spell_extra = (you.experience_level * you.skills[SK_SPELLCASTING]) / 4;
int invoc_extra = (you.experience_level * you.skills[SK_INVOCATIONS]) / 6;
- if (spell_extra > invoc_extra)
- enp += spell_extra;
- else
- enp += invoc_extra;
+ enp += std::max(spell_extra, invoc_extra);
you.max_magic_points = stepdown_value( enp, 9, 18, 45, 100 );
@@ -2207,7 +2202,7 @@ int calc_mp(bool real_mp)
you.redraw_magic_points = true;
return (you.max_magic_points);
-} // end calc_mp()
+}
unsigned int skill_exp_needed(int lev)
{