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>2008-05-25 22:36:55 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-25 22:36:55 +0000
commita81f929851dd78e52d4748835ac33e082e945992 (patch)
tree6e10da17c848082f2904b46553f96cb23692052d /crawl-ref/source/tags.cc
parentf07d0af2207210a792aa3681b1c98ccb0b513baa (diff)
downloadcrawl-ref-a81f929851dd78e52d4748835ac33e082e945992.tar.gz
crawl-ref-a81f929851dd78e52d4748835ac33e082e945992.zip
Fix aborting unchivalric attacks costing a turn.
Implement ordering your friends to stay where they are. To do this, I've added a new variable to the monster struct: patrol_point, that is set by the new t sub-command "Wait here!" Once this is set, monsters will spend their time wandering around within the LOS radius centred on the patrol point. If they are attacked, or the player or other friends are attacked, they'll stop wandering to fight, but once the foe is gone, they continue doing so. Currently, the only way to make them stop again is to issue another command, "Follow me!" that is basically the already existing "Come here!" command. I've also added a "Stop fighting!" command that for non-patrolling monsters has the same effect as "Follow me!" - patrolling monsters are supposed to take up their wanderings again. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5247 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 076405a1ad..8610f3fd9c 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1770,6 +1770,7 @@ static void marshall_monster(writer &th, const monsters &m)
marshallByte(th, m.y);
marshallByte(th, m.target_x);
marshallByte(th, m.target_y);
+ marshallCoord(th, m.patrol_point);
marshallLong(th, m.flags);
marshallLong(th, m.experience);
@@ -2030,6 +2031,10 @@ static void unmarshall_monster(reader &th, monsters &m)
m.y = unmarshallByte(th);
m.target_x = unmarshallByte(th);
m.target_y = unmarshallByte(th);
+
+ if (_tag_minor_version >= TAG_MINOR_MPATROL)
+ unmarshallCoord(th, m.patrol_point);
+
m.flags = unmarshallLong(th);
m.experience = static_cast<unsigned long>(unmarshallLong(th));