diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-22 10:55:09 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-22 10:55:09 +0000 |
commit | 5484cadcd60be6575f09b890d0b2044faef4e05c (patch) | |
tree | 43376dc5344fea04117488c28d43b0a0a0858ba3 /crawl-ref/source/traps.cc | |
parent | d473edf767361c19d6938c48ebd518f7d68824c1 (diff) | |
download | crawl-ref-5484cadcd60be6575f09b890d0b2044faef4e05c.tar.gz crawl-ref-5484cadcd60be6575f09b890d0b2044faef4e05c.zip |
Inform user on why a known shaft trap isn't triggered (fixes bug 2294949).
Be more agressive about making shaft traps on invalid levels disappear in
a puff of logic.
If a wizard command creates a trap shaft on an invalid level, inform the
user.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7536 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/traps.cc')
-rw-r--r-- | crawl-ref/source/traps.cc | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index d361f04695..796b3f61f7 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -607,9 +607,33 @@ void trap_def::trigger(actor& triggerer, bool flat_footed) break; case TRAP_SHAFT: + // Paranoia + if (!is_valid_shaft_level()) + { + if (you_know && in_sight) + mpr("The shaft disappears in a puff of logic!"); + + trap_destroyed = true; + break; + } + // Known shafts don't trigger as traps. if (trig_knows) + { + if (you_trigger) + { + if (triggerer.airborne()) + { + if (you.flight_mode() == FL_LEVITATE) + mpr("You float over the shaft."); + else + mpr("You fly over the shaft."); + } + else + mpr("You carefully avoid triggering the shaft."); + } break; + } if (!triggerer.will_trigger_shaft()) { @@ -629,17 +653,8 @@ void trap_def::trigger(actor& triggerer, bool flat_footed) } } - // Paranoia - if (!is_valid_shaft_level()) - { - if (you_know && in_sight) - mpr("The shaft disappears in a puff of logic!"); - - trap_destroyed = true; - } - else + // Fire away! { - // Fire away! const bool revealed = triggerer.do_shaft(); if (!revealed && !you_know) this->hide(); |