summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-25 15:22:27 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-25 15:22:27 +0000
commitf817284d0e2c5657fb883f57430ed888ed7ac248 (patch)
tree1ec33d3450ade91fb08b7e903efaef7481ede8d2 /crawl-ref/source
parente11f6ceb8c6fcd91d774303208ae1818428524db (diff)
downloadcrawl-ref-f817284d0e2c5657fb883f57430ed888ed7ac248.tar.gz
crawl-ref-f817284d0e2c5657fb883f57430ed888ed7ac248.zip
Branch entry vaults now respect DEPTH: declarations so you can put tough branch entries deeper.
Detect creatures no longer clears the level map of detected items. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1366 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/dungeon.cc2
-rw-r--r--crawl-ref/source/maps.cc8
-rw-r--r--crawl-ref/source/maps.h3
-rw-r--r--crawl-ref/source/spells2.cc2
-rw-r--r--crawl-ref/source/view.cc8
-rw-r--r--crawl-ref/source/view.h2
6 files changed, 18 insertions, 7 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 1c40e0e0d1..1e13ea91c4 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -1102,7 +1102,7 @@ static builder_rc_type builder_by_type(int level_number, char level_type)
static int random_portal_vault(const std::string &tag)
{
- return random_map_for_tag(tag, false);
+ return random_map_for_tag(tag, false, true);
}
static bool place_portal_vault(int stair, const std::string &tag, int dlevel)
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc
index 660778d67d..2193d9334c 100644
--- a/crawl-ref/source/maps.cc
+++ b/crawl-ref/source/maps.cc
@@ -309,14 +309,18 @@ int random_map_for_depth(int depth, bool want_minivault)
return (mapindex);
}
-int random_map_for_tag(const std::string &tag, bool want_minivault)
+int random_map_for_tag(const std::string &tag,
+ bool want_minivault,
+ bool check_depth)
{
int mapindex = -1;
int rollsize = 0;
for (unsigned i = 0, size = vdefs.size(); i < size; ++i)
{
- if (vdefs[i].has_tag(tag) && vdefs[i].is_minivault() == want_minivault)
+ 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)))
{
rollsize += vdefs[i].chance;
diff --git a/crawl-ref/source/maps.h b/crawl-ref/source/maps.h
index 0c3211664a..82738abd5c 100644
--- a/crawl-ref/source/maps.h
+++ b/crawl-ref/source/maps.h
@@ -42,7 +42,8 @@ int vault_main(map_type vgrid,
const map_def *map_by_index(int index);
int random_map_for_place(const std::string &place, bool mini = false);
int random_map_for_depth(int depth, bool want_minivault = false);
-int random_map_for_tag(const std::string &tag, bool want_minivault);
+int random_map_for_tag(const std::string &tag, bool want_minivault,
+ bool check_depth = false);
void add_parsed_map(const map_def &md);
void read_maps();
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index c101b63c13..0f082c1319 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -176,7 +176,7 @@ unsigned char detect_creatures( int pow )
// Clear the map so detect creatures is more useful and the detection
// fuzz is harder to analyse by averaging.
- clear_map();
+ clear_map(false);
mpr("You detect creatures!");
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 006fcf4d18..d46b82e356 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -479,7 +479,7 @@ screen_buffer_t colour_code_map( int x, int y, bool item_colour,
return fix_colour(tc);
}
-void clear_map()
+void clear_map(bool clear_detected_items, bool clear_detected_monsters)
{
for (int y = Y_BOUND_1; y <= Y_BOUND_2; ++y)
{
@@ -499,6 +499,12 @@ void clear_map()
if (is_envmap_item(x, y))
continue;
+ if (!clear_detected_items && is_envmap_detected_item(x, y))
+ continue;
+
+ if (!clear_detected_monsters && is_envmap_detected_mons(x, y))
+ continue;
+
set_envmap_char(x, y,
is_terrain_seen(x, y)? get_sightmap_char(grd[x][y]) :
is_terrain_known(x, y)? get_magicmap_char(grd[x][y]) :
diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h
index 52bc2dd1f1..099f39e48e 100644
--- a/crawl-ref/source/view.h
+++ b/crawl-ref/source/view.h
@@ -108,7 +108,7 @@ void setLOSRadius(int newLR);
* *********************************************************************** */
bool check_awaken(int mons_aw);
-void clear_map();
+void clear_map(bool clear_items = true, bool clear_mons = true);
bool is_feature(int feature, int x, int y);