diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-05-30 19:13:17 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-05-30 19:13:17 +0000 |
commit | f4bb02dd66fdf77bfd0ec304e4ae160a27916f42 (patch) | |
tree | 3548083ff164b98e4d59b36050241d64921dbe3a /crawl-ref/source/misc.cc | |
parent | 5277bf424bbd6aeab3d8296ce68695717cfff9ed (diff) | |
download | crawl-ref-f4bb02dd66fdf77bfd0ec304e4ae160a27916f42.tar.gz crawl-ref-f4bb02dd66fdf77bfd0ec304e4ae160a27916f42.zip |
* 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
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 35 |
1 files changed, 35 insertions, 0 deletions
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()); + } + } +} |