summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-summoning.h
diff options
context:
space:
mode:
authorgammafunk <gammafunk@gmail.com>2014-02-08 23:00:37 -0600
committerNeil Moore <neil@s-z.org>2014-02-19 14:10:28 -0500
commit8ffe610920d44e5fe190486d4474423c4873d4bf (patch)
treeb0d7d26a05e5e84a648bafd5452ec4b92c8077c4 /crawl-ref/source/spl-summoning.h
parent505844037e126713064bddb149652d0ae7f3d042 (diff)
downloadcrawl-ref-8ffe610920d44e5fe190486d4474423c4873d4bf.tar.gz
crawl-ref-8ffe610920d44e5fe190486d4474423c4873d4bf.zip
Convert alignment of a monster avatar when its summoner's alignment changes.
When the alignment of the summoner of a spectral weapon, battlesphere, or grand avatar changes, previously these avatars were not changing alignment along with the summoner. This adds monster::align_avatars() which is called appropriately in mons_att_changed() and in monster::add_ench() for the case of ENCH_CHARM. When summoners go to any form of ATT_*NEUTRAL, we remove all their avatars. For grand avatars, I've added an end_grand_avatar() function to help with this. Monsters with ENCH_GRAND_AVATAR that change attitude but who are not the summoner also lose that enchantment. This also adds monster::remove_avatars() which is called by ::align_avatars() when necessary as well as when a monster's soul is enslaved. There is also a bugfix in setting of ENCH_GRAND_AVATAR upon casting where it would skip setting enchantment on the summoner if summoner was charmed. Always set the enchant on the owner, and never set the enchant on any kind of avatar to avoid having an avatar of an avatar.
Diffstat (limited to 'crawl-ref/source/spl-summoning.h')
-rw-r--r--crawl-ref/source/spl-summoning.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/spl-summoning.h b/crawl-ref/source/spl-summoning.h
index aa8d68c690..ff1319f6e3 100644
--- a/crawl-ref/source/spl-summoning.h
+++ b/crawl-ref/source/spl-summoning.h
@@ -113,6 +113,7 @@ void reset_spectral_weapon(monster* mons);
void grand_avatar_reset(monster* mons);
bool grand_avatar_check_melee(monster* mons, actor* target);
+void end_grand_avatar(monster* mons, bool killed);
void trigger_grand_avatar(monster* mons, actor* victim, spell_type spell,
const int old_hp);