From e19142571c959097807f512d794dedf4559afb8e Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 3 May 2008 15:43:48 +0000 Subject: After still more thought, put back the preservation of the foe, as well as the charm and neutral enchantments for polymorphed monsters, and do it for all of them, not just shapeshifters. If you polymorph them using the spell or the wand, it counts as an attack, so they'll lose the charm and neutral enchantments anyway, and their foe will be set to you. On the other hand, if e.g. Xom polymorphs them (since he doesn't check for temporary charm or neutrality), they'll remain as they were. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4841 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/monstuff.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crawl-ref/source/monstuff.cc') diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index f8fcb30f6f..aa50007b27 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1582,14 +1582,20 @@ bool monster_polymorph( monsters *monster, monster_type targetc, monster->type = targetc; monster->number = MONS_PROGRAM_BUG; + unsigned int foe = monster->foe; mon_enchant abj = monster->get_ench(ENCH_ABJ); + mon_enchant charm = monster->get_ench(ENCH_CHARM); + mon_enchant neutral = monster->get_ench(ENCH_NEUTRAL); mon_enchant shifter = monster->get_ench(ENCH_GLOWING_SHAPESHIFTER, ENCH_SHAPESHIFTER); // Note: define_monster() will clear out all enchantments! -- bwr define_monster( monster_index(monster) ); + monster->foe = foe; monster->add_ench(abj); + monster->add_ench(charm); + monster->add_ench(neutral); monster->add_ench(shifter); monster->ench_countdown = old_ench_countdown; -- cgit v1.2.3-54-g00ecf