diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-09-21 04:51:34 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-09-22 00:30:07 +0200 |
commit | 6cbcb2d290a7aebb2f41ac0a0114eac7dccb352b (patch) | |
tree | d79b91f9b906f1925ccb0a4c79a7a77aaff736d1 /crawl-ref/source | |
parent | df89f4c26ec4c22a48b94751754601c56000784f (diff) | |
download | crawl-ref-6cbcb2d290a7aebb2f41ac0a0114eac7dccb352b.tar.gz crawl-ref-6cbcb2d290a7aebb2f41ac0a0114eac7dccb352b.zip |
Purge obsolete code for quivering weapons.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/initfile.cc | 8 | ||||
-rw-r--r-- | crawl-ref/source/ng-setup.cc | 11 | ||||
-rw-r--r-- | crawl-ref/source/quiver.cc | 90 | ||||
-rw-r--r-- | crawl-ref/source/throw.h | 4 |
4 files changed, 22 insertions, 91 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 3929557639..7a688b3e94 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -304,14 +304,6 @@ static fire_type _str_to_fire_types(const string &str) return FIRE_STONE; else if (str == "rock") return FIRE_ROCK; - else if (str == "dagger") - return FIRE_DAGGER; - else if (str == "spear") - return FIRE_SPEAR; - else if (str == "hand axe" || str == "handaxe" || str == "axe") - return FIRE_HAND_AXE; - else if (str == "club") - return FIRE_CLUB; else if (str == "javelin") return FIRE_JAVELIN; else if (str == "tomahawk") diff --git a/crawl-ref/source/ng-setup.cc b/crawl-ref/source/ng-setup.cc index 28e362bf63..35453350dd 100644 --- a/crawl-ref/source/ng-setup.cc +++ b/crawl-ref/source/ng-setup.cc @@ -1388,17 +1388,6 @@ static void _setup_generic(const newgame_def& ng) you.train[SK_STEALTH] = 0; } - // If the item in slot 'a' is a throwable weapon like a dagger, - // inscribe it with {=f} to prevent it being autoquivered. - // (It's no fun to discover you've just thrown your +2 dagger - // because you ran out of needles for your blowgun!) - // FIXME: It ought to be possible to override this with autoinscribe rules. - if (you.inv[0].base_type == OBJ_WEAPONS - && is_throwable(&you, you.inv[0])) - { - you.inv[0].inscription = "=f"; - } - // Apply autoinscribe rules to inventory. request_autoinscribe(); autoinscribe(); diff --git a/crawl-ref/source/quiver.cc b/crawl-ref/source/quiver.cc index 6726f133e3..2590e0f31b 100644 --- a/crawl-ref/source/quiver.cc +++ b/crawl-ref/source/quiver.cc @@ -148,14 +148,6 @@ void player_quiver::empty_quiver(ammo_t ammo_type) you.redraw_quiver = true; } -static bool _wielded_slot_no_quiver(int slot) -{ - return (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)); -} - void quiver_item(int slot) { const item_def item = you.inv[slot]; @@ -186,8 +178,7 @@ void choose_item_for_quiver() int slot = prompt_invent_item("Quiver which item? (- for none, * to show all)", MT_INVLIST, OSEL_THROWABLE, true, true, true, '-', - you.equip[EQ_WEAPON], NULL, OPER_QUIVER, - false); + -1, NULL, OPER_QUIVER, false); if (prompt_failed(slot)) return; @@ -205,13 +196,6 @@ void choose_item_for_quiver() "crossbow"); return; } - else if (_wielded_slot_no_quiver(slot)) - { - // 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 = EQ_MIN_ARMOUR; i <= EQ_MAX_WORN; i++) @@ -425,16 +409,6 @@ void player_quiver::_get_fire_order(vector<int>& order, if (!item.defined()) continue; - // 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) continue; @@ -548,44 +522,28 @@ static bool _item_matches(const item_def &item, fire_type types, if (item.inscription.find(manual ? "+F" : "+f", 0) != string::npos) return true; - if (item.base_type == OBJ_MISSILES) - { - if ((types & FIRE_DART) && item.sub_type == MI_DART) - return true; - if ((types & FIRE_STONE) && item.sub_type == MI_STONE) - return true; - if ((types & FIRE_JAVELIN) && item.sub_type == MI_JAVELIN) - return true; - if ((types & FIRE_ROCK) && item.sub_type == MI_LARGE_ROCK) - return true; - if ((types & FIRE_NET) && item.sub_type == MI_THROWING_NET) - return true; - if ((types & FIRE_TOMAHAWK) && item.sub_type == MI_TOMAHAWK) - return true; - - if (types & FIRE_LAUNCHER) - { - if (launcher && item.launched_by(*launcher)) - return true; - } - } - else if (item.base_type == OBJ_WEAPONS && is_throwable(&you, item)) + if (item.base_type != OBJ_MISSILES) + return false; + + if ((types & FIRE_DART) && item.sub_type == MI_DART) + return true; + if ((types & FIRE_STONE) && item.sub_type == MI_STONE) + return true; + if ((types & FIRE_JAVELIN) && item.sub_type == MI_JAVELIN) + return true; + if ((types & FIRE_ROCK) && item.sub_type == MI_LARGE_ROCK) + return true; + if ((types & FIRE_NET) && item.sub_type == MI_THROWING_NET) + return true; + if ((types & FIRE_TOMAHAWK) && item.sub_type == MI_TOMAHAWK) + return true; + + if (types & FIRE_LAUNCHER) { - if ((types & FIRE_RETURNING) - && item.special == SPWPN_RETURNING - && item_ident(item, ISFLAG_KNOW_TYPE)) - { - return true; - } - if ((types & FIRE_DAGGER) && item.sub_type == WPN_DAGGER) - return true; - if ((types & FIRE_SPEAR) && item.sub_type == WPN_SPEAR) - return true; - if ((types & FIRE_HAND_AXE) && item.sub_type == WPN_HAND_AXE) - return true; - if ((types & FIRE_CLUB) && item.sub_type == WPN_CLUB) + if (launcher && item.launched_by(*launcher)) return true; } + return false; } @@ -603,19 +561,15 @@ static int _get_pack_slot(const item_def& item) for (int i = 0; i < ENDOFPACK; i++) { const item_def &inv_item = you.inv[i]; - if (inv_item.quantity && _items_similar(item, inv_item, false) - && !_wielded_slot_no_quiver(i)) - { + if (inv_item.quantity && _items_similar(item, inv_item, false)) return i; - } } // If that fails, try to find an item sufficiently similar. for (int i = 0; i < ENDOFPACK; i++) { const item_def &inv_item = you.inv[i]; - if (inv_item.quantity && _items_similar(item, inv_item, true) - && !_wielded_slot_no_quiver(i)) + if (inv_item.quantity && _items_similar(item, inv_item, true)) { // =f prevents item from being in fire order. if (strstr(inv_item.inscription.c_str(), "=f")) diff --git a/crawl-ref/source/throw.h b/crawl-ref/source/throw.h index b05098b66c..32453d4191 100644 --- a/crawl-ref/source/throw.h +++ b/crawl-ref/source/throw.h @@ -16,11 +16,7 @@ enum fire_type FIRE_LAUNCHER = 0x0001, FIRE_DART = 0x0002, FIRE_STONE = 0x0004, - FIRE_DAGGER = 0x0008, FIRE_JAVELIN = 0x0010, - FIRE_SPEAR = 0x0020, - FIRE_HAND_AXE = 0x0040, - FIRE_CLUB = 0x0080, FIRE_ROCK = 0x0100, FIRE_NET = 0x0200, FIRE_RETURNING = 0x0400, |