summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-15 11:02:27 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-15 11:02:27 +0000
commit325516c60743ee1241e9ca3d13e4fd8a36d19c94 (patch)
tree151760b072e644587218af90c0c0d7694256fb1a /crawl-ref/source/tags.cc
parent298c1e905c0c3d04acdb1dd0c5e6bedce77dec3c (diff)
downloadcrawl-ref-325516c60743ee1241e9ca3d13e4fd8a36d19c94.tar.gz
crawl-ref-325516c60743ee1241e9ca3d13e4fd8a36d19c94.zip
Smarter exclusions, yay!
* Exclusions are now treated similarly to annotations and automatically added to the overmap (with the monster name if centered on a monster). * Exclusions remember whether they were placed automatically and if so, what monster triggered it. * If a grid that was previously autoexcluded comes back into sight and no longer contains the monster that triggered the autoexclusion (dead, moved away or invisible), the autoexclusion is removed again. I updated the tags, so it should be save compatible but I'm not making any promises. Also fix the Wild magic card not being documented correctly. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10679 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 520e02fc02..3b6c0ef4af 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -96,6 +96,7 @@ extern std::map<level_pos, std::string> portal_vaults_present;
extern std::map<level_pos, std::string> portal_vault_notes;
extern std::map<level_pos, char> portal_vault_colours;
extern std::map<level_id, std::string> level_annotations;
+extern std::map<level_id, std::string> level_exclusions;
// temp file pairs used for file level cleanup
@@ -166,7 +167,7 @@ static void tag_construct_lost_monsters(writer &th);
static void tag_construct_lost_items(writer &th);
static void tag_read_you(reader &th, char minorVersion);
static void tag_read_you_items(reader &th, char minorVersion);
-static void tag_read_you_dungeon(reader &th);
+static void tag_read_you_dungeon(reader &th, char minorVersion);
static void tag_read_lost_monsters(reader &th);
static void tag_read_lost_items(reader &th);
@@ -722,7 +723,7 @@ tag_type tag_read(FILE *fp, char minorVersion)
{
case TAG_YOU: tag_read_you(th, minorVersion); break;
case TAG_YOU_ITEMS: tag_read_you_items(th, minorVersion); break;
- case TAG_YOU_DUNGEON: tag_read_you_dungeon(th); break;
+ case TAG_YOU_DUNGEON: tag_read_you_dungeon(th, minorVersion); break;
case TAG_LEVEL: tag_read_level(th, minorVersion); break;
case TAG_LEVEL_ITEMS: tag_read_level_items(th, minorVersion); break;
case TAG_LEVEL_MONSTERS: tag_read_level_monsters(th, minorVersion); break;
@@ -1133,6 +1134,8 @@ static void tag_construct_you_dungeon(writer &th)
marshall_level_pos, marshallByte);
marshallMap(th, level_annotations,
marshall_level_id, marshallStringNoMax);
+ marshallMap(th, level_exclusions,
+ marshall_level_id, marshallStringNoMax);
marshallPlaceInfo(th, you.global_info);
std::vector<PlaceInfo> list = you.get_all_place_info();
@@ -1575,7 +1578,7 @@ static PlaceInfo unmarshallPlaceInfo(reader &th)
return place_info;
}
-static void tag_read_you_dungeon(reader &th)
+static void tag_read_you_dungeon(reader &th, char minorVersion)
{
// how many unique creatures?
int count_c = unmarshallShort(th);
@@ -1616,6 +1619,12 @@ static void tag_read_you_dungeon(reader &th)
unmarshallMap(th, level_annotations,
unmarshall_level_id, unmarshallStringNoMax);
+ if (minorVersion >= TAG_ANNOTATE_EXCL)
+ {
+ unmarshallMap(th, level_exclusions,
+ unmarshall_level_id, unmarshallStringNoMax);
+ }
+
PlaceInfo place_info = unmarshallPlaceInfo(th);
ASSERT(place_info.is_global());
you.set_place_info(place_info);