diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-08 19:13:30 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-08 19:13:30 +0000 |
commit | 06c5d3d75459c2f78297095550311e8aac37af80 (patch) | |
tree | 79b70d65b32e70caabbf2a25e90fee98acdefdda /crawl-ref/source/it_use2.cc | |
parent | 9a20cf0a34b9caec2ff9a5c3708a88fb84c80496 (diff) | |
download | crawl-ref-06c5d3d75459c2f78297095550311e8aac37af80.tar.gz crawl-ref-06c5d3d75459c2f78297095550311e8aac37af80.zip |
Clean up nutrition-related functions a bit, and handle non-vampires'
nutrition from blood potions more consistently.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8983 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/it_use2.cc')
-rw-r--r-- | crawl-ref/source/it_use2.cc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index f3625fae6b..b6db27b48a 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -80,39 +80,43 @@ bool potion_effect(potion_type pot_eff, int pow, bool drank_it, bool was_known) } break; - case POT_BLOOD: - case POT_BLOOD_COAGULATED: + case POT_BLOOD: + case POT_BLOOD_COAGULATED: if (you.species == SP_VAMPIRE) { // No healing anymore! (jpeg) - int value = 800; if (pot_eff == POT_BLOOD) { mpr("Yummy - fresh blood!"); value += 200; } - else // coagulated + else // Coagulated. mpr("This tastes delicious!"); lessen_hunger(value, true); } else { - if (you.omnivorous() || player_mutation_level(MUT_CARNIVOROUS)) + const bool ur_herbivorous = + player_mutation_level(MUT_HERBIVOROUS) == 3; + + int nutrition = apply_herbivore_nutrition_effects(200); + + if (!ur_herbivorous && player_likes_chunks()) { // Likes it. mpr("This tastes like blood."); - lessen_hunger(200, true); + lessen_hunger(nutrition, true); } else { mpr("Blech - this tastes like blood!"); - if (!player_mutation_level(MUT_HERBIVOROUS) && one_chance_in(3)) - lessen_hunger(100, true); + if (!ur_herbivorous && one_chance_in(3)) + lessen_hunger(nutrition, true); else { - disease_player( 50 + random2(100) ); + disease_player(50 + random2(100)); xom_is_stimulated(32); } } @@ -126,7 +130,7 @@ bool potion_effect(potion_type pot_eff, int pow, bool drank_it, bool was_known) case POT_MIGHT: { - const bool were_mighty = (you.duration[DUR_MIGHT] > 0); + const bool were_mighty = you.duration[DUR_MIGHT] > 0; mprf(MSGCH_DURATION, "You feel %s all of a sudden.", were_mighty ? "mightier" : "very mighty"); |