summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-08-19 21:59:45 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-08-19 21:59:45 +0000
commitf76829ed22a7b9d20b0a217e7c988abd110de634 (patch)
treecb175be92b55c1a180e6ae464cb2ab6f582356dd /crawl-ref/source/dungeon.cc
parentb7fc7189b832bdbd745f3ca615c69376394661cc (diff)
downloadcrawl-ref-f76829ed22a7b9d20b0a217e7c988abd110de634.tar.gz
crawl-ref-f76829ed22a7b9d20b0a217e7c988abd110de634.zip
A KFEAT specified trap can start out known to the player by adding "known"
to the trap name. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10581 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc36
1 files changed, 23 insertions, 13 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 2c4a04ba1f..b5ef022f55 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -4768,14 +4768,20 @@ dungeon_feature_type map_feature(map_def *map, const coord_def &c, int rawfeat)
if (mapsp)
{
const feature_spec f = mapsp->get_feat();
- if (f.feat >= 0)
+ if (f.trap >= 0)
+ {
+ // f.feat == 1 means trap is generated known.
+ if (f.feat == 1)
+ return trap_category(static_cast<trap_type>(f.trap));
+ else
+ return (DNGN_UNDISCOVERED_TRAP);
+ }
+ else if (f.feat >= 0)
return static_cast<dungeon_feature_type>(f.feat);
else if (f.glyph >= 0)
return map_feature(NULL, c, rawfeat);
else if (f.shop >= 0)
return (DNGN_ENTER_SHOP);
- else if (f.trap >= 0)
- return (DNGN_UNDISCOVERED_TRAP);
return (DNGN_FLOOR);
}
@@ -4829,7 +4835,20 @@ static void _vault_grid( vault_placement &place,
if (mapsp)
{
const feature_spec f = mapsp->get_feat();
- if (f.feat >= 0)
+ if (f.trap >= 0)
+ {
+ const trap_type trap =
+ (f.trap == TRAP_INDEPTH)
+ ? random_trap_for_place(place.level_number)
+ : static_cast<trap_type>(f.trap);
+
+ place_specific_trap(where, trap);
+
+ // f.feat == 1 means trap is generated known.
+ if (f.feat == 1)
+ grd(where) = trap_category(trap);
+ }
+ else if (f.feat >= 0)
{
grd(where) = static_cast<dungeon_feature_type>( f.feat );
vgrid = -1;
@@ -4840,15 +4859,6 @@ static void _vault_grid( vault_placement &place,
}
else if (f.shop >= 0)
place_spec_shop(place.level_number, where, f.shop);
- else if (f.trap >= 0)
- {
- const trap_type trap =
- (f.trap == TRAP_INDEPTH)
- ? random_trap_for_place(place.level_number)
- : static_cast<trap_type>(f.trap);
-
- place_specific_trap(where, trap);
- }
else
grd(where) = DNGN_FLOOR;