summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-05 08:39:20 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-05 08:39:20 +0000
commit3423bbab5a0f024eeafffe6b8260c8c088647db1 (patch)
tree7ac6d73449b874aba363c80d57a097833bcf7613 /crawl-ref/source/items.cc
parent166e51b5cc6e35ec1bea7dd24e9e6ae549ac3dde (diff)
downloadcrawl-ref-3423bbab5a0f024eeafffe6b8260c8c088647db1.tar.gz
crawl-ref-3423bbab5a0f024eeafffe6b8260c8c088647db1.zip
First attempt at making vampire feeding interruptible. It doesn't work
yet (I had "You stop feeding" followed by "You continue feeding" including full effects), but it's probably better to commit now anyway. Known potions of blood or porridge cannot be quaffed when engorged (alive). Also clean up blood potions check. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4871 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc23
1 files changed, 6 insertions, 17 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 66823ea7c1..be4702016d 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1533,12 +1533,9 @@ int move_item_to_player( int obj, int quant_got, bool quiet )
you.inv[m].inscription = mitm[obj].inscription;
}
- if (mitm[obj].base_type == OBJ_POTIONS
- && (mitm[obj].sub_type == POT_BLOOD
- || mitm[obj].sub_type == POT_BLOOD_COAGULATED))
- {
+ if (is_blood_potion(mitm[obj]))
pick_up_blood_potions_stack(mitm[obj], quant_got);
- }
+
inc_inv_item_quantity( m, quant_got );
dec_mitm_item_quantity( obj, quant_got );
burden_change();
@@ -1592,9 +1589,7 @@ int move_item_to_player( int obj, int quant_got, bool quiet )
check_note_item(item);
item.quantity = quant_got;
- if (mitm[obj].base_type == OBJ_POTIONS
- && (mitm[obj].sub_type == POT_BLOOD
- || mitm[obj].sub_type == POT_BLOOD_COAGULATED))
+ if (is_blood_potion(mitm[obj]))
{
if (quant_got != mitm[obj].quantity)
{
@@ -1759,9 +1754,7 @@ bool copy_item_to_grid( const item_def &item, int x_plos, int y_plos,
{
inc_mitm_item_quantity( i, quant_drop );
- if (item.base_type == OBJ_POTIONS
- && (item.sub_type == POT_BLOOD
- || item.sub_type == POT_BLOOD_COAGULATED))
+ if (is_blood_potion(item))
{
item_def help = item;
drop_blood_potions_stack(help, quant_drop, x_plos, y_plos);
@@ -1799,9 +1792,7 @@ bool copy_item_to_grid( const item_def &item, int x_plos, int y_plos,
}
move_item_to_grid( &new_item, x_plos, y_plos );
- if (item.base_type == OBJ_POTIONS
- && (item.sub_type == POT_BLOOD
- || item.sub_type == POT_BLOOD_COAGULATED)
+ if (is_blood_potion(item)
&& item.quantity != quant_drop) // partial drop only
{
// since only the oldest potions have been dropped,
@@ -1923,9 +1914,7 @@ bool drop_item( int item_dropped, int quant_drop, bool try_offer )
else if (strstr(you.inv[item_dropped].inscription.c_str(), "=s") != 0)
StashTrack.add_stash();
- if (you.inv[item_dropped].base_type == OBJ_POTIONS
- && (you.inv[item_dropped].sub_type == POT_BLOOD
- || you.inv[item_dropped].sub_type == POT_BLOOD_COAGULATED)
+ if (is_blood_potion(you.inv[item_dropped])
&& you.inv[item_dropped].quantity != quant_drop)
{
// oldest potions have been dropped