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-17 16:30:41 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-17 16:30:41 +0000
commit7ecb5a3d3c6153a073477452679943612ee25d61 (patch)
treef47dedee5986df56b25e4c2a419af8137a4d8c0f /crawl-ref/source/food.cc
parenteaf527f9e3087d3093b6acb2cc18c3636bb9b6b2 (diff)
downloadcrawl-ref-7ecb5a3d3c6153a073477452679943612ee25d61.tar.gz
crawl-ref-7ecb5a3d3c6153a073477452679943612ee25d61.zip
More vampire tweaks, mostly concerning fighting and
feeding issues. Oh, and they're poison resistant now. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1886 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r--crawl-ref/source/food.cc50
1 files changed, 39 insertions, 11 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 17e47e0f25..d2d5e1750a 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -617,10 +617,12 @@ void eat_from_inventory(int which_inventory_slot)
if (!vampire_consume_corpse(mons_type, mass, chunk_type, rotten))
return;
- if (!mons_skeleton( mons_type )) {
+ if (!mons_skeleton( mons_type ))
+ {
dec_inv_item_quantity( which_inventory_slot, 1 );
}
- else {
+ else
+ {
you.inv[which_inventory_slot].sub_type = CORPSE_SKELETON;
you.inv[which_inventory_slot].special = 90;
you.inv[which_inventory_slot].colour = LIGHTGREY;
@@ -660,10 +662,12 @@ void eat_floor_item(int item_link)
if (!vampire_consume_corpse(mons_type, mass, chunk_type, rotten))
return;
- if (!mons_skeleton( mons_type )) {
+ if (!mons_skeleton( mons_type ))
+ {
dec_mitm_item_quantity( item_link, 1 );
}
- else {
+ else
+ {
mitm[item_link].sub_type = CORPSE_SKELETON;
mitm[item_link].special = 90;
mitm[item_link].colour = LIGHTGREY;
@@ -1386,7 +1390,7 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk)
case CE_POISONOUS:
if (you.species == SP_GHOUL
|| you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH
- || poison_resistance_level > 0)
+ || poison_resistance_level > 0 && you.species != SP_VAMPIRE)
{
this_chunk_effect = CE_CLEAN;
}
@@ -1496,17 +1500,21 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk)
} // end determine_chunk_effect()
bool vampire_consume_corpse(int mons_type, int mass,
- int chunk_type, bool rotten) {
+ int chunk_type, bool rotten)
+{
int food_value = 0;
- if (chunk_type == CE_HCL) {
+ if (chunk_type == CE_HCL)
+ {
mpr( "There is no blood in this body!" );
return false;
}
- else if (!rotten) {
+ else if (!rotten)
+ {
inc_hp(1, false);
- switch (mons_type) {
+ switch (mons_type)
+ {
case MONS_HUMAN:
food_value = mass + random2avg(you.experience_level * 10, 2);
mpr( "This warm blood tastes really delicious!" );
@@ -1520,18 +1528,38 @@ bool vampire_consume_corpse(int mons_type, int mass,
break;
default:
+ switch (chunk_type)
+ {
+ case CE_CLEAN:
food_value = mass;
mpr( "This warm blood tastes delicious!" );
break;
+ case CE_CONTAMINATED:
+ food_value = mass / (random2(3) + 1);
+ mpr( "Somehow that blood was not very filling!" );
+ break;
+ case CE_POISONOUS:
+ food_value = random2(mass) - mass/2;
+ mpr( "Blech - that blood tastes nasty!" );
+ break;
+ case CE_MUTAGEN_RANDOM:
+ food_value = random2(mass);
+ mpr( "That blood tastes really weird!" );
+ mutate(RANDOM_MUTATION);
+ xom_is_stimulated(100);
+ break;
+ }
}
did_god_conduct(DID_DRINK_BLOOD, 8);
}
- else if (wearing_amulet(AMU_THE_GOURMAND)){
+ else if (wearing_amulet(AMU_THE_GOURMAND))
+ {
food_value = mass/3 + random2(you.experience_level * 5);
mpr("Slurps.");
did_god_conduct(DID_DRINK_BLOOD, 8);
}
- else {
+ else
+ {
mpr("It's not fresh enough.");
return false;
}