summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells1.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-20 20:31:38 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-20 20:31:38 +0000
commit8cd4205a9eb0ac8a7f8d05bf92689e08f739ac41 (patch)
tree3aa6a09ebac793b966253befc46f691c03beeb7b /crawl-ref/source/spells1.cc
parenteb8a71bbce2177bf1cc36e3b31fb35de48507ea4 (diff)
downloadcrawl-ref-8cd4205a9eb0ac8a7f8d05bf92689e08f739ac41.tar.gz
crawl-ref-8cd4205a9eb0ac8a7f8d05bf92689e08f739ac41.zip
Simplify.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5158 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r--crawl-ref/source/spells1.cc41
1 files changed, 23 insertions, 18 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index e723fdf773..c1a9cebdba 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -966,32 +966,35 @@ int cast_vitalisation(int pow)
// indicator and the step counter.
case 3:
- // Add divine stamina and divine robustness.
+ {
stamina_robustness:
+ int estep = step / 2;
+
+ // Add divine stamina and divine robustness.
switch (step)
{
// Divine stamina.
case 0:
case 2:
case 4:
- if ((step == 0 || you.duration[DUR_VITALISATION_CHAIN] > 0)
- && ((you.attribute[ATTR_DIVINE_STAMINA] + 1) / 2) == (step / 2)
- && (player_mutation_level(MUT_STRONG) / 5) < (3 - step / 2)
- && (player_mutation_level(MUT_CLEVER) / 5) < (3 - step / 2)
- && (player_mutation_level(MUT_AGILE) / 5) < (3 - step / 2))
+ if ((estep == 0 || you.duration[DUR_VITALISATION_CHAIN] > 0)
+ && ((you.attribute[ATTR_DIVINE_STAMINA] + 1) / 2) == estep
+ && (player_mutation_level(MUT_STRONG) / 5) < (3 - estep)
+ && (player_mutation_level(MUT_CLEVER) / 5) < (3 - estep)
+ && (player_mutation_level(MUT_AGILE) / 5) < (3 - estep))
{
success = true;
mprf(MSGCH_DURATION, "Zin %s divine stamina.",
- (step == 0) ? "grants you" :
- (step == 2) ? "strengthens your"
- : "maximises your");
+ (estep == 0) ? "grants you" :
+ (estep == 1) ? "strengthens your"
+ : "maximises your");
const int stamina_amt = step + 1;
you.attribute[ATTR_DIVINE_STAMINA] += stamina_amt;
you.duration[DUR_DIVINE_STAMINA] +=
- (step == 0) ? (you.skills[SK_INVOCATIONS] * 2) :
- (step == 2) ? (you.skills[SK_INVOCATIONS])
- : (you.skills[SK_INVOCATIONS] / 2);
+ (estep == 0) ? (you.skills[SK_INVOCATIONS] * 2) :
+ (estep == 1) ? (you.skills[SK_INVOCATIONS])
+ : (you.skills[SK_INVOCATIONS] / 2);
modify_stat(STAT_STRENGTH, stamina_amt, true, "");
modify_stat(STAT_INTELLIGENCE, stamina_amt, true, "");
@@ -1001,21 +1004,22 @@ stamina_robustness:
}
step++;
+ goto stamina_robustness;
// Deliberate fall through.
// Divine robustness.
case 1:
case 3:
case 5:
- if ((step == 1 || you.duration[DUR_VITALISATION_CHAIN] > 0)
- && you.attribute[ATTR_DIVINE_ROBUSTNESS] == (step / 2)
- && player_mutation_level(MUT_ROBUST) < (3 - step / 2))
+ if ((estep == 0 || you.duration[DUR_VITALISATION_CHAIN] > 0)
+ && you.attribute[ATTR_DIVINE_ROBUSTNESS] == estep
+ && player_mutation_level(MUT_ROBUST) < (3 - estep))
{
success = true;
mprf(MSGCH_DURATION, "Zin %s divine robustness.",
- (step == 1) ? "grants you" :
- (step == 3) ? "strengthens your"
- : "maximises your");
+ (estep == 0) ? "grants you" :
+ (estep == 1) ? "strengthens your"
+ : "maximises your");
you.attribute[ATTR_DIVINE_ROBUSTNESS]++;
you.duration[DUR_DIVINE_ROBUSTNESS] +=
@@ -1046,6 +1050,7 @@ stamina_robustness:
type = 4;
// Deliberate fall through, resetting the vitalisation chaining
// indicator and the step counter.
+ }
default:
// Do nothing.