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>2007-10-13 13:50:13 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-13 13:50:13 +0000
commit6b3f400a54d573521f844f34ad8a8b223c57c968 (patch)
tree2e916ac4de6cabc5b52ab5dcc2e426a2a65ecd7d /crawl-ref/source/tags.cc
parent884fcefad29a596466ac963ab0aedfc902185960 (diff)
downloadcrawl-ref-6b3f400a54d573521f844f34ad8a8b223c57c968.tar.gz
crawl-ref-6b3f400a54d573521f844f34ad8a8b223c57c968.zip
Implementing merfolk monsters. There are two types, merfolk fighters,
and mermaids. The latter are more interesting. ;) Whenever a mermaid sings there's a chance you get beheld, meaning you cannot move away from the mermaid, that is cannot increase the distance between you and her. (Because of the distance pecularities this means at dist 1 you can only be NSW or E of the mermaid but not the diagonal directions.) If you manage to be beheld by several mermaids at the same time, your movements have to respect the distance to all of them. I've added a vector beheld_by that keeps track of beholding monsters and makes checking distance and updating beholding status easier. Merfolk are immune to the mermaid song. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2453 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index e4631d3f6d..818da4051c 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -928,6 +928,11 @@ static void tag_construct_you(struct tagHeader &th)
marshallShort(th, you.transit_stair);
marshallByte(th, you.entering_level);
+
+ // list of currently beholding monsters (usually empty)
+ marshallByte(th, you.beheld_by.size());
+ for (unsigned int k = 0; k < you.beheld_by.size(); k++)
+ marshallByte(th, you.beheld_by[k]);
}
static void tag_construct_you_items(struct tagHeader &th)
@@ -1263,6 +1268,11 @@ static void tag_read_you(struct tagHeader &th, char minorVersion)
you.transit_stair = static_cast<dungeon_feature_type>(unmarshallShort(th));
you.entering_level = unmarshallByte(th);
+
+ // list of currently beholding monsters (usually empty)
+ count_c = unmarshallByte(th);
+ for (i = 0; i < count_c; i++)
+ you.beheld_by.push_back(unmarshallByte(th));
}
static void tag_read_you_items(struct tagHeader &th, char minorVersion)