summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/food.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-16 21:51:37 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-16 21:51:37 +0000
commitbe396d1e316e9ebc8c76505fed695c7f3bd1fd06 (patch)
tree86c47bf891b8a71226287284b44f8613a2d384c7 /crawl-ref/source/food.cc
parent8874ed0e6eec7af7f202e1b7f9da8b1c95a7fbb0 (diff)
downloadcrawl-ref-be396d1e316e9ebc8c76505fed695c7f3bd1fd06.tar.gz
crawl-ref-be396d1e316e9ebc8c76505fed695c7f3bd1fd06.zip
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
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r--crawl-ref/source/food.cc66
1 files changed, 62 insertions, 4 deletions
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);
}