summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells1.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-06 14:30:07 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-06 14:30:07 +0000
commite70ec2e2e524543db19280a45100cdb40c8b4a78 (patch)
tree67526a5a421d0f67b5614c0685765da7f0bc19b9 /crawl-ref/source/spells1.cc
parenta0b554fad45a8d736a8365e916e2d3982322262f (diff)
downloadcrawl-ref-e70ec2e2e524543db19280a45100cdb40c8b4a78.tar.gz
crawl-ref-e70ec2e2e524543db19280a45100cdb40c8b4a78.zip
Add the first steps toward a stat restoration/temporary boosting effect
for Zin's Revitalisation. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4885 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r--crawl-ref/source/spells1.cc52
1 files changed, 49 insertions, 3 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index dc8c8624dc..c700c58356 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -44,6 +44,7 @@
#include "randart.h"
#include "religion.h"
#include "skills2.h"
+#include "spells2.h"
#include "spells3.h"
#include "spells4.h"
#include "spl-util.h"
@@ -771,7 +772,7 @@ int cast_revitalisation(int pow)
if (step == 0)
{
step_max = std::min(pow, 6);
- type = random2(4);
+ type = random2(6);
hp_amt = 3;
mp_amt = 1;
}
@@ -895,6 +896,50 @@ int cast_revitalisation(int pow)
type = 3;
// Deliberate fall through, resetting the step counter.
+ case 3:
+ // Restore and/or temporarily boost stats.
+ switch (step)
+ {
+ case 0:
+ if (you.strength < you.max_strength || you.intel < you.max_intel
+ || you.dex < you.max_dex)
+ {
+ success = true;
+ restore_stat(STAT_STRENGTH, 1, true);
+ restore_stat(STAT_INTELLIGENCE, 1, true);
+ restore_stat(STAT_DEXTERITY, 1, true);
+ break;
+ }
+
+ step = 1;
+ // Deliberate fall through.
+
+ case 1:
+ if (you.strength < you.max_strength || you.intel < you.max_intel
+ || you.dex < you.max_dex)
+ {
+ success = true;
+ restore_stat(STAT_STRENGTH, 0, true);
+ restore_stat(STAT_INTELLIGENCE, 0, true);
+ restore_stat(STAT_DEXTERITY, 0, true);
+ break;
+ }
+
+ step = 2;
+ // Deliberate fall through.
+
+ // XXX: Temporary stat boosting is not implemented yet.
+ default:
+ break;
+ }
+
+ if (success)
+ break;
+
+ step = 0;
+ type = 4;
+ // Deliberate fall through, resetting the step counter.
+
default:
// Do nothing.
break;
@@ -917,8 +962,9 @@ int cast_revitalisation(int pow)
(step == 4) ? "appropriately"
: "impressively",
(type == 0) ? "better" :
- (type == 1) ? "invigorated"
- : "powerful");
+ (type == 1) ? "invigorated" :
+ (type == 2) ? "powerful"
+ : "renewed");
// The more the step counter has advanced, the greater the piety
// cost is.