summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-20 23:01:53 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-20 23:01:53 +0000
commitd9e7e6a02141f3c9a99aa96a2c818d4c8fbb3786 (patch)
treec028a21c3b2657c52514e0eb692725fbb1a77e73 /crawl-ref
parent655e25c2693b8e02b37ee650e0fd74a8baf4d837 (diff)
downloadcrawl-ref-d9e7e6a02141f3c9a99aa96a2c818d4c8fbb3786.tar.gz
crawl-ref-d9e7e6a02141f3c9a99aa96a2c818d4c8fbb3786.zip
And clean up the previous attempt.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4423 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/spells1.cc22
-rw-r--r--crawl-ref/source/spells1.h2
2 files changed, 13 insertions, 11 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index e22ab07b41..1d6cdc4682 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -757,21 +757,23 @@ int cast_healing( int pow, int target_x, int target_y )
return (_healing_spell( pow + roll_dice( 2, pow ) - 2, target_x, target_y ));
}
-void cast_revitalisation(int pow)
+bool cast_revitalisation(int pow)
{
if (you.hp == you.hp_max || you.magic_points == you.max_magic_points)
- canned_msg(MSG_NOTHING_HAPPENS);
- else
{
- // Currently, this uses the same formula as minor healing.
- int amount = pow + roll_dice(2, pow) - 2;
+ canned_msg(MSG_NOTHING_HAPPENS);
+ return false;
+ }
- // Increase MP by half of amount.
- inc_mp(amount / 2, false);
+ // Use the formula for minor healing for HP, and the formula divided
+ // by two for MP.
+ int hp_amount = pow + roll_dice(2, pow) - 2;
+ int mp_amount = (pow + roll_dice(2, pow) - 2) / 2;
- // Increase HP by amount.
- inc_hp(amount, false);
- }
+ inc_hp(hp_amount, false);
+ inc_mp(mp_amount, false);
+
+ return true;
}
bool cast_revivification(int pow)
diff --git a/crawl-ref/source/spells1.h b/crawl-ref/source/spells1.h
index a75b578458..bc42e311e3 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);
-void cast_revitalisation(int pow);
+bool cast_revitalisation(int pow);
// last updated 24may2000 {dlb}
/* ***********************************************************************