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>2008-03-13 23:05:12 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-13 23:05:12 +0000
commitf01463de3abf61a8c3057b7aa70841e000cf55f4 (patch)
treefdfd3e692097c5a6ce0531a33cd591bd7655367c /crawl-ref/source/food.cc
parent2f4c72e5d1f2a84ddc6ac24b3b4628edc4e43dc3 (diff)
downloadcrawl-ref-f01463de3abf61a8c3057b7aa70841e000cf55f4.tar.gz
crawl-ref-f01463de3abf61a8c3057b7aa70841e000cf55f4.zip
Overhauled potions of blood and vampires.
1.) Vampires can only suck blood from creatures with M_COLD_BLOOD or M_WARM_BLOOD set (no insects anymore!) These restrictions are the same for blood spatter. Also, the monster's corpse must be of type contaminated (e.g. gnoll) or clean. Everything will be rejected. 2.) At xl 6 vampires gain the ability to create potions of blood from butchered corpses. The delay is the same as for butchering, and they also need a butchering tool (since I now think fangs don't really cut it); only the messaging is different, and the result, of course. If the monster doesn't meet the restrictions in (1), the corpse gets butchered instead (important when there are necromancers roaming about) and the resulting chunks don't get the THROWN flag set because vampires are unlikely to want to pick them up. 3.) Potions of blood can turn bad. They last about 1200 turns which is a rather long time, though of course not infinite. Potions created from corpses take the corpse age into account. From age 199 downwards potions of blood are described as "congealed blood". The effect when quaffing is entirely the same, it's just a warning that the potion will soon disappear. I've moved the potion descriptions over into item.plus, so that I could use item.special for the timer to allow for easy comparison in update_corpses() etc. Ideally each stack of potions of blood would have a props vector attached (similarly to decks) with the timeout turns stored in order oldest to newest, so that you'd always drink the oldest potion first, and if a potion was too old it (and it's time value) would just drop out of the stack. Since I haven't got this to work yet, instead the weighted average age of two substacks is calculated and used for the combined stack. Congealed (age < 200) and comparatively fresh (age >= 200) potions of blood will never stack. As suggested in FR 191314, !blood are a now an additional power source for Sublimation of Blood, and the used potion turns into decay. And speaking of decay, I've modified the mummy curse to only affect a substack if the to-be-decayed potions are blood because I think losing your food source that way would be the equivalent of spores destroying all your food at the same time. I think that's it; might still be buggy though I *did* test with some vampires, both wiz-mode and not, and because of the special -> plus change for potions, existing potions will now all look alike (clear potions). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3626 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r--crawl-ref/source/food.cc30
1 files changed, 22 insertions, 8 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 92d8f42d84..d3bd27cc73 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -221,7 +221,10 @@ bool butchery(int which_corpse)
static_cast<transformation_type>(you.attribute[ATTR_TRANSFORMATION]);
// Xom probably likes this, occasionally
- bool teeth_butcher = (you.mutation[MUT_FANGS] == 3);
+ // Vampires fangs are optimised for biting, not for tearing flesh.
+ // Other species with this mutation still might benefit from this.
+ bool teeth_butcher = (you.mutation[MUT_FANGS] == 3
+ && you.species != SP_VAMPIRE);
bool barehand_butcher = (transform_can_butcher_barehanded(transform)
|| you.has_claws()) && you.equip[EQ_GLOVES] == -1;
@@ -287,7 +290,9 @@ bool butchery(int which_corpse)
// if there are several corpses on the square.
if ( num_corpses == 0 )
{
- mpr("There isn't anything to butcher here.");
+ mprf("There isn't anything to %s here.",
+ you.species == SP_VAMPIRE && you.experience_level > 5 ? "bottle"
+ : "butcher");
return false;
}
else if ( !prechosen
@@ -301,13 +306,17 @@ bool butchery(int which_corpse)
continue;
// offer the possibility of butchering
- mprf("Butcher %s? [y/n/q/c]", mitm[o].name(DESC_NOCAP_A).c_str());
+ mprf("%s %s? [y/n/q/c]", can_bottle_blood_from_corpse(mitm[o].plus)?
+ "Bottle" : "Butcher",
+ mitm[o].name(DESC_NOCAP_A).c_str());
+
// possible results:
// 0 - cancel all butchery (quit)
// 1 - say no to this butchery, continue prompting
// 2 - OK this butchery
// Yes, this is a hack because it's too annoying to adapt
// yesnoquit() to this purpose.
+
int result = 100;
while (result == 100)
{
@@ -443,7 +452,9 @@ bool butchery(int which_corpse)
if (canceled_butcher)
canned_msg(MSG_OK);
else
- mpr("There isn't anything else to butcher here.");
+ mprf("There isn't anything else to %s here.",
+ you.species == SP_VAMPIRE && you.experience_level >= 6 ?
+ "bottle" : "butcher");
return false;
} // end butchery()
@@ -1433,6 +1444,7 @@ bool can_ingest(int what_isit, int kindof_thing, bool suppress_msg, bool reqid,
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:
@@ -1613,18 +1625,20 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk)
return (this_chunk_effect);
} // end determine_chunk_effect()
-static bool vampire_consume_corpse(const int mons_type, int max_chunks,
+static bool vampire_consume_corpse(const int mons_type, const int max_chunks,
const int chunk_type, const bool rotten)
{
- if (chunk_type == CE_HCL)
+ if (!mons_has_blood(mons_type))
{
mpr( "There is no blood in this body!" );
return false;
}
// This is the exact formula of corpse nutrition for chunk lovers
- max_chunks = 1 + random2(max_chunks);
- int mass = CHUNK_BASE_NUTRITION * max_chunks;
+ int chunk_amount = 1 + random2(max_chunks);
+ chunk_amount = stepdown_value( chunk_amount, 4, 4, 12, 12 );
+ int mass = CHUNK_BASE_NUTRITION * chunk_amount;
+
int food_value = 0, hp_amt = 0, mp_amt = 0;
if (rotten)