diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-09 19:52:59 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-09 19:52:59 +0000 |
commit | d69688f0d70ebd684181678a77ca10f800258cfe (patch) | |
tree | 19b8b9fdd4c8194ea65d0729cdf44adf31ee7e60 /crawl-ref/source/maps.cc | |
parent | b31a9edb3090aa8dac6dc1fc70c5e241c3019642 (diff) | |
download | crawl-ref-d69688f0d70ebd684181678a77ca10f800258cfe.tar.gz crawl-ref-d69688f0d70ebd684181678a77ca10f800258cfe.zip |
Added Lemuel's mines minivaults.
Extended map DEPTH: attribute to support branch specifiers and negated depth
specifiers.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1442 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/maps.cc')
-rw-r--r-- | crawl-ref/source/maps.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc index 98ecb5c25f..bc9c9acf27 100644 --- a/crawl-ref/source/maps.cc +++ b/crawl-ref/source/maps.cc @@ -283,19 +283,19 @@ int random_map_for_place(const std::string &place, bool want_minivault) return (mapindex); } -int random_map_for_depth(int depth, bool want_minivault) +int random_map_for_depth(const level_id &place, bool want_minivault) { int mapindex = -1; int rollsize = 0; for (unsigned i = 0, size = vdefs.size(); i < size; ++i) - if (vdefs[i].depth.contains(depth) + if (vdefs[i].is_minivault() == want_minivault + && vdefs[i].is_usable_in(place) // Tagged levels cannot be selected by depth. This is // the only thing preventing Pandemonium demon vaults from // showing up in the main dungeon. && !vdefs[i].has_tag("entry") - && !vdefs[i].has_tag("pan") - && vdefs[i].is_minivault() == want_minivault) + && !vdefs[i].has_tag("pan")) { rollsize += vdefs[i].chance; @@ -305,7 +305,7 @@ int random_map_for_depth(int depth, bool want_minivault) if (mapindex != -1 && vdefs[mapindex].has_tag("dummy")) mapindex = -1; - + return (mapindex); } @@ -319,8 +319,8 @@ int random_map_for_tag(const std::string &tag, for (unsigned i = 0, size = vdefs.size(); i < size; ++i) { if (vdefs[i].has_tag(tag) && vdefs[i].is_minivault() == want_minivault - && (!check_depth || !vdefs[i].depth.valid() - || vdefs[i].depth.contains(you.your_level))) + && (!check_depth || !vdefs[i].has_depth() + || vdefs[i].is_usable_in(level_id::current()))) { rollsize += vdefs[i].chance; |