summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-24 23:06:34 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-24 23:06:34 +0000
commit58fe4b772fe6eeccf5cb761962dbf72dcd9b9cb5 (patch)
tree0a48705e7e43c0e09e64088bbc8bf249e18423ba /crawl-ref/source
parent86878386c072b70e0e54c7176cdfae250564ddae (diff)
downloadcrawl-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')
-rw-r--r--crawl-ref/source/abl-show.cc7
-rw-r--r--crawl-ref/source/spells1.cc58
-rw-r--r--crawl-ref/source/spells1.h2
3 files changed, 52 insertions, 15 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 86798be6ec..241fbe50fa 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -1368,9 +1368,12 @@ static bool _do_ability(const ability_def& abil)
break;
}
case ABIL_ZIN_REVITALISATION:
- if (cast_revitalisation( 3 + (you.skills[SK_INVOCATIONS] / 6) ))
- exercise(SK_INVOCATIONS, 1 + random2(3));
+ {
+ int result = cast_revitalisation(1 + (you.skills[SK_INVOCATIONS] / 4));
+ if (result > 0)
+ exercise(SK_INVOCATIONS, 1 + random2(result));
break;
+ }
case ABIL_ZIN_SANCTUARY:
if (cast_sanctuary(you.skills[SK_INVOCATIONS] * 4))
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)
diff --git a/crawl-ref/source/spells1.h b/crawl-ref/source/spells1.h
index bc42e311e3..5f3d742f80 100644
--- a/crawl-ref/source/spells1.h
+++ b/crawl-ref/source/spells1.h
@@ -54,7 +54,7 @@ char cast_lesser_healing(void);
* called from: ability - spell
* *********************************************************************** */
int cast_healing(int pow, int target_x = -1, int target_y = -1);
-bool cast_revitalisation(int pow);
+int cast_revitalisation(int pow);
// last updated 24may2000 {dlb}
/* ***********************************************************************