summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilepick.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-21 13:03:29 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-21 13:03:29 +0000
commit61d4458f71a2ce6edf32343b80ca56fbed1c6d6c (patch)
tree8b1d07d578052b46082034c80374ed77cecc8d22 /crawl-ref/source/tilepick.cc
parent27c70daeafaf510904d08bf720527c16521da345 (diff)
downloadcrawl-ref-61d4458f71a2ce6edf32343b80ca56fbed1c6d6c.tar.gz
crawl-ref-61d4458f71a2ce6edf32343b80ca56fbed1c6d6c.zip
Modify shop entry tile to show the shop type. Ignoring antique for now.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7528 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilepick.cc')
-rw-r--r--crawl-ref/source/tilepick.cc45
1 files changed, 42 insertions, 3 deletions
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index 0288eba6ed..65e58998f0 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -20,6 +20,7 @@
#include "mon-util.h"
#include "player.h"
#include "randart.h"
+#include "shopping.h"
#include "spells3.h" // for the halo
#include "stuff.h"
#include "terrain.h"
@@ -2081,6 +2082,38 @@ static int _tileidx_trap(trap_type type)
}
}
+static int _tileidx_shop(coord_def where)
+{
+ const shop_struct *shop = get_shop(where);
+
+ switch (shop->type)
+ {
+ case SHOP_WEAPON:
+ case SHOP_WEAPON_ANTIQUE:
+ return TILE_SHOP_WEAPONS;
+ case SHOP_ARMOUR:
+ case SHOP_ARMOUR_ANTIQUE:
+ return TILE_SHOP_ARMOUR;
+ case SHOP_JEWELLERY:
+ return TILE_SHOP_JEWELLERY;
+ case SHOP_WAND:
+ return TILE_SHOP_WANDS;
+ case SHOP_FOOD:
+ return TILE_SHOP_FOOD;
+ case SHOP_BOOK:
+ return TILE_SHOP_BOOKS;
+ case SHOP_SCROLL:
+ return TILE_SHOP_SCROLLS;
+ case SHOP_DISTILLERY:
+ return TILE_SHOP_POTIONS;
+ case SHOP_GENERAL:
+ case SHOP_GENERAL_ANTIQUE:
+ return TILE_SHOP_GENERAL;
+ default:
+ return TILE_ERROR;
+ }
+}
+
int tileidx_feature(int object, int gx, int gy)
{
switch (object)
@@ -2114,12 +2147,18 @@ int tileidx_feature(int object, int gx, int gy)
case DNGN_LAVA:
return TILE_DNGN_LAVA;
case DNGN_DEEP_WATER:
- if (_is_sewers())
+ if (_is_sewers() || env.grid_colours[gx][gy] == GREEN
+ || env.grid_colours[gx][gy] == LIGHTGREEN)
+ {
return TILE_DNGN_DEEP_WATER_MURKY;
+ }
return TILE_DNGN_DEEP_WATER;
case DNGN_SHALLOW_WATER:
- if (_is_sewers())
+ if (_is_sewers() || env.grid_colours[gx][gy] == GREEN
+ || env.grid_colours[gx][gy] == LIGHTGREEN)
+ {
return TILE_DNGN_SHALLOW_WATER_MURKY;
+ }
return TILE_DNGN_SHALLOW_WATER;
case DNGN_FLOOR:
case DNGN_UNDISCOVERED_TRAP:
@@ -2133,7 +2172,7 @@ int tileidx_feature(int object, int gx, int gy)
case DNGN_TRAP_NATURAL:
return _tileidx_trap(get_trap_type(coord_def(gx, gy)));
case DNGN_ENTER_SHOP:
- return TILE_DNGN_ENTER_SHOP;
+ return _tileidx_shop(coord_def(gx,gy));
case DNGN_ENTER_LABYRINTH:
return TILE_DNGN_ENTER_LABYRINTH;
case DNGN_STONE_STAIRS_DOWN_I: