diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-06-12 01:36:41 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-06-12 15:10:27 +0200 |
commit | fea71b51790dfb1c5babc22c32226a976a1d5fde (patch) | |
tree | eca851da1ea35080a389d0c7548a57a167b14b74 /crawl-ref/source/tilereg-inv.cc | |
parent | 13f14d0f7d75f1164c1ba97fc38272f8dc6b441a (diff) | |
download | crawl-ref-fea71b51790dfb1c5babc22c32226a976a1d5fde.tar.gz crawl-ref-fea71b51790dfb1c5babc22c32226a976a1d5fde.zip |
Make staves and rods separate object classes.
They have about no overlap, more than both being usable as weapons. A vast
majority of uses immediately checked item_is_rod()/item_is_staff().
I kept them shared for acquirement, for now.
Also, eliminate rods of smiting -- hardly ever used, problematic theme-wise
as they use "divine providence" without worship. Keeping rods of striking
for now, could be used to fix artificer problems. Adding/removing rod enums
is a mess due to tile handling, renaming ROD_SMITING to ROD_LIGHTNING for now.
Diffstat (limited to 'crawl-ref/source/tilereg-inv.cc')
-rw-r--r-- | crawl-ref/source/tilereg-inv.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crawl-ref/source/tilereg-inv.cc b/crawl-ref/source/tilereg-inv.cc index ffb89aa545..333f313b14 100644 --- a/crawl-ref/source/tilereg-inv.cc +++ b/crawl-ref/source/tilereg-inv.cc @@ -180,11 +180,11 @@ int InventoryRegion::handle_mouse(MouseEvent &event) } // NOTE: Assumes the item is equipped in the first place! -static bool _is_true_equipped_item(item_def item) +static bool _is_true_equipped_item(const item_def &item) { // Weapons and staves are only truly equipped if wielded. if (item.link == you.equip[EQ_WEAPON]) - return (item.base_type == OBJ_WEAPONS || item.base_type == OBJ_STAVES); + return is_weapon(item); // Cursed armour and rings are only truly equipped if *not* wielded. return (item.link != you.equip[EQ_WEAPON]); @@ -346,7 +346,7 @@ bool InventoryRegion::update_tip_text(std::string& tip) if (wielded && !item_is_evokable(item)) { if (type == OBJ_JEWELLERY || type == OBJ_ARMOUR - || type == OBJ_WEAPONS || type == OBJ_STAVES) + || is_weapon(item)) { type = OBJ_WEAPONS + EQUIP_OFFSET; } @@ -360,6 +360,7 @@ bool InventoryRegion::update_tip_text(std::string& tip) // first equipable categories case OBJ_WEAPONS: case OBJ_STAVES: + case OBJ_RODS: if (you.species != SP_FELID) { _handle_wield_tip(tmp, cmd); @@ -398,7 +399,7 @@ bool InventoryRegion::update_tip_text(std::string& tip) break; } // else fall-through - case OBJ_STAVES + EQUIP_OFFSET: // rods - other staves handled above + case OBJ_RODS + EQUIP_OFFSET: tmp += "Evoke (%)"; cmd.push_back(CMD_EVOKE_WIELDED); _handle_wield_tip(tmp, cmd, "\n[Ctrl + L-Click] ", true); @@ -610,7 +611,7 @@ static void _fill_item_info(InventoryTile &desc, const item_info &item) { desc.quantity = item.plus; } - else if (item_is_rod(item) && item.flags & ISFLAG_KNOW_PLUSES) + else if (type == OBJ_RODS && item.flags & ISFLAG_KNOW_PLUSES) desc.quantity = item.plus / ROD_CHARGE_MULT; else desc.quantity = -1; |