summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorShmuale Mark <shm.mark@gmail.com>2014-03-19 18:55:38 -0400
committerShmuale Mark <shm.mark@gmail.com>2014-04-27 16:01:08 -0400
commita5c5f62ab8b6da919c58377e2c251380f65cc653 (patch)
tree6ed62dc1a6099075587d5bef360df48a26afefc3 /crawl-ref/source/misc.cc
parent9da1fa0942dabbe43d7ea81e1c8649ece15c5274 (diff)
downloadcrawl-ref-a5c5f62ab8b6da919c58377e2c251380f65cc653.tar.gz
crawl-ref-a5c5f62ab8b6da919c58377e2c251380f65cc653.zip
Auto-id jewellery on equip.
In the case of rings/amulets that identified themselves when they had an effect, the player would want to try to put themselves in a position where the item would identify, which was techincally optimal but quite annoying. There were a few items that never would identify, but on the whole it's not worth keeping around the behavior just for them. The ID code is pretty confusing and it's quite possible the implementation is not ideal or there are actual bugs.
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc85
1 files changed, 0 insertions, 85 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 65aa48a442..23fe0f554d 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2537,91 +2537,6 @@ void wear_id_type(item_def &item)
item.name(DESC_INVENTORY_EQUIP).c_str());
}
-static void _maybe_id_jewel(jewellery_type ring_type = NUM_JEWELLERY,
- jewellery_type amulet_type = NUM_JEWELLERY,
- artefact_prop_type artp = ARTP_NUM_PROPERTIES)
-{
- for (int i = EQ_LEFT_RING; i < NUM_EQUIP; ++i)
- {
- if (player_wearing_slot(i))
- {
- item_def& item = you.inv[you.equip[i]];
- if (item.sub_type == ring_type || item.sub_type == amulet_type)
- wear_id_type(item);
- bool known;
- if (artp != ARTP_NUM_PROPERTIES && is_artefact(item)
- && artefact_wpn_property(item, artp, known)
- && !known)
- {
- artefact_wpn_learn_prop(item, artp);
- mprf("You are wearing: %s",
- item.name(DESC_INVENTORY_EQUIP).c_str());
- }
- }
- }
-}
-
-void maybe_id_ring_hunger()
-{
- _maybe_id_jewel(RING_HUNGER, NUM_JEWELLERY, ARTP_METABOLISM);
- _maybe_id_jewel(RING_SUSTENANCE, NUM_JEWELLERY, ARTP_METABOLISM);
-}
-
-void maybe_id_ring_see_invis()
-{
- _maybe_id_jewel(RING_SEE_INVISIBLE, NUM_JEWELLERY, ARTP_EYESIGHT);
-}
-
-void maybe_id_clarity()
-{
- _maybe_id_jewel(NUM_JEWELLERY, AMU_CLARITY, ARTP_CLARITY);
-}
-
-void maybe_id_resist(beam_type flavour)
-{
- switch (flavour)
- {
- case BEAM_FIRE:
- case BEAM_LAVA:
- _maybe_id_jewel(RING_PROTECTION_FROM_FIRE, NUM_JEWELLERY, ARTP_FIRE);
- break;
-
- case BEAM_COLD:
- case BEAM_ICE:
- _maybe_id_jewel(RING_PROTECTION_FROM_COLD, NUM_JEWELLERY, ARTP_COLD);
- break;
-
- case BEAM_ELECTRICITY:
- _maybe_id_jewel(NUM_JEWELLERY, NUM_JEWELLERY, ARTP_ELECTRICITY);
- break;
-
- case BEAM_ACID:
- _maybe_id_jewel(NUM_JEWELLERY, AMU_RESIST_CORROSION);
- break;
-
- case BEAM_POISON:
- case BEAM_POISON_ARROW:
- case BEAM_MEPHITIC:
- _maybe_id_jewel(RING_POISON_RESISTANCE, NUM_JEWELLERY, ARTP_POISON);
- break;
-
- case BEAM_NEG:
- _maybe_id_jewel(RING_LIFE_PROTECTION, AMU_WARDING, ARTP_NEGATIVE_ENERGY);
- break;
-
- case BEAM_STEAM:
- // rF+ grants rSteam, all possibly unidentified sources of rSteam are rF
- _maybe_id_jewel(RING_PROTECTION_FROM_FIRE, NUM_JEWELLERY, ARTP_FIRE);
- break;
-
- case BEAM_MALMUTATE:
- _maybe_id_jewel(NUM_JEWELLERY, AMU_RESIST_MUTATION);
- break;
-
- default: ;
- }
-}
-
void auto_id_inventory()
{
for (int i = 0; i < ENDOFPACK; i++)