diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-16 09:52:35 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-16 09:52:35 +0000 |
commit | 18266441fdeec28e0eba1818726a2c41b2376aa4 (patch) | |
tree | 8e3e73051c422692bf925e1d98d82b11797c0fed /crawl-ref/source/food.cc | |
parent | 9775ec72ba0943333eb80d4274d9074741ab3cbb (diff) | |
download | crawl-ref-18266441fdeec28e0eba1818726a2c41b2376aa4.tar.gz crawl-ref-18266441fdeec28e0eba1818726a2c41b2376aa4.zip |
Fix the remaining (known) issues with butchering all corpses in a stash:
* You should now get the "not swapping back" warning also for sac sessions
and chained butchery.
* Vampires choosing (a)ll from a "Bottle this corpse?" prompt will only
attempt to bottle corpses that actually contain blood (so they no longer
will be autobutchering bloodless corpses in the stash).
Also changed Vampire spell hunger reduction to
Thirsty, Very Thirsty: 50%
Near Starving, Starving: None
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5075 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r-- | crawl-ref/source/food.cc | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 108d823b7b..83fb8b507b 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -271,7 +271,7 @@ static bool _prepare_butchery(bool can_butcher, bool barehand_butcher, return (true); } -static bool _butcher_corpse(int corpse_id) +static bool _butcher_corpse(int corpse_id, bool force_butcher = false) { ASSERT(corpse_id != -1); @@ -293,17 +293,19 @@ static bool _butcher_corpse(int corpse_id) you.religion); } - // If we didn't switch weapons, we get in one turn of butchery; - // otherwise the work has to happen in the delay. -// if (!wpn_switch && !removed_gloves) -// ++mitm[corpse_id].plus2; - int work_req = 4 - mitm[corpse_id].plus2; if (work_req < 0) work_req = 0; - start_delay(DELAY_BUTCHER, work_req, corpse_id, - mitm[corpse_id].special); + + delay_type dtype = DELAY_BUTCHER; + if (!force_butcher + && can_bottle_blood_from_corpse(mitm[corpse_id].plus)) + { + dtype = DELAY_BOTTLE_BLOOD; + } + + start_delay(dtype, work_req, corpse_id, mitm[corpse_id].special); } you.turn_is_over = true; @@ -438,6 +440,7 @@ bool butchery(int which_corpse) // Now pick what you want to butcher. This is only a problem // if there are several corpses on the square. bool butcher_all = false; + bool bottle_all = false; // for Vampires for (int o = igrd[you.x_pos][you.y_pos]; o != NON_ITEM; o = mitm[o].link) { if (mitm[o].base_type != OBJ_CORPSES @@ -446,7 +449,10 @@ bool butchery(int which_corpse) continue; } - if (butcher_all) + if (bottle_all && !can_bottle_blood_from_corpse(mitm[o].plus)) + continue; + + if (butcher_all || bottle_all) corpse_id = o; else { @@ -482,21 +488,26 @@ bool butchery(int which_corpse) corpse_id = o; if (result == 2) // (a)ll - butcher_all = true; + { + if (can_bottle_blood_from_corpse(mitm[o].plus)) + bottle_all = true; + else + butcher_all = true; + } } } if (corpse_id != -1) { - if (_butcher_corpse(corpse_id)) + if (_butcher_corpse(corpse_id, butcher_all)) success = true; - if (!butcher_all) + if (!butcher_all && !bottle_all) break; } } - if (!butcher_all && corpse_id == -1) + if (!butcher_all && !bottle_all && corpse_id == -1) { mprf("There isn't anything else to %s here.", you.species == SP_VAMPIRE && you.experience_level >= 6 ? |