diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-08-19 21:59:45 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-08-19 21:59:45 +0000 |
commit | f76829ed22a7b9d20b0a217e7c988abd110de634 (patch) | |
tree | cb175be92b55c1a180e6ae464cb2ab6f582356dd /crawl-ref/source/mapdef.cc | |
parent | b7fc7189b832bdbd745f3ca615c69376394661cc (diff) | |
download | crawl-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/mapdef.cc')
-rw-r--r-- | crawl-ref/source/mapdef.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index d116bd6d4c..8d9e7408af 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -3352,6 +3352,8 @@ void keyed_mapspec::parse_features(const std::string &s) feature_spec keyed_mapspec::parse_trap(std::string s, int weight) { strip_tag(s, "trap"); + const bool known = strip_tag(s, "known"); + trim_string(s); lowercase(s); @@ -3359,7 +3361,7 @@ feature_spec keyed_mapspec::parse_trap(std::string s, int weight) if (trap == -1) err = make_stringf("bad trap name: '%s'", s.c_str()); - feature_spec fspec(-1, weight); + feature_spec fspec(known ? 1 : -1, weight); fspec.trap = trap; return (fspec); } |