diff options
author | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2010-01-09 14:12:15 +0100 |
---|---|---|
committer | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2010-01-09 14:12:15 +0100 |
commit | 8f662453f566222479ffcf856d70581c7c131c03 (patch) | |
tree | 18f68db1ca78d616e05f3ba677f385ff62a2c76c /crawl-ref/source/tilesdl.cc | |
parent | 40a5cf776b1309872551df44650a1dc13317fdcf (diff) | |
download | crawl-ref-8f662453f566222479ffcf856d70581c7c131c03.tar.gz crawl-ref-8f662453f566222479ffcf856d70581c7c131c03.zip |
Tiles: Add icons for poisonous/mutagenic/... chunks or corpses.
I'm not sure how to visualize contaminated chunks, so they haven't got
an icon yet (maybe use coagulated blood?) Also, I've opted to only show
the icons for rotten chunks if the character is capable of eating them.
Otherwise, them being rotten is all that's of interest to the player.
Diffstat (limited to 'crawl-ref/source/tilesdl.cc')
-rw-r--r-- | crawl-ref/source/tilesdl.cc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index 45bd2d161d..c25fcdd92a 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -7,6 +7,7 @@ #include "coord.h" #include "directn.h" #include "env.h" +#include "food.h" #include "itemname.h" #include "itemprop.h" #include "files.h" @@ -1436,6 +1437,23 @@ int tile_known_weapon_brand(const item_def item) return 0; } +int tile_corpse_brand(const item_def item) +{ + if (is_poisonous(item)) + return TILE_FOOD_POISONED; + + if (is_mutagenic(item)) + return TILE_FOOD_MUTAGENIC; + + if (causes_rot(item)) + return TILE_FOOD_ROTTING; + + if (is_forbidden_food(item)) + return TILE_FOOD_FORBIDDEN; + + return 0; +} + static void _fill_item_info(InventoryTile &desc, const item_def &item) { desc.tile = tileidx_item(item); @@ -1458,7 +1476,11 @@ static void _fill_item_info(InventoryTile &desc, const item_def &item) else desc.quantity = -1; - desc.special = tile_known_weapon_brand(item); + if (type == OBJ_WEAPONS || type == OBJ_MISSILES) + desc.special = tile_known_weapon_brand(item); + else if (type == OBJ_CORPSES) + desc.special = tile_corpse_brand(item); + desc.flag = 0; if (item.cursed() && item_ident(item, ISFLAG_KNOW_CURSE)) desc.flag |= TILEI_FLAG_CURSE; |