diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-28 11:46:38 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-28 11:46:38 +0000 |
commit | f486e708cafabf78bafe1c9f9098e44634666cc0 (patch) | |
tree | d4f3b0f69d9aa8268ced3f3fb5ad9bbb1f57c55d /crawl-ref/source/spells1.cc | |
parent | 0be145f708e49524707f5f046082b55b1d73de6e (diff) | |
download | crawl-ref-f486e708cafabf78bafe1c9f9098e44634666cc0.tar.gz crawl-ref-f486e708cafabf78bafe1c9f9098e44634666cc0.zip |
Expand Zin's Revitalisation to allow for negative affliction removal,
and make sure the step counter is reset properly when falling through.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4732 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r-- | crawl-ref/source/spells1.cc | 85 |
1 files changed, 81 insertions, 4 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 8fff179fb7..c387688501 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -771,7 +771,7 @@ int cast_revitalisation(int pow) if (step == 0) { step_max = std::min(pow, 6); - type = random2(3); + type = random2(4); hp_amt = 3; mp_amt = 1; } @@ -781,6 +781,81 @@ int cast_revitalisation(int pow) switch (type) { case 0: + // Remove negative afflictions. + switch (step) + { + // Remove confusion. + case 0: + if (you.duration[DUR_CONF]) + { + success = true; + you.duration[DUR_CONF] = 0; + break; + } + + step = 1; + // Deliberate fall through. + + // Remove poisoning. + case 1: + if (you.duration[DUR_POISONING]) + { + success = true; + you.duration[DUR_POISONING] = 0; + break; + } + + step = 2; + // Deliberate fall through. + + // Remove sickness. + case 2: + if (you.disease) + { + success = true; + you.disease = 0; + break; + } + + step = 3; + // Deliberate fall through. + + // Remove rotting. + case 3: + if (you.rotting) + { + success = true; + you.rotting = 0; + break; + } + + step = 4; + // Deliberate fall through. + + // Restore rotted HP. + case 4: + case 5: + if (player_rotted()) + { + success = true; + unrot_hp(1 + random2(3)); + break; + } + + step++; + // Deliberate fall through. + + default: + break; + } + + if (success) + break; + + type = 1; + // Deliberate fall through. + + case 1: // Restore HP. if (you.hp < you.hp_max) { @@ -792,7 +867,8 @@ int cast_revitalisation(int pow) type = 1; // Deliberate fall through. - case 1: + + case 2: // Restore MP. if (you.magic_points < you.max_magic_points) { @@ -804,9 +880,9 @@ int cast_revitalisation(int pow) type = 2; // Deliberate fall through. + default: // Do nothing. - success = false; break; } @@ -826,7 +902,8 @@ int cast_revitalisation(int pow) (step == 3) ? "somewhat" : (step == 4) ? "appropriately" : "impressively", - (type == 0) ? "invigorated" + (type == 0) ? "better" : + (type == 1) ? "invigorated" : "powerful"); // The more the step counter has advanced, the greater the piety |