summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapdef.h
diff options
context:
space:
mode:
authorDarshan Shaligram <scintilla@gmail.com>2013-01-13 01:13:44 -0500
committerDarshan Shaligram <scintilla@gmail.com>2013-01-13 17:27:51 -0500
commitdad6e4ce9ce169e06d892f8836b95ca43b5db004 (patch)
treeb07693f0395955ce9da173d114d598279d40bcb3 /crawl-ref/source/mapdef.h
parent028bef3b7215948bf49e27ff7e93a7922c69cc19 (diff)
downloadcrawl-ref-dad6e4ce9ce169e06d892f8836b95ca43b5db004.tar.gz
crawl-ref-dad6e4ce9ce169e06d892f8836b95ca43b5db004.zip
Save subvaults, tag vault monsters.
Save subvaults in vault_placement with their parent mapdefs, include subvault names when generating logfile entries. Tag monsters with the name of the map that placed them, and write a killermap field to the logfile if the killer was placed by a map, and the player did not die in that same map.
Diffstat (limited to 'crawl-ref/source/mapdef.h')
-rw-r--r--crawl-ref/source/mapdef.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/crawl-ref/source/mapdef.h b/crawl-ref/source/mapdef.h
index 9a7a7cb6ff..6515082c55 100644
--- a/crawl-ref/source/mapdef.h
+++ b/crawl-ref/source/mapdef.h
@@ -302,6 +302,7 @@ public:
map_string_list strlist;
};
+typedef pair<coord_def, coord_def> map_corner_t;
class map_def;
class rectangle_iterator;
struct keyed_mapspec;
@@ -423,8 +424,8 @@ public:
const coord_def &br, Matrix<bool> &flags);
// Merge vault onto the tl/br subregion, where mask is true.
- void merge_subvault(const coord_def &tl, const coord_def &br,
- const Matrix<bool> &mask, const map_def &vault);
+ map_corner_t merge_subvault(const coord_def &tl, const coord_def &br,
+ const Matrix<bool> &mask, const map_def &vault);
private:
void init_from(const map_lines &map);
template <typename V> void clear_vector(V &vect);
@@ -1051,6 +1052,21 @@ public:
}
};
+// Position of a subvault inside its parent.
+struct subvault_place
+{
+ coord_def tl, br;
+ unique_ptr<map_def> subvault;
+
+ subvault_place();
+ subvault_place(const coord_def &_tl, const coord_def &_br,
+ const map_def &_subvault);
+ subvault_place(const subvault_place &place);
+ subvault_place &operator = (const subvault_place &place);
+
+ void set_subvault(const map_def &);
+};
+
/////////////////////////////////////////////////////////////////////////////
// map_def: map definitions for maps loaded from .des files.
//
@@ -1120,6 +1136,7 @@ public:
dungeon_feature_type border_fill_type;
::map<dungeon_feature_type, string> feat_renames;
+ vector<subvault_place> subvault_places;
private:
// This map has been loaded from an index, and not fully realised.
@@ -1137,6 +1154,7 @@ private:
public:
map_def();
+ string name_at(const coord_def &pos) const;
string desc_or_name() const;
string describe() const;