summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-behv.h
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2012-08-29 15:28:56 +0200
committerRaphael Langella <raphael.langella@gmail.com>2012-08-29 15:49:32 +0200
commita966225517d6279369af199c9ff9c48b085a7a32 (patch)
tree1e361c99253ab96977e738ac924b3704b4c5798a /crawl-ref/source/mon-behv.h
parent48d7effa1ce325c579685654be5fd325eb42d7ef (diff)
downloadcrawl-ref-a966225517d6279369af199c9ff9c48b085a7a32.tar.gz
crawl-ref-a966225517d6279369af199c9ff9c48b085a7a32.zip
Prevent friendly summons from attacking out of LOS.
For a summon to be able to attack a target (by whatever mean), both it and its target needs to be in LOS of the player. It doesn't have to be actually visible, but it cannot be behind glass (the check is cell_see_cell_no_trans). Aditionally, wandering friendly summons will try to stay in sight of the player.
Diffstat (limited to 'crawl-ref/source/mon-behv.h')
-rw-r--r--crawl-ref/source/mon-behv.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-behv.h b/crawl-ref/source/mon-behv.h
index 694c03f52b..2fd66e2859 100644
--- a/crawl-ref/source/mon-behv.h
+++ b/crawl-ref/source/mon-behv.h
@@ -39,6 +39,10 @@ void make_mons_leave_level(monster* mon);
bool monster_can_hit_monster(monster* mons, const monster* targ);
+bool summon_can_attack(const monster* mons);
+bool summon_can_attack(const monster* mons, const coord_def &p);
+bool summon_can_attack(const monster* mons, const actor* targ);
+
// For Zotdef: the target position of MHITYOU monsters is
// the orb.
#define PLAYER_POS (crawl_state.game_is_zotdef() ? env.orb_pos : you.pos())