summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-act.h
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2013-04-20 13:24:45 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2013-04-21 18:33:54 -0600
commit27b33f2754fc755c52ec3260b6184ce514567a82 (patch)
treee1f722f0472e0c17589a5b709e57c8b355db1a7c /crawl-ref/source/mon-act.h
parentaaa69ee92ab07875b40cc2f40f7584fef77d39ae (diff)
downloadcrawl-ref-27b33f2754fc755c52ec3260b6184ce514567a82.tar.gz
crawl-ref-27b33f2754fc755c52ec3260b6184ce514567a82.zip
Have monsters act in order of speed_increment values.
This means that monsters only get consecutive actions if they are much faster than anything around them, and that fineffs fire once per monster action (fixing #6936). A good way to illustrate this change is to generate a pack of centaurs with perm_ench:haste. Previously, one centaur would fire off as many shots as it could take, then the next centaur, etc. - they were nice and took turns in order. Now, you'll get consecutive volleys - they all seem like they are firing simultaneously.
Diffstat (limited to 'crawl-ref/source/mon-act.h')
-rw-r--r--crawl-ref/source/mon-act.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-act.h b/crawl-ref/source/mon-act.h
index fcf33684fa..7795b4a8d9 100644
--- a/crawl-ref/source/mon-act.h
+++ b/crawl-ref/source/mon-act.h
@@ -6,11 +6,21 @@
#ifndef MONACT_H
#define MONACT_H
+class MonsterActionQueueCompare
+{
+public:
+ bool operator() (pair<monster*, int> m1, pair<monster*, int> m2)
+ {
+ return m1.second < m2.second;
+ }
+};
+
bool mon_can_move_to_pos(const monster* mons, const coord_def& delta,
bool just_check = false);
bool mons_can_move_towards_target(const monster* mon);
void handle_monsters(bool with_noise = false);
+void pre_monster_move(monster* mon);
void handle_monster_move(monster* mon);
#define ENERGY_SUBMERGE(entry) (max(entry->energy_usage.swim / 2, 1))