diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-24 23:06:34 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-24 23:06:34 +0000 |
commit | 58fe4b772fe6eeccf5cb761962dbf72dcd9b9cb5 (patch) | |
tree | 0a48705e7e43c0e09e64088bbc8bf249e18423ba /crawl-ref/source/spells1.cc | |
parent | 86878386c072b70e0e54c7176cdfae250564ddae (diff) | |
download | crawl-ref-58fe4b772fe6eeccf5cb761962dbf72dcd9b9cb5.tar.gz crawl-ref-58fe4b772fe6eeccf5cb761962dbf72dcd9b9cb5.zip |
Take the first step toward improving Zin's Revitalisation: HP and MP are
now restored in greater amounts at high Invocation levels.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4599 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r-- | crawl-ref/source/spells1.cc | 58 |
1 files changed, 46 insertions, 12 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 95de265140..731c123976 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -759,23 +759,57 @@ int cast_healing( int pow, int target_x, int target_y ) return (_healing_spell( pow + roll_dice( 2, pow ) - 2, target_x, target_y )); } -bool cast_revitalisation(int pow) +int cast_revitalisation(int pow) { - if (you.hp == you.hp_max || you.magic_points == you.max_magic_points) + const int max_steps = std::max(6, pow); + int steps = 0; + + switch (random2(3)) { - canned_msg(MSG_NOTHING_HAPPENS); - return false; - } + case 0: + // Restore HP. + if (you.hp < you.hp_max) + { + for (int hp_amt = 3; + steps < max_steps && you.hp < you.hp_max; + ++steps, hp_amt *= 2) + { + inc_hp(hp_amt, false); + } + + break; + } + // Deliberate fall through. + + case 1: + // Restore MP. + if (you.magic_points < you.max_magic_points) + { + for (int mp_amt = 1; + steps < max_steps && you.magic_points < you.max_magic_points; + ++steps, mp_amt *= 2) + { + inc_mp(mp_amt, false); + } + + break; + } + // Deliberate fall through. - // Use the formula for minor healing for HP, and the formula divided - // roughly in half for MP. - int hp_amount = pow + roll_dice(2, pow) - 2; - int mp_amount = (pow + roll_dice(2, pow) - 2) / 2 + 1; + default: + // Do nothing. + break; + } - inc_hp(hp_amount, false); - inc_mp(mp_amount, false); + if (steps > 0) + { + mpr("You feel renewed."); + lose_piety(steps * 2 / 3); + } + else + canned_msg(MSG_NOTHING_HAPPENS); - return true; + return steps; } bool cast_revivification(int pow) |