From d733df05e5309444cb83c028c0515467c87ae4c6 Mon Sep 17 00:00:00 2001 From: haranp Date: Thu, 13 Sep 2007 17:31:31 +0000 Subject: Changed unwield_item() to actually unwield the item, and to have it unwield your weapon rather than something arbitrary (I found no cases in the code where this wasn't what was wanted.) Implemented some of David's deck changes: - decks weigh half as much - names changed - Draw Card doesn't cost piety; cost upped to 2 MP - Nemelex card power bonus now applies even when not praying - Damnation can now banish extra targets (your own chance of banishment remains the same.) - Nemelex doesn't accept sacrificed decks. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2082 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/items.cc | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'crawl-ref/source/items.cc') diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index a4146a1475..ae6b7a94ea 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -242,12 +242,12 @@ bool dec_inv_item_quantity( int obj, int amount ) { if (you.equip[i] == obj) { - you.equip[i] = -1; if (i == EQ_WEAPON) { - unwield_item( obj ); + unwield_item(); canned_msg( MSG_EMPTY_HANDED ); } + you.equip[i] = -1; } } @@ -1670,8 +1670,7 @@ bool drop_item( int item_dropped, int quant_drop, bool try_offer ) // like temporary brands. -- bwr if (item_dropped == you.equip[EQ_WEAPON]) { - unwield_item(item_dropped); - you.equip[EQ_WEAPON] = -1; + unwield_item(); canned_msg( MSG_EMPTY_HANDED ); } @@ -2532,13 +2531,10 @@ void handle_time( long time_delta ) if (you.inv[i].base_type == OBJ_FOOD) { if (you.equip[EQ_WEAPON] == i) - { - unwield_item(you.equip[EQ_WEAPON]); - you.equip[EQ_WEAPON] = -1; - you.wield_change = true; - } + unwield_item(); - mpr( "Your equipment suddenly weighs less.", MSGCH_ROTTEN_MEAT ); + mpr("Your equipment suddenly weighs less.", MSGCH_ROTTEN_MEAT); + // FIXME should replace with a destroy_item call you.inv[i].quantity = 0; burden_change(); continue; @@ -2550,11 +2546,9 @@ void handle_time( long time_delta ) if (!mons_skeleton( you.inv[i].plus )) { if (you.equip[EQ_WEAPON] == i) - { - unwield_item(you.equip[EQ_WEAPON]); - you.equip[EQ_WEAPON] = -1; - } + unwield_item(); + // FIXME should replace with a destroy_item call you.inv[i].quantity = 0; burden_change(); continue; -- cgit v1.2.3-54-g00ecf