From a41a9d625e97d084a68d40a1101c1ac62e2a051f Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Sun, 17 Jan 2010 15:25:25 -0500 Subject: Fix decomposed skeletons getting the wrong speed and HP monsters::upgrade_type doesn't handle derived undead well so I switched to destroying and replacing zombies that are affected by Fedhas' decomposition. --- crawl-ref/source/godabil.cc | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc index 33bdfb1da6..2c42e8f9e6 100644 --- a/crawl-ref/source/godabil.cc +++ b/crawl-ref/source/godabil.cc @@ -394,10 +394,32 @@ int fungal_bloom() if (mons_zombie_size(mons_zombie_base(mons)) == Z_SMALL) skele_type = MONS_SKELETON_SMALL; + // Killing and replacing the zombie since upgrade_type + // doesn't get skeleton speed right (and doesn't + // reduce the victim's HP). This is awkward. -cao + mgen_data mg(skele_type, mons->behaviour, NULL, 0, 0, + mons->pos(), + mons->foe, + MG_FORCE_BEH | MG_FORCE_PLACE, + mons->god, + mons_zombie_base(mons), + mons->number); + + unsigned monster_flags = mons->flags; + int current_hp = mons->hit_points; + mon_enchant_list ench = mons->enchantments; + simple_monster_message(mons, "'s flesh rots away."); - mons->upgrade_type(skele_type, true, true); - behaviour_event(mons, ME_ALERT, MHITYOU); + monster_die(mons, KILL_MISC, NON_MONSTER, true); + int monster = create_monster(mg); + env.mons[monster].flags = monster_flags; + env.mons[monster].enchantments = ench; + + if (env.mons[monster].hit_points > current_hp) + env.mons[monster].hit_points = current_hp; + + behaviour_event(&env.mons[monster], ME_ALERT, MHITYOU); continue; } -- cgit v1.2.3