From 2d1dc73ba81562198242670c328146d3f13695c6 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 3 Apr 2009 17:06:22 +0000 Subject: * Allow fleeing monster to push past higher ranked monsters of the same type. * Allow quivering of wielded missiles (stones for Sandblast etc.) and wielded weapons of returning if your throwing skill is > 0. * Add stairs/gates/shops to the 'V' command, mostly for the convenience of the easy travel feature. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9574 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/quiver.cc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/quiver.cc') diff --git a/crawl-ref/source/quiver.cc b/crawl-ref/source/quiver.cc index 12187347b1..315db5edcc 100644 --- a/crawl-ref/source/quiver.cc +++ b/crawl-ref/source/quiver.cc @@ -166,14 +166,19 @@ void choose_item_for_quiver() : "hand crossbow"); return; } - else if (slot == you.equip[EQ_WEAPON]) + else if (slot == you.equip[EQ_WEAPON] + && you.inv[slot].base_type == OBJ_WEAPONS + && (get_weapon_brand(you.inv[slot]) != SPWPN_RETURNING + || you.skills[SK_THROWING] == 0)) { - mpr("You can't quiver wielded items."); + // Don't quiver a wielded weapon unless it's a weapon of returning + // and we've got some throwing skill. + mpr("You can't quiver wielded weapons."); return; } else { - for (int i = 0; i < NUM_EQUIP; i++) + for (int i = EQ_CLOAK; i < NUM_EQUIP; i++) { if (you.equip[i] == slot) { @@ -320,8 +325,11 @@ void player_quiver::_maybe_fill_empty_slot() // If we're wielding an item previously quivered, the quiver may need // to be cleared. Else, any already quivered item is valid and we // don't need to do anything else. - if (m_last_used_of_type[slot].link == you.equip[EQ_WEAPON]) + if (m_last_used_of_type[slot].link == you.equip[EQ_WEAPON] + && you.equip[EQ_WEAPON] == -1) + { unquiver_weapon = true; + } else return; } @@ -332,8 +340,6 @@ void player_quiver::_maybe_fill_empty_slot() const launch_retval desired_ret = (weapon && is_range_weapon(*weapon)) ? LRET_LAUNCHED : LRET_THROWN; -// const launch_retval desired_ret = -// (slot == AMMO_THROW ? LRET_THROWN : LRET_LAUNCHED); std::vector order; _get_fire_order(order, false, weapon); @@ -398,9 +404,15 @@ void player_quiver::_get_fire_order( std::vector& order, if (!is_valid_item(item)) continue; - // Don't quiver wielded weapon. - if (you.equip[EQ_WEAPON] == i_inv) + // Don't quiver a wielded weapon unless it's a weapon of returning + // and we've got some throwing skill. + if (you.equip[EQ_WEAPON] == i_inv + && you.inv[i_inv].base_type == OBJ_WEAPONS + && (get_weapon_brand(you.inv[i_inv]) != SPWPN_RETURNING + || you.skills[SK_THROWING] == 0)) + { continue; + } // Don't do anything if this item is not really fit for throwing. if (is_launched(&you, you.weapon(), item) == LRET_FUMBLED) -- cgit v1.2.3-54-g00ecf