From f3b1762e5a7ce54cb41729e3d4cedf482c4a42e9 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 26 Mar 2009 23:24:34 +0000 Subject: * Fix Xom's interest wrapping around from 0 to 255. (!!!) * In xom_acts, if Xom was bored (and now did something bad) reroll interest. * Greatly decrease amusement derived from the player entering a new level. (However, entering a new level via escape hatch or shaft is REALLY amusing, more so the deeper the shaft.) * Xom may be amused if you are caught in a net and there are hostile monsters around. * Fix draconian tiles not showing up correctly for Detect Creatures. * Improve card descriptions output for Triple Draw/Stack Five. * In inventory, add '&' hotkey for useless (== inedible) chunks. Still needs documentation. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9557 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/invent.cc | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) (limited to 'crawl-ref/source/invent.cc') diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 95ae61ecee..73be3dd37f 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -289,6 +289,15 @@ void InvEntry::add_class_hotkeys(const item_def &i) _get_class_hotkeys(type, glyphs); for (unsigned int k = 0; k < glyphs.size(); ++k) add_hotkey(glyphs[k]); + + // Hack to make rotten chunks answer to '&' as well. + // Check for uselessness rather than inedibility to cover the spells + // that use chunks. + if (i.base_type == OBJ_FOOD && i.sub_type == FOOD_CHUNK + && is_useless_item(i)) + { + add_hotkey('&'); + } } bool InvEntry::show_prices = false; @@ -503,20 +512,33 @@ bool InvEntry::get_tiles(std::vector& tileset) const { // Do we want to display the floor type or is that too distracting? const coord_def c = item->pos; - int ch = tileidx_feature(grd(c), c.x, c.y); - if (ch == TILE_FLOOR_NORMAL) - ch = env.tile_flv(c).floor; - else if (ch == TILE_WALL_NORMAL) - ch = env.tile_flv(c).wall; + int ch = -1; + if (c != coord_def()) + { + ch = tileidx_feature(grd(c), c.x, c.y); + if (ch == TILE_FLOOR_NORMAL) + ch = env.tile_flv(c).floor; + else if (ch == TILE_WALL_NORMAL) + ch = env.tile_flv(c).wall; - tileset.push_back(tile_def(ch, TEX_DUNGEON)); + tileset.push_back(tile_def(ch, TEX_DUNGEON)); + } tileset.push_back(tile_def(idx, TEX_DEFAULT)); - // Needs to be displayed so as to not give away mimics in shallow water. - if (ch == TILE_DNGN_SHALLOW_WATER) - tileset.push_back(tile_def(TILE_MASK_SHALLOW_WATER, TEX_DEFAULT)); - else if (ch == TILE_DNGN_SHALLOW_WATER_MURKY) - tileset.push_back(tile_def(TILE_MASK_SHALLOW_WATER_MURKY, TEX_DEFAULT)); + if (ch != -1) + { + // Needs to be displayed so as to not give away mimics in shallow water. + if (ch == TILE_DNGN_SHALLOW_WATER) + { + tileset.push_back(tile_def(TILE_MASK_SHALLOW_WATER, + TEX_DEFAULT)); + } + else if (ch == TILE_DNGN_SHALLOW_WATER_MURKY) + { + tileset.push_back(tile_def(TILE_MASK_SHALLOW_WATER_MURKY, + TEX_DEFAULT)); + } + } } int brand = tile_known_weapon_brand(*item); if (brand) -- cgit v1.2.3-54-g00ecf