summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-14 16:33:14 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-14 16:33:14 +0000
commitbbbd701b88b0274d7f14d0957828ad4342648135 (patch)
treede63191fc5e12155f5260708ca2dd0fc3a9d15fa /crawl-ref/source/item_use.cc
parent94ceb87517474ac372a41a52a3448104f51435bf (diff)
downloadcrawl-ref-bbbd701b88b0274d7f14d0957828ad4342648135.tar.gz
crawl-ref-bbbd701b88b0274d7f14d0957828ad4342648135.zip
Overhaul blood potions to work completely differently.
Instead of storing age in item.special they now use a dynamic vector (item.props, like decks do), so that a stack of potions doesn't have to coagulate all at once. Rather than counting down the timers every 20 turns or so, the time-out turn is calculated at creation, and comparison is done against the current turncount. Any action changing a stack (quaffing, firing, Evaporate, picking up, dropping) will always extract the oldest values from the vector, which is likely to be what the player wants. Blood potions now last about 2000 turns (a bit more if drawn from fresh corpses), and coagulate 500 turns before rotting away. I ran a lot of tests in wiz mode and out, but of course there may still be problems. I've added methods to calculate the new timers from old style age counters (item.special), but I'm not sure that they actually work... Oh well... if worst comes to worst, this commit breaks saves. Also: * vampires are not susceptible to fire anymore when Bloodless * make tile_plant_colour also apply for remembered plants out of LOS * fix 1941759: buggy orc dialogue git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4228 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 482291666d..ed787ab125 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1755,6 +1755,17 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
item.quantity = 1;
item.slot = index_to_letter(item.link);
origin_set_unknown(item);
+ if (item.base_type == OBJ_POTIONS
+ && (item.sub_type == POT_BLOOD
+ || item.sub_type == POT_BLOOD_COAGULATED)
+ && you.inv[throw_2].quantity > 1)
+ {
+ // initialize thrown potion with oldest potion in stack
+ long val = remove_oldest_blood_potion(you.inv[throw_2]);
+ val -= you.num_turns;
+ item.props.clear();
+ init_stack_blood_potions(item, val);
+ }
if (you.duration[DUR_CONF])
{
@@ -3497,6 +3508,12 @@ void drink( int slot )
xom_is_stimulated(255);
}
+ if (you.inv[item_slot].sub_type == POT_BLOOD
+ || you.inv[item_slot].sub_type == POT_BLOOD_COAGULATED)
+ {
+ // always drink oldest potion
+ remove_oldest_blood_potion(you.inv[item_slot]);
+ }
dec_inv_item_quantity( item_slot, 1 );
you.turn_is_over = true;