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>2009-07-20 21:18:13 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-20 21:18:13 +0000
commita28741dd2b29142210f64325cb2cb87c806d3409 (patch)
tree611f028941af67538525e535cb3c4f30cb058bf4 /crawl-ref/source/item_use.cc
parentc917efe2ecd38f449619d7b25160c8053b81e108 (diff)
downloadcrawl-ref-a28741dd2b29142210f64325cb2cb87c806d3409.tar.gz
crawl-ref-a28741dd2b29142210f64325cb2cb87c806d3409.zip
Fix 2822832: temporary brands not being removed when thrown with LRET_FUMBLED
plus: thrown weapon permabrand being removed when DUR_WEAPON_BRAND is active plus: double messaging of "You are now empty-handed." Fix 2810517: Added a pre-ability requirements check that handles Lugonu's enter/exit abyss, berserking, recite, breath attacks and some more. If the requirements aren't met, the check fails before the success check, thus no turn is wasted. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10360 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 9266f445cd..5a0ed0af1e 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -224,7 +224,7 @@ static bool _valid_weapon_swap(const item_def &item)
// If force is true, don't check weapon inscriptions.
// (Assuming the player was already prompted for that.)
bool wield_weapon(bool auto_wield, int slot, bool show_weff_messages,
- bool force)
+ bool force, bool show_unwield_msg)
{
if (inv_count() < 1)
{
@@ -304,7 +304,8 @@ bool wield_weapon(bool auto_wield, int slot, bool show_weff_messages,
if (!unwield_item(show_weff_messages))
return (false);
- canned_msg(MSG_EMPTY_HANDED);
+ if (show_unwield_msg)
+ canned_msg(MSG_EMPTY_HANDED);
// Switching to bare hands is extra fast.
you.turn_is_over = true;
@@ -2220,8 +2221,11 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
// Items that get a temporary brand from a player spell lose the
// brand as soon as the player lets go of the item. Can't call
// unwield_item() yet since the beam might get canceled.
- if (you.duration[DUR_WEAPON_BRAND] && projected == LRET_THROWN)
- set_item_ego_type( item, OBJ_WEAPONS, SPWPN_NORMAL );
+ if (you.duration[DUR_WEAPON_BRAND] && projected != LRET_LAUNCHED
+ && throw_2 == you.equip[EQ_WEAPON])
+ {
+ set_item_ego_type(item, OBJ_WEAPONS, SPWPN_NORMAL);
+ }
std::string ammo_name;
setup_missile_beam(&you, pbolt, item, ammo_name, returning);
@@ -2307,7 +2311,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus,
bool unwielded = false;
if (throw_2 == you.equip[EQ_WEAPON] && thrown.quantity == 1)
{
- if (!wield_weapon(true, PROMPT_GOT_SPECIAL))
+ if (!wield_weapon(true, PROMPT_GOT_SPECIAL, true, false, false))
return (false);
unwielded = true;