diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-05 13:57:26 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-05 13:57:26 +0000 |
commit | e175b036711c620e951a32a549f7a6c7d1a05009 (patch) | |
tree | 7307a5cae319e741fd94884be82a7eb0876ddef2 /crawl-ref/source | |
parent | 5278d194ce1470f55ea9bdd2827d3e1d3de500b7 (diff) | |
download | crawl-ref-e175b036711c620e951a32a549f7a6c7d1a05009.tar.gz crawl-ref-e175b036711c620e951a32a549f7a6c7d1a05009.zip |
Hydras raised from the dead now get the same number of heads as they had when alive.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4876 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/defines.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/spells2.cc | 8 |
3 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/defines.h b/crawl-ref/source/defines.h index d899dda451..4202294609 100644 --- a/crawl-ref/source/defines.h +++ b/crawl-ref/source/defines.h @@ -305,6 +305,8 @@ const int LABYRINTH_BORDER = 4; #define MIN(x, y) MINIMUM(x, y) #define MAX(x,y) (((x) > (y)) ? (x) : (y)) +const char * const MONSTER_NUMBER = "monster-number"; + // Synthetic keys: #define KEY_MACRO_MORE_PROTECT -10 #define KEY_MACRO_DISABLE_MORE -1 diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index ec4f265c00..0f44f0c8c8 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -336,6 +336,7 @@ static void _place_monster_corpse(const monsters *monster) mitm[o].special = 210; // rot time mitm[o].colour = mons_class_colour(corpse_class); mitm[o].quantity = 1; + mitm[o].props[MONSTER_NUMBER] = short(monster->number); if (mitm[o].colour == BLACK) mitm[o].colour = monster->colour; diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 7c19f33153..3044c39009 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -455,11 +455,17 @@ static int raise_corpse( int corps, int corx, int cory, type = MONS_SKELETON_LARGE; } + const int number = + mitm[corps].props.exists(MONSTER_NUMBER) + ? mitm[corps].props[MONSTER_NUMBER].get_short() + : 0; + create_monster( mgen_data( type, corps_beh, 0, coord_def(corx, cory), corps_hit, - 0, static_cast<monster_type>(mitm[corps].plus))); + 0, static_cast<monster_type>(mitm[corps].plus), + number)); destroy_item(corps); } |