summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mapdef.h
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 08:55:18 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 08:55:18 +0000
commitae6c83ec9f0273d13ad57f1382528d7715189a2b (patch)
tree2a09386686dc53e703cf1a6ce4b25acd069b3017 /crawl-ref/source/mapdef.h
parent4958b84b497fe729eaf14bc90b8d01874722c33d (diff)
downloadcrawl-ref-ae6c83ec9f0273d13ad57f1382528d7715189a2b.tar.gz
crawl-ref-ae6c83ec9f0273d13ad57f1382528d7715189a2b.zip
This change moves the logic for when a level or branch prohibits
teleport control from the C++ code into the vault .des files. This is done with the additions of two things: * Changeable, persistent per-level and per-branch flags which affect game play. * Dungeon events for the killing of monsters, picking up of objects and changing of features. The current level and branch flags are for teleport control prevention, making a level unmappable (like the Abyss or a Labyrinth), and preventing magic mapping from working (like the Abyss or a Labyrinth). Some related changes: * The new .des header KMASK allows for dungeon grid masks like no_monster_gen to be applied to specific symbols rather than the entire vault. * If the wizard mapping command (&{) is used in a place which is unmappable, it will ask if you wish to force the area to be mappable (so you can see what an entire Labyrinth or Abyss level looks like without having to hack the source). * A new wizard-mode level-map command, 'T', will teleport the player to wherever the cursor is pointing. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2146 c06c8d41-db1a-0410-9941-cceddc491573
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 919ed43a51..e3fd3e3d04 100644
--- a/crawl-ref/source/mapdef.h
+++ b/crawl-ref/source/mapdef.h
@@ -449,6 +449,17 @@ struct feature_slot
feature_spec get_feat(int default_glyph);
};
+struct map_flags
+{
+ unsigned long flags_set, flags_unset;
+
+ map_flags();
+
+ static map_flags parse(const std::string flag_list[],
+ const std::string &s) throw(std::string);
+};
+
+
struct keyed_mapspec
{
public:
@@ -457,6 +468,7 @@ public:
feature_slot feat;
item_list item;
mons_list mons;
+ map_flags map_mask;
public:
keyed_mapspec();
@@ -464,10 +476,12 @@ public:
std::string set_feat(const std::string &s, bool fix);
std::string set_mons(const std::string &s, bool fix);
std::string set_item(const std::string &s, bool fix);
+ std::string set_mask(const std::string &s, bool garbage);
feature_spec get_feat();
- mons_list &get_monsters();
- item_list &get_items();
+ mons_list &get_monsters();
+ item_list &get_items();
+ map_flags &get_mask();
private:
std::string err;
@@ -527,6 +541,8 @@ public:
mons_list mons;
item_list items;
+ map_flags level_flags, branch_flags;
+
keyed_specs keyspecs;
dlua_chunk prelude, main, validate, veto;
@@ -584,6 +600,7 @@ public:
bool is_usable_in(const level_id &lid) const;
keyed_mapspec *mapspec_for_key(int key);
+ const keyed_mapspec *mapspec_for_key(int key) const;
bool has_depth() const;
void add_depth(const level_range &depth);
@@ -593,6 +610,7 @@ public:
std::string add_key_item(const std::string &s);
std::string add_key_mons(const std::string &s);
std::string add_key_feat(const std::string &s);
+ std::string add_key_mask(const std::string &s);
bool can_dock(map_section_type) const;
coord_def dock_pos(map_section_type) const;