summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-15 15:07:01 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-15 15:07:01 +0000
commit547d7729392c008d4baaac82ea81d794a552fcd2 (patch)
treef987be118be89eba04dc08100cd9269fec64b2c2 /crawl-ref/source/monstuff.cc
parent3e2e58c1756b2942fc7294cd1f36b7341e6555cd (diff)
downloadcrawl-ref-547d7729392c008d4baaac82ea81d794a552fcd2.tar.gz
crawl-ref-547d7729392c008d4baaac82ea81d794a552fcd2.zip
Clean up handling of zombie-types.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3650 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc43
1 files changed, 15 insertions, 28 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index c4bf18a5d5..11306b9c81 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1182,14 +1182,11 @@ static bool valid_morph( monsters *monster, int new_mclass )
|| new_mclass == MONS_GLOWING_SHAPESHIFTER
// These require manual setting of mons.number to indicate
- // what they are a simulacrum/zombie of, which we currently
- // aren't smart enough to handle.
- || new_mclass == MONS_SIMULACRUM_LARGE
- || new_mclass == MONS_SIMULACRUM_SMALL
- || new_mclass == MONS_ZOMBIE_SMALL
- || new_mclass == MONS_ZOMBIE_LARGE
-
- // These shouldn't happen anyways (demons unaffected + holiness check),
+ // what they are a skeleton/zombie/simulacrum/spectral thing of,
+ // which we currently aren't smart enough to handle.
+ || mons_class_is_zombified(new_mclass)
+
+ // These shouldn't happen anyways (demons unaffected + holiness check),
// but if we ever do have polydemon, these will be needed:
|| new_mclass == MONS_PLAYER_GHOST
|| new_mclass == MONS_PANDEMONIUM_DEMON
@@ -4424,18 +4421,14 @@ static void handle_monster_move(int i, monsters *monster)
continue;
}
- if (monster->type == MONS_ZOMBIE_SMALL
- || monster->type == MONS_ZOMBIE_LARGE
- || monster->type == MONS_SIMULACRUM_SMALL
- || monster->type == MONS_SIMULACRUM_LARGE
- || monster->type == MONS_SKELETON_SMALL
- || monster->type == MONS_SKELETON_LARGE)
+ if (mons_is_zombified(monster)
+ && monster->type != MONS_SPECTRAL_THING)
{
monster->max_hit_points = monster->hit_points;
}
if (igrd[monster->x][monster->y] != NON_ITEM
- && (mons_itemuse(monster->type) == MONUSE_WEAPONS_ARMOUR
+ && (mons_itemuse(monster->type) == MONUSE_WEAPONS_ARMOUR
|| mons_itemuse(monster->type) == MONUSE_EATS_ITEMS
|| monster->type == MONS_NECROPHAGE
|| monster->type == MONS_GHOUL))
@@ -5647,13 +5640,7 @@ static bool monster_move(monsters *monster)
&& (mons_intel(monster_index(monster)) == I_HIGH
|| mons_intel(monster_index(monster)) == I_NORMAL)))
{
- if (monster->type == MONS_ZOMBIE_SMALL
- || monster->type == MONS_ZOMBIE_LARGE
- || monster->type == MONS_SIMULACRUM_SMALL
- || monster->type == MONS_SIMULACRUM_LARGE
- || monster->type == MONS_SKELETON_SMALL
- || monster->type == MONS_SKELETON_LARGE
- || monster->type == MONS_SPECTRAL_THING)
+ if (mons_is_zombified(monster))
{
// for zombies, monster type is kept in mon->number
if (mons_itemuse(monster->number) >= MONUSE_OPEN_DOORS)
@@ -6181,16 +6168,16 @@ bool monster_descriptor(int which_class, unsigned char which_descriptor)
if (which_descriptor == MDSC_NOMSG_WOUNDS)
{
+ if (mons_class_is_zombified(which_class)
+ && which_class != MONS_SPECTRAL_THING)
+ {
+ return (true);
+ }
+
switch (which_class)
{
case MONS_RAKSHASA:
case MONS_RAKSHASA_FAKE:
- case MONS_SKELETON_LARGE:
- case MONS_SKELETON_SMALL:
- case MONS_ZOMBIE_LARGE:
- case MONS_ZOMBIE_SMALL:
- case MONS_SIMULACRUM_SMALL:
- case MONS_SIMULACRUM_LARGE:
return (true);
default:
return (false);