From b578218b05ae153f3425278bedbb8efca48e259e Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 28 Apr 2008 18:57:20 +0000 Subject: Add various undead-related fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4754 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/debug.cc | 6 ++---- crawl-ref/source/describe.cc | 12 +++++++++--- crawl-ref/source/item_use.cc | 5 ++--- crawl-ref/source/newgame.cc | 7 ++++--- crawl-ref/source/newgame.h | 2 ++ crawl-ref/source/player.cc | 2 +- 6 files changed, 20 insertions(+), 14 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 98337ae775..82e3b4e7ba 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -284,10 +284,8 @@ void debug_change_species( void ) } you.species = sp; - you.is_undead = ((you.species == SP_MUMMY) ? US_UNDEAD : - (you.species == SP_GHOUL) ? US_HUNGRY_DEAD : - (you.species == SP_VAMPIRE) ? US_SEMI_UNDEAD - : US_ALIVE); + you.is_undead = get_undead_state(sp); + redraw_screen(); } } diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 1e993a65bd..754f1b6d1a 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1626,11 +1626,17 @@ std::string get_item_description( const item_def &item, bool verbose, { if (player_mutation_level(MUT_SAPROVOROUS) == 3) description << "It looks nice and ripe."; - else if (you.is_undead != US_UNDEAD) + else { description << "In fact, it is " - "rotting away before your eyes. " - "Eating it would probably be unwise."; + "rotting away before your eyes."; + + if (you.is_undead != US_UNDEAD + && you.species != SP_VAMPIRE) + { + description << " Eating it would " + "probably be unwise."; + } } } else if (player_mutation_level(MUT_SAPROVOROUS) < 3) diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 82b868ee96..287662eaf0 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -612,7 +612,7 @@ void wield_effects(int item_wield_2, bool showMsgs) break; case SPWPN_VAMPIRICISM: - if (!you.is_undead) + if (you.is_undead != US_UNDEAD) mpr("You feel a strange hunger."); else mpr("You feel strangely empty."); @@ -668,8 +668,7 @@ void wield_effects(int item_wield_2, bool showMsgs) break; case SPWPN_VAMPIRES_TOOTH: - // mummies cannot smell, and do not hunger {dlb} - if (!you.is_undead) + if (you.is_undead != US_UNDEAD) { mpr("You feel a strange hunger, and smell blood on the " "air..."); diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index 1bab685ef9..07880814c4 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -1090,7 +1090,7 @@ static bool _species_is_undead( const species_type speci ) return (speci == SP_MUMMY || speci == SP_GHOUL || speci == SP_VAMPIRE); } -static undead_state_type _get_undead_state(const species_type sp) +undead_state_type get_undead_state(const species_type sp) { switch(sp) { @@ -1208,7 +1208,7 @@ game_start: _species_stat_init( you.species ); // must be down here {dlb} - you.is_undead = _get_undead_state(you.species); + you.is_undead = get_undead_state(you.species); // before we get into the inventory init, set light radius based // on species vision. currently, all species see out to 8 squares. @@ -2737,8 +2737,9 @@ static void _give_random_potion( int slot ) you.inv[ slot ].plus = 0; you.inv[ slot ].plus2 = 0; + // no Berserk for undead other than vampires int temp_rand = 8; - if (you.is_undead) // no Berserk for undeads + if (you.is_undead && you.species != SP_VAMPIRE) temp_rand--; switch (random2(temp_rand)) diff --git a/crawl-ref/source/newgame.h b/crawl-ref/source/newgame.h index f683e2570c..eca56fac60 100644 --- a/crawl-ref/source/newgame.h +++ b/crawl-ref/source/newgame.h @@ -35,6 +35,8 @@ int get_species_by_name( const char *name ); int get_class_by_abbrev( const char *abbrev ); int get_class_by_name( const char *name ); +undead_state_type get_undead_state(const species_type sp); + /* *********************************************************************** * called from: acr * *********************************************************************** */ diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 7e3fd1394a..973b73f3f0 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -3648,7 +3648,7 @@ static const char * _get_rotting_how() void display_char_status() { - if (you.species == SP_VAMPIRE && you.hunger_state == HS_ENGORGED) + if (you.is_undead == US_SEMI_UNDEAD && you.hunger_state == HS_ENGORGED) mpr( "You feel almost alive." ); else if (you.is_undead) mpr( "You are undead." ); -- cgit v1.2.3-54-g00ecf