summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-selfench.cc
diff options
context:
space:
mode:
authorChris Campbell <chriscampbell89@gmail.com>2014-02-17 00:11:09 +0000
committerChris Campbell <chriscampbell89@gmail.com>2014-02-17 00:18:02 +0000
commit70fb87eca4a9a4f21856ca8cecc1140b558812e6 (patch)
tree91ab2bb615aaa68b6daf688ed6894776d40d2561 /crawl-ref/source/spl-selfench.cc
parentf53cafb8e01dc16aee8096cc8b136c14fc026108 (diff)
downloadcrawl-ref-70fb87eca4a9a4f21856ca8cecc1140b558812e6.tar.gz
crawl-ref-70fb87eca4a9a4f21856ca8cecc1140b558812e6.zip
Don't allow both repel and deflect missiles to be active at once
DMsl replaces RMsl, RMsl can't be cast if DMsl is active.
Diffstat (limited to 'crawl-ref/source/spl-selfench.cc')
-rw-r--r--crawl-ref/source/spl-selfench.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/crawl-ref/source/spl-selfench.cc b/crawl-ref/source/spl-selfench.cc
index 5582d5a985..7cb0a34a3d 100644
--- a/crawl-ref/source/spl-selfench.cc
+++ b/crawl-ref/source/spl-selfench.cc
@@ -111,9 +111,10 @@ spret_type ice_armour(int pow, bool fail)
spret_type missile_prot(int pow, bool fail)
{
- if (you.attribute[ATTR_REPEL_MISSILES])
+ if (you.attribute[ATTR_REPEL_MISSILES]
+ || you.attribute[ATTR_DEFLECT_MISSILES])
{
- mpr("You are already repelling missiles.");
+ mpr("You are already protected from missiles.");
return SPRET_ABORT;
}
fail_check();
@@ -132,6 +133,10 @@ spret_type deflection(int pow, bool fail)
fail_check();
you.attribute[ATTR_DEFLECT_MISSILES] = 1;
mpr("You feel very safe from missiles.");
+ // Replace RMsl, if active.
+ if (you.attribute[ATTR_REPEL_MISSILES])
+ you.attribute[ATTR_REPEL_MISSILES] = 0;
+
return SPRET_SUCCESS;
}