diff options
author | Shmuale Mark <shm.mark@gmail.com> | 2014-06-12 10:57:06 -0400 |
---|---|---|
committer | Shmuale Mark <shm.mark@gmail.com> | 2014-06-12 10:57:06 -0400 |
commit | ba3409b66cc051ae155dc79646f8cb958c4b1152 (patch) | |
tree | cb2215c4f9686174cbfd439028c68b0b73003156 /crawl-ref/source/showsymb.cc | |
parent | 0f8d0247443b40339d0a74fb722f003ed6e5c0ee (diff) | |
download | crawl-ref-ba3409b66cc051ae155dc79646f8cb958c4b1152.tar.gz crawl-ref-ba3409b66cc051ae155dc79646f8cb958c4b1152.zip |
New command: show weapons in viewport.
If a monster has a weapon, and you press ctrl-t (by default), you
will see, instead of its normal glyph, the glyph for the weapon it
is holding. Since this information is already available with 'x' and
even more easily in tiles, it's just an interface improvement, and as
far as I can tell in my tests there is no information leaked.
Diffstat (limited to 'crawl-ref/source/showsymb.cc')
-rw-r--r-- | crawl-ref/source/showsymb.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/showsymb.cc b/crawl-ref/source/showsymb.cc index 13ebd230d9..b134bd7e35 100644 --- a/crawl-ref/source/showsymb.cc +++ b/crawl-ref/source/showsymb.cc @@ -400,6 +400,16 @@ static cglyph_t _get_cell_glyph_with_class(const map_cell& cell, if (mi->props.exists("glyph") && override) g.col = mons_class_colour(stype); + // If we want to show weapons, overwrite all of that. + item_def* weapon = mi->inv[MSLOT_WEAPON].get(); + if (crawl_state.viewport_weapons && weapon) + { + show = *weapon; + g = _get_item_override(*weapon); + if (!g.col) + g.col = weapon->colour; + } + break; } |