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-07-17 07:34:30 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-17 07:34:30 +0000
commitd05ad02e6ca609c768a843eb62beda9f602e821a (patch)
treedcbe30e255651b4502aee6a2e62779b5d68d7635 /crawl-ref/source/food.cc
parente14b5260df1fa0e9400a1d0c3472f5d8dcc97e89 (diff)
downloadcrawl-ref-d05ad02e6ca609c768a843eb62beda9f602e821a.tar.gz
crawl-ref-d05ad02e6ca609c768a843eb62beda9f602e821a.zip
Fix 2018458: Portal projectile not handling branded ammo or nets.
Fix 2019803: cold/fire destroying all susceptible items on the floor Change "You don't eat raw eat!" to "Blech - you need greens!" Also: Experimentally change sacrifices to take only 1 turn again, no matter how many corpses are actually sacrificed during this turn. Allow chained 'yes' and 'no' answers during the butchering prompt, so that 'cccccc' is now really functionally identical to 'ca'. In another return to previous handling, always get in that first turn of butchering for a single corpse (or the first corpse in butcher chains), so it takes a maximum of 3 turns rather than 4. Same for draining corpses as a Vampire: when draining corpses you get at least a little bit of nutrition out of it before you are interrupted. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6579 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r--crawl-ref/source/food.cc46
1 files changed, 33 insertions, 13 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 44f39bdb5a..8e876e67f7 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -314,7 +314,8 @@ static bool _prepare_butchery(bool can_butcher, bool removed_gloves,
return (true);
}
-static bool _butcher_corpse(int corpse_id, bool force_butcher = false)
+static bool _butcher_corpse(int corpse_id, bool first_corpse = true,
+ bool force_butcher = false)
{
ASSERT(corpse_id != -1);
@@ -324,7 +325,7 @@ static bool _butcher_corpse(int corpse_id, bool force_butcher = false)
if (can_sac && !rotten)
{
- start_delay(DELAY_OFFER_CORPSE, 1, corpse_id);
+ start_delay(DELAY_OFFER_CORPSE, 0, corpse_id);
}
else
{
@@ -336,7 +337,7 @@ static bool _butcher_corpse(int corpse_id, bool force_butcher = false)
you.religion);
}
- int work_req = 4 - mitm[corpse_id].plus2;
+ int work_req = 4 - mitm[corpse_id].plus2 - (first_corpse ? 1 : 0);
if (work_req < 0)
work_req = 0;
@@ -546,7 +547,7 @@ bool butchery(int which_corpse)
{
return (false);
}
- success = _butcher_corpse(corpse_id);
+ success = _butcher_corpse(corpse_id, true);
_terminate_butchery(wpn_switch, removed_gloves, old_weapon, old_gloves);
// Remind player of corpses in pack that could be butchered or
@@ -561,6 +562,8 @@ bool butchery(int which_corpse)
bool bottle_all = false; // for Vampires
bool force_butcher = false;
bool repeat_prompt = false;
+ bool did_weap_swap = false;
+ bool first_corpse = true;
int keyin;
for (stack_iterator si(you.pos()); si; ++si)
{
@@ -611,10 +614,15 @@ bool butchery(int which_corpse)
case 'c':
case 'd':
case 'a':
- if (!_prepare_butchery(can_butcher, removed_gloves,
- wpn_switch, butcher_tool))
+ if (!did_weap_swap)
{
- return (false);
+ if (_prepare_butchery(can_butcher, removed_gloves,
+ wpn_switch, butcher_tool))
+ {
+ did_weap_swap = true;
+ }
+ else
+ return (false);
}
corpse_id = si->index();
@@ -654,11 +662,15 @@ bool butchery(int which_corpse)
if (corpse_id != -1)
{
- if (_butcher_corpse(corpse_id, force_butcher || butcher_all))
+ if (_butcher_corpse(corpse_id, first_corpse,
+ force_butcher || butcher_all))
+ {
success = true;
+ first_corpse = false;
+ }
- if (!butcher_all && !bottle_all)
- break;
+// if (!butcher_all && !bottle_all)
+// break;
}
}
@@ -2093,7 +2105,7 @@ bool can_ingest(int what_isit, int kindof_thing, bool suppress_msg, bool reqid,
if (ur_herbivorous)
{
if (!suppress_msg)
- mpr("You can't eat raw meat!");
+ mpr("Blech - you need greens!");
return (false);
}
else if (kindof_thing == FOOD_CHUNK)
@@ -2328,8 +2340,16 @@ static bool _vampire_consume_corpse(const int slot, bool invent)
int chunk_amount = 1 + max_chunks/2;
chunk_amount = stepdown_value( chunk_amount, 4, 4, 12, 12 );
- start_delay( DELAY_FEED_VAMPIRE, 1 + chunk_amount/2,
- (int) invent, slot );
+ // Get some nutrition right away, in case we're interrupted.
+ // (-1 for the starting message.)
+ vampire_nutrition_per_turn(corpse, -1);
+ if (chunk_amount/2 > 0)
+ {
+ // The draining delay doesn't have a start action, and we only need
+ // the continue/finish messages if it takes longer than 1 turn.
+ start_delay( DELAY_FEED_VAMPIRE, chunk_amount/2,
+ (int) invent, slot );
+ }
return (true);
}