From f486e708cafabf78bafe1c9f9098e44634666cc0 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 28 Apr 2008 11:46:38 +0000 Subject: 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 --- crawl-ref/source/spells1.cc | 85 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/spells1.cc') 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 -- cgit v1.2.3-54-g00ecf