summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ability.cc
diff options
context:
space:
mode:
authorNate Rook <nrook@google.com>2014-06-26 18:16:14 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-06-26 22:25:41 -0700
commitd3f10a37eb7f516df50285b678b554b11db416ec (patch)
tree664b77a6fa45871ac4031425466362cc29e791c9 /crawl-ref/source/ability.cc
parent7553af35b78e7b7f69c24c2d61c6009fbaa4f035 (diff)
downloadcrawl-ref-d3f10a37eb7f516df50285b678b554b11db416ec.tar.gz
crawl-ref-d3f10a37eb7f516df50285b678b554b11db416ec.zip
Have Imprison fail only after aborted.
This also serves as a proof-of-concept for applying the same change to other abilities.
Diffstat (limited to 'crawl-ref/source/ability.cc')
-rw-r--r--crawl-ref/source/ability.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/crawl-ref/source/ability.cc b/crawl-ref/source/ability.cc
index 646ea112f8..41da1acd33 100644
--- a/crawl-ref/source/ability.cc
+++ b/crawl-ref/source/ability.cc
@@ -1900,9 +1900,18 @@ static bool _sticky_flame_can_hit(const actor *act)
return false;
}
+/*
+ * Use an ability.
+ *
+ * @param abil The actual ability used.
+ * @param fail If true, the ability is doomed to fail, and either SPRET_FAIL or
+ * SPRET_ABORT will be returned. Otherwise, the ability will always
+ * succeed.
+ * @returns Whether the spell succeeded (SPRET_SUCCESS), failed (SPRET_FAIL),
+ * or was canceled (SPRET_ABORT). Never returns SPRET_NONE.
+ */
static spret_type _do_ability(const ability_def& abil, bool fail)
{
-
int power;
dist abild;
bolt beam;
@@ -2458,7 +2467,6 @@ static spret_type _do_ability(const ability_def& abil, bool fail)
case ABIL_ZIN_IMPRISON:
{
- fail_check();
beam.range = LOS_RADIUS;
if (!spell_direction(spd, beam, DIR_TARGET, TARG_HOSTILE, 0, false))
return SPRET_ABORT;
@@ -2489,6 +2497,8 @@ static spret_type _do_ability(const ability_def& abil, bool fail)
return SPRET_ABORT;
}
+ fail_check();
+
zin_recite_interrupt();
power = 3 + (roll_dice(5, you.skill(SK_INVOCATIONS, 5) + 12) / 26);