diff options
author | Charles Otto <ottochar@gmail.com> | 2010-01-17 15:25:25 -0500 |
---|---|---|
committer | Charles Otto <ottochar@gmail.com> | 2010-01-17 15:25:25 -0500 |
commit | a41a9d625e97d084a68d40a1101c1ac62e2a051f (patch) | |
tree | 178c6a073afd7b59e8462283c73512b575ad61b0 /crawl-ref/source/godabil.cc | |
parent | 9070ae69f61b80039e93dd9b2ca1cc1b01f06478 (diff) | |
download | crawl-ref-a41a9d625e97d084a68d40a1101c1ac62e2a051f.tar.gz crawl-ref-a41a9d625e97d084a68d40a1101c1ac62e2a051f.zip |
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.
Diffstat (limited to 'crawl-ref/source/godabil.cc')
-rw-r--r-- | crawl-ref/source/godabil.cc | 26 |
1 files changed, 24 insertions, 2 deletions
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; } |