From 41f78a696154902ae7baa22e116d39b6d321fc62 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 21 Jul 2009 17:53:49 +0000 Subject: Make fish on dry land (due to Feawn's Sunlight power) flop about and lose hit points until back in water, using ENCH_AQUATIC_LAND. (Bug 2824663) Also fix tiles compilation (patch 2824632) and add DATA_DIR_PATH to tiled icons (patch 2824635). Both patches (and some more) by Trent W. Buck. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10364 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells3.cc | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'crawl-ref/source/spells3.cc') diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 6f238654ad..3a815e32e8 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -815,7 +815,7 @@ void equip_undead(const coord_def &a, int corps, int monster, int monnum) default: continue; - } // switch + } // Two different items going into the same slot indicate that // this and further items weren't equipment the monster died @@ -825,10 +825,10 @@ void equip_undead(const coord_def &a, int corps, int monster, int monnum) unwind_var save_speedinc(mon->speed_increment); mon->pickup_item(mitm[objl], false, true); - } // while + } } -static bool _raise_remains(const coord_def &a, int corps, beh_type beha, +static bool _raise_remains(const coord_def &pos, int corps, beh_type beha, unsigned short hitting, god_type god, bool actual, int* mon_index) { @@ -851,45 +851,50 @@ static bool _raise_remains(const coord_def &a, int corps, beh_type beha, // Headless hydras cannot be raised, sorry. if (zombie_type == MONS_HYDRA && number == 0) + { + if (see_grid(pos)) + { + mpr("The zero-headed hydra corpse sways and immediately " + "collapses!"); + } return (false); + } monster_type mon = MONS_PROGRAM_BUG; if (item.sub_type == CORPSE_BODY) { - mon = (mons_zombie_size(item.plus) == Z_SMALL) ? - MONS_ZOMBIE_SMALL : MONS_ZOMBIE_LARGE; + mon = (mons_zombie_size(item.plus) == Z_SMALL) ? MONS_ZOMBIE_SMALL + : MONS_ZOMBIE_LARGE; } else { - mon = (mons_zombie_size(item.plus) == Z_SMALL) ? - MONS_SKELETON_SMALL : MONS_SKELETON_LARGE; + mon = (mons_zombie_size(item.plus) == Z_SMALL) ? MONS_SKELETON_SMALL + : MONS_SKELETON_LARGE; } - const int monster = create_monster( + int monster = create_monster( mgen_data(mon, beha, - 0, 0, a, hitting, + 0, 0, pos, hitting, 0, god, zombie_type, number)); if (mon_index != NULL) *mon_index = monster; - if (monster != -1) - { - const int monnum = item.orig_monnum - 1; + if (monster == -1) + return (false); - if (is_named_corpse(item)) - name_zombie(&menv[monster], monnum, get_corpse_name(item)); + const int monnum = item.orig_monnum - 1; - equip_undead(a, corps, monster, monnum); + if (is_named_corpse(item)) + name_zombie(&menv[monster], monnum, get_corpse_name(item)); - destroy_item(corps); + equip_undead(pos, corps, monster, monnum); - return (true); - } + destroy_item(corps); - return (false); + return (true); } // Note that quiet will *not* suppress the message about a corpse -- cgit v1.2.3-54-g00ecf