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 | |
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')
-rw-r--r-- | crawl-ref/source/debug.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/misc.cc | 12 | ||||
-rw-r--r-- | crawl-ref/source/traps.cc | 35 |
3 files changed, 38 insertions, 12 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index b17e02d521..4987cd4f97 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -3582,6 +3582,9 @@ void debug_make_trap() place_specific_trap(you.pos(), trap); mprf("Created a %s trap, marked it undiscovered", trap_name(trap)); + + if (trap == TRAP_SHAFT && !is_valid_shaft_level()) + mpr("NOTE: Shaft traps aren't valid on this level."); } void debug_make_shop() diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 74e8d2e821..c5cbf044fc 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1803,7 +1803,9 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, if (!is_valid_shaft_level()) { if (known_trap) - mpr("Strange, the shaft doesn't seem to lead anywhere."); + mpr("The shaft disappears is a puff of logic!"); + + find_trap(you.pos())->destroy(); return; } @@ -1811,7 +1813,13 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, if (shaft_dest == level_id::current()) { if (known_trap) - mpr("Strange, the shaft doesn't seem to lead anywhere."); + { + mpr("Strange, the shaft seems to lead back to this level."); + mpr("The strain on the space-time continuum destroys the " + "shaft!"); + } + + find_trap(you.pos())->destroy(); return; } shaft_level = absdungeon_depth(shaft_dest.branch, 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(); |