From be396d1e316e9ebc8c76505fed695c7f3bd1fd06 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 16 Jul 2007 21:51:37 +0000 Subject: Some more vampire tweaks, mostly concerning food. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1884 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/delay.cc | 8 ++++-- crawl-ref/source/food.cc | 66 +++++++++++++++++++++++++++++++++++++++++--- crawl-ref/source/it_use2.cc | 3 +- crawl-ref/source/transfor.cc | 2 +- 4 files changed, 70 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index fc5b8576ca..e35f1c82b8 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -567,9 +567,13 @@ static void finish_delay(const delay_queue_item &delay) || you.mutation[MUT_FANGS] == 3) ? "ripping" : "chopping"); - if (you.species == SP_VAMPIRE) + if (you.species == SP_VAMPIRE && (!you.duration[DUR_PRAYER] + || you.religion != GOD_MAKHLEB && you.religion != GOD_TROG + && you.religion != GOD_OKAWARU && you.religion != GOD_BEOGH + && you.religion != GOD_LUGONU)) + { mpr("What a waste."); - + } turn_corpse_into_chunks( mitm[ delay.parm1 ] ); if (you.duration[DUR_BERSERKER] && you.berserk_penalty != NO_BERSERK_PENALTY) diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 9cb8736775..17e47e0f25 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -1214,7 +1214,8 @@ bool can_ingest(int what_isit, int kindof_thing, bool suppress_msg, bool reqid, if (you.species == SP_VAMPIRE) { - if (what_isit == OBJ_CORPSES && kindof_thing == CORPSE_BODY) + if (what_isit == OBJ_CORPSES && kindof_thing == CORPSE_BODY + || what_isit == OBJ_POTIONS && kindof_thing == POT_BLOOD) { return (true); } @@ -1242,6 +1243,13 @@ bool can_ingest(int what_isit, int kindof_thing, bool suppress_msg, bool reqid, switch (what_isit) { case OBJ_FOOD: + if (you.species == SP_VAMPIRE) + { + if (!suppress_msg) + mpr("Blech - you need blood!"); + return false; + } + switch (kindof_thing) { case FOOD_BREAD_RATION: @@ -1292,11 +1300,61 @@ bool can_ingest(int what_isit, int kindof_thing, bool suppress_msg, bool reqid, } break; + case OBJ_CORPSES: + if (you.species == SP_VAMPIRE) + { + if (kindof_thing == CORPSE_BODY) + return true; + else + { + if (!suppress_msg) + mpr("Blech - you need blood!"); + return false; + } + } + return false; + + case OBJ_POTIONS: // called by lua + if (get_ident_type(OBJ_POTIONS, kindof_thing) != ID_KNOWN_TYPE) + return true; + switch (kindof_thing) + { + case POT_BLOOD: + if (ur_herbivorous) + { + if (!suppress_msg) + mpr("Urks, you're a herbivore!"); + return false; + } + return true; + case POT_WATER: + if (you.species == SP_VAMPIRE) + { + if (!suppress_msg) + mpr("Blech - you need blood!"); + return false; + } + return true; + case POT_PORRIDGE: + if (you.species == SP_VAMPIRE) + { + if (!suppress_msg) + mpr("Blech - you need blood!"); + return false; + } + else if (ur_carnivorous) + { + if (!suppress_msg) + mpr("Sorry, you're a carnivore."); + return false; + } + default: + return true; + } + // other object types are set to return false for now until // someone wants to recode the eating code to permit consumption - // of things other than just food -- corpses first, then more - // exotic stuff later would be good to explore - 13mar2000 {dlb} - case OBJ_CORPSES: + // of things other than just food default: return (false); } diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index 87bfe44cff..5fe6cb1c96 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -230,9 +230,8 @@ bool potion_effect( potion_type pot_eff, int pow ) you.duration[DUR_BACKLIGHT] = 0; break; - // carnivore check here? {dlb} case POT_PORRIDGE: // oatmeal - always gluggy white/grey? - if (you.species == SP_VAMPIRE) + if (you.species == SP_VAMPIRE || you.mutation[MUT_CARNIVOROUS] == 3) { mpr("Blech - that potion was really gluggy!"); break; diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc index 3846120be5..cb69bfb31b 100644 --- a/crawl-ref/source/transfor.cc +++ b/crawl-ref/source/transfor.cc @@ -231,7 +231,7 @@ bool transform(int pow, transformation_type which_trans) modify_stat( STAT_STRENGTH, -5, true ); you.symbol = 'b'; - you.colour = (you.species == SP_VAMPIRE) ? BLACK : DARKGREY; + you.colour = DARKGREY; return (true); case TRAN_ICE_BEAST: // also AC +3, cold +3, fire -1, pois +1 -- cgit v1.2.3-54-g00ecf