summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/invent.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-26 23:24:34 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-26 23:24:34 +0000
commitf3b1762e5a7ce54cb41729e3d4cedf482c4a42e9 (patch)
treec30507d1b89fc4666967e913d39973c1c8b34bd9 /crawl-ref/source/invent.cc
parent07a3ce3ad486d8cbf07a1fda8b50a1d3d87b6143 (diff)
downloadcrawl-ref-f3b1762e5a7ce54cb41729e3d4cedf482c4a42e9.tar.gz
crawl-ref-f3b1762e5a7ce54cb41729e3d4cedf482c4a42e9.zip
* 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
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r--crawl-ref/source/invent.cc44
1 files changed, 33 insertions, 11 deletions
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<tile_def>& 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)