summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/traps.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-05 06:10:49 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-05 06:10:49 +0000
commit1db9c68406e0892e1ac7331dfd3b412b31741cb7 (patch)
treedabc507f32d87ba59c660f45fffa6b5b9042e6c5 /crawl-ref/source/traps.cc
parent70d59beabaddfbb2edefee1f610e16881c8ff771 (diff)
downloadcrawl-ref-1db9c68406e0892e1ac7331dfd3b412b31741cb7.tar.gz
crawl-ref-1db9c68406e0892e1ac7331dfd3b412b31741cb7.zip
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
Diffstat (limited to 'crawl-ref/source/traps.cc')
-rw-r--r--crawl-ref/source/traps.cc39
1 files changed, 39 insertions, 0 deletions
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: