summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.h
diff options
context:
space:
mode:
authorgammafunk <gammafunk@gmail.com>2014-02-04 02:20:21 -0600
committerNeil Moore <neil@s-z.org>2014-02-09 11:13:00 -0500
commit5c913e88656986f9c9ed37a028372817ae09257b (patch)
treee892924b0cdfbb91457b36d46aa5ce04aa1841d7 /crawl-ref/source/mon-util.h
parent6a3835bcdbc3dd5f3eb46bd5073a1c7c29947952 (diff)
downloadcrawl-ref-5c913e88656986f9c9ed37a028372817ae09257b.tar.gz
crawl-ref-5c913e88656986f9c9ed37a028372817ae09257b.zip
Fix seek/wandering behaviour of spectral weapons and battlespheres.
The monster versions of these spells were misbehaving differently depending on whether they are friendly or hostile due to assumptions in handle_behaviour(). Some changes that let these "avatars" behave properly when both friendly and hostile, regardless of caster: 0. I added a mons_is_avatar() function that returns true if the given monster type is a battlesphere, spectral weapon, or grand avatar. The behaviour changes only affect spectral weapons and battlespheres, and the function is currently only used for code relative to those two, but they're all in the class of "magical constructs attached to the caster". 1. Spectral weapons and battlespheres seek their owner upon creation. 2. Avatars now always know the location of their owner and will attempt to seek to their owner if they fail to seek their current target. 3. Avatars not created by the player see their owner as the "foe" to fall back to instead of the player. Using the owner for mon->foe when the avatar cannot attack (in the case of spectral weapons) is perhaps not the best system, but it's how non-avatar player-friendly monsters are currently able to track the player, so we use the analogous approach now. 4. Spectral weapons are all properly "leashed" to their owner and fall back to seeking owner if they are out of their two-distance leash. Battlespheres also seek back to their owner if said owner is teleported away.
Diffstat (limited to 'crawl-ref/source/mon-util.h')
-rw-r--r--crawl-ref/source/mon-util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index 33bb61a49d..02d78cb46a 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -237,6 +237,7 @@ bool mons_is_draconian(monster_type mc);
bool mons_is_demonspawn(monster_type mc);
bool mons_is_conjured(monster_type mc);
bool mons_is_beast(monster_type mc);
+bool mons_is_avatar(monster_type mc);
int mons_demon_tier(monster_type mc);
bool mons_class_wields_two_weapons(monster_type mc);