summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-03 15:43:48 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-03 15:43:48 +0000
commite19142571c959097807f512d794dedf4559afb8e (patch)
tree64adf76f2054abaed62c8ddd598e503be05c2960 /crawl-ref/source/monstuff.cc
parent0c5b467e0c5034030001b14cab04a346a2088a9a (diff)
downloadcrawl-ref-e19142571c959097807f512d794dedf4559afb8e.tar.gz
crawl-ref-e19142571c959097807f512d794dedf4559afb8e.zip
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
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc6
1 files changed, 6 insertions, 0 deletions
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;