From 1db9c68406e0892e1ac7331dfd3b412b31741cb7 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Fri, 5 Oct 2007 06:10:49 +0000 Subject: Shaft traps (trap doors) [1792195] and level annotation [1769009] added, with the shaft traps changed as per comments on SF; shafts aren't randomly generated yet, so this doesn't change gameplay. Changed DNGN_TRAP_III to DNGN_TRAP_NATURAL, of which trap type the shaft traps are the only current member. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2328 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/traps.cc | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'crawl-ref/source/traps.cc') diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index cc4638c842..ede8d6561e 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -383,6 +383,42 @@ void handle_traps(char trt, int i, bool trap_known) env.trap[i].type = TRAP_UNASSIGNED; } break; + + // If we don't trigger the shaft, and the player doesn't + // already know about it, don't let him/her notice it. + case TRAP_SHAFT: + { + // Paranoia + if (!is_valid_shaft_level()) + { + if (trap_known); + mpr("The shaft disappears in a puff of logic!"); + + grd[env.trap[i].x][env.trap[i].y] = DNGN_FLOOR; + env.trap[i].type = TRAP_UNASSIGNED; + return; + } + + if (!you.will_trigger_shaft()) + { + if (trap_known && !you.airborne()) + mpr("You fail to trigger the shaft."); + + if (!trap_known) + grd[you.x_pos][you.y_pos] = DNGN_UNDISCOVERED_TRAP; + + return; + } + + if (!you.do_shaft()) + if (!trap_known) + { + grd[you.x_pos][you.y_pos] = DNGN_UNDISCOVERED_TRAP; + return; + } + + break; + } case TRAP_ZOT: default: @@ -770,6 +806,9 @@ dungeon_feature_type trap_category(trap_type type) { switch (type) { + case TRAP_SHAFT: + return (DNGN_TRAP_NATURAL); + case TRAP_TELEPORT: case TRAP_AMNESIA: case TRAP_ZOT: -- cgit v1.2.3-54-g00ecf