diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-25 22:36:55 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-25 22:36:55 +0000 |
commit | a81f929851dd78e52d4748835ac33e082e945992 (patch) | |
tree | 6e10da17c848082f2904b46553f96cb23692052d /crawl-ref/source/monplace.h | |
parent | f07d0af2207210a792aa3681b1c98ccb0b513baa (diff) | |
download | crawl-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/monplace.h')
-rw-r--r-- | crawl-ref/source/monplace.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/monplace.h b/crawl-ref/source/monplace.h index 6a72bca628..05be654743 100644 --- a/crawl-ref/source/monplace.h +++ b/crawl-ref/source/monplace.h @@ -94,10 +94,11 @@ enum proximity_type // proximity to player to create monster enum mgen_flag_type { - MG_PERMIT_BANDS = 0x1, - MG_FORCE_PLACE = 0x2, - MG_FORCE_BEH = 0x4, - MG_PLAYER_MADE = 0x8 + MG_PERMIT_BANDS = 0x01, + MG_FORCE_PLACE = 0x02, + MG_FORCE_BEH = 0x04, + MG_PLAYER_MADE = 0x08, + MG_PATROLLING = 0x10 }; // A structure with all the data needed to whip up a new monster. @@ -186,6 +187,7 @@ struct mgen_data bool permit_bands() const { return (flags & MG_PERMIT_BANDS); } bool force_place() const { return (flags & MG_FORCE_PLACE); } + bool needs_patrol_point() const { return (flags & MG_PATROLLING); } // Is there a valid position set on this struct that we want to use // when placing the monster? @@ -194,7 +196,8 @@ struct mgen_data bool summoned() const { return (abjuration_duration > 0); } static mgen_data sleeper_at(monster_type what, - const coord_def &where) + const coord_def &where, + unsigned flags = 0) { return mgen_data(what, BEH_SLEEP, 0, where); } |