From f4bb02dd66fdf77bfd0ec304e4ae160a27916f42 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 30 May 2009 19:13:17 +0000 Subject: * AutoID rings of teleport control after teleporting. * Fix 2788773: Infinite scroll uses by clicking on a stack in tiles. * Fix 2792095: Tiled menus possibly containing more than 52 items. * Fix clicking on items not setting just_clicked_on_item until after the effect happened. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9853 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/misc.cc | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'crawl-ref/source/misc.cc') diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 2c181471ca..4ddd53ca1a 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -3184,3 +3184,38 @@ void swap_with_monster(monsters *mon_to_swap) mon.del_ench(ENCH_HELD, true); } } + +// AutoID an equipped ring of teleport. +// Code copied from fire/ice in spl-cast.cc +void maybe_id_ring_TC() +{ + if (player_mutation_level(MUT_TELEPORT_CONTROL)) + return; + + int num_unknown = 0; + for (int i = EQ_LEFT_RING; i <= EQ_RIGHT_RING; ++i) + { + if (player_wearing_slot(i) + && !item_ident(you.inv[you.equip[i]], ISFLAG_KNOW_PROPERTIES)) + { + ++num_unknown; + } + } + + if (num_unknown != 1) + return; + + for (int i = EQ_LEFT_RING; i <= EQ_RIGHT_RING; ++i) + if (player_wearing_slot(i)) + { + item_def& ring = you.inv[you.equip[i]]; + if (!item_ident(ring, ISFLAG_KNOW_PROPERTIES) + && ring.sub_type == RING_TELEPORT_CONTROL) + { + set_ident_type( ring.base_type, ring.sub_type, ID_KNOWN_TYPE ); + set_ident_flags(ring, ISFLAG_KNOW_PROPERTIES); + mprf("You are wearing: %s", + ring.name(DESC_INVENTORY_EQUIP).c_str()); + } + } +} -- cgit v1.2.3-54-g00ecf