summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-20 21:47:40 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-20 21:47:40 +0000
commitf382ac5fc0137d0a2a58be30a893dfa9aa2723bd (patch)
tree8b709259cba53b49949b2c1f7f3b81984942be90 /crawl-ref
parent43e1f3ff5c4132023e80c6afe33e308f938a9860 (diff)
downloadcrawl-ref-f382ac5fc0137d0a2a58be30a893dfa9aa2723bd.tar.gz
crawl-ref-f382ac5fc0137d0a2a58be30a893dfa9aa2723bd.zip
Add tiles for the sewers' murky (deep and shallow) water, as well as a
yellow background for melded items in inventory. Allow higher level transformations (level 5 and above) to work even if your to-be-melded equipment is cursed, exempting weapons, as before. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7522 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/rltiles/dc-dngn.txt8
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/dngn_deep_water_murky.pngbin0 -> 692 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/dngn_shallow_water_murky.pngbin0 -> 732 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-misc.txt3
-rw-r--r--crawl-ref/source/rltiles/dc-misc/mask_deep_water_murky.pngbin0 -> 751 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-misc/mask_shallow_water_murky.pngbin0 -> 833 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-misc/slot_melded.pngbin0 -> 492 bytes
-rw-r--r--crawl-ref/source/tile2.cc8
-rw-r--r--crawl-ref/source/tilepick.cc17
-rw-r--r--crawl-ref/source/tilereg.cc21
-rw-r--r--crawl-ref/source/tiles.h3
-rw-r--r--crawl-ref/source/tilesdl.cc7
-rw-r--r--crawl-ref/source/transfor.cc43
13 files changed, 90 insertions, 20 deletions
diff --git a/crawl-ref/source/rltiles/dc-dngn.txt b/crawl-ref/source/rltiles/dc-dngn.txt
index 7a7519e12f..0527cea7d0 100644
--- a/crawl-ref/source/rltiles/dc-dngn.txt
+++ b/crawl-ref/source/rltiles/dc-dngn.txt
@@ -324,6 +324,14 @@ dngn_shallow_water DNGN_SHALLOW_WATER
dngn_shallow_water
dngn_shallow_water
dngn_shallow_water
+dngn_deep_water_murky DNGN_DEEP_WATER_MURKY
+dngn_deep_water_murky
+dngn_deep_water_murky
+dngn_deep_water_murky
+dngn_shallow_water_murky DNGN_SHALLOW_WATER_MURKY
+dngn_shallow_water_murky
+dngn_shallow_water_murky
+dngn_shallow_water_murky
wall/stone2_gray0 DNGN_STONE_WALL
wall/stone2_gray1
diff --git a/crawl-ref/source/rltiles/dc-dngn/dngn_deep_water_murky.png b/crawl-ref/source/rltiles/dc-dngn/dngn_deep_water_murky.png
new file mode 100644
index 0000000000..4e3432d5cf
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/dngn_deep_water_murky.png
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-dngn/dngn_shallow_water_murky.png b/crawl-ref/source/rltiles/dc-dngn/dngn_shallow_water_murky.png
new file mode 100644
index 0000000000..5ede780305
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/dngn_shallow_water_murky.png
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-misc.txt b/crawl-ref/source/rltiles/dc-misc.txt
index f9cbd192fe..f806ae23e1 100644
--- a/crawl-ref/source/rltiles/dc-misc.txt
+++ b/crawl-ref/source/rltiles/dc-misc.txt
@@ -44,6 +44,8 @@ dc-dngn/dngn_entrance UNSEEN_ENTRANCE
%back none
mask_deep_water MASK_DEEP_WATER
mask_shallow_water MASK_SHALLOW_WATER
+mask_deep_water_murky MASK_DEEP_WATER_MURKY
+mask_shallow_water_murky MASK_SHALLOW_WATER_MURKY
mask_lava MASK_LAVA
cursor CURSOR
cursor_red CURSOR2
@@ -81,6 +83,7 @@ num9 NUM9
tried TRIED
slot_eq ITEM_SLOT_EQUIP
+slot_melded ITEM_SLOT_MELDED
slot_cursed ITEM_SLOT_CURSED
slot_eq_cursed ITEM_SLOT_EQUIP_CURSED
ray ITEM_SLOT_SELECTED
diff --git a/crawl-ref/source/rltiles/dc-misc/mask_deep_water_murky.png b/crawl-ref/source/rltiles/dc-misc/mask_deep_water_murky.png
new file mode 100644
index 0000000000..c23341a388
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-misc/mask_deep_water_murky.png
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-misc/mask_shallow_water_murky.png b/crawl-ref/source/rltiles/dc-misc/mask_shallow_water_murky.png
new file mode 100644
index 0000000000..181ba2ca4b
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-misc/mask_shallow_water_murky.png
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-misc/slot_melded.png b/crawl-ref/source/rltiles/dc-misc/slot_melded.png
new file mode 100644
index 0000000000..716b7cc2b2
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-misc/slot_melded.png
Binary files differ
diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc
index 0923174656..c2ae2cb4ae 100644
--- a/crawl-ref/source/tile2.cc
+++ b/crawl-ref/source/tile2.cc
@@ -214,6 +214,12 @@ void WallIdx(int &wall, int &floor, int &special)
return;
}
}
+ else if (you.level_type_name == "sewer")
+ {
+ wall = TILE_WALL_SLIME;
+ floor = TILE_FLOOR_SLIME;
+ return;
+ }
}
int depth = player_branch_depth();
@@ -356,7 +362,7 @@ void TileLoadWall(bool wizard)
WallIdx(wall_tile_idx, floor_tile_idx, special_tile_idx);
// Number of flavors are generated automatically...
- floor_flavors = tile_dngn_count(floor_tile_idx);
+ floor_flavors = tile_dngn_count(floor_tile_idx);
wall_flavors = tile_dngn_count(wall_tile_idx);
if (special_tile_idx != -1)
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index 0f065395dc..0288eba6ed 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -36,6 +36,12 @@ static inline bool _is_bazaar()
&& you.level_type_name == "bazaar");
}
+static inline bool _is_sewers()
+{
+ return (you.level_type == LEVEL_PORTAL_VAULT
+ && you.level_type_name == "sewer");
+}
+
static inline unsigned short _get_bazaar_special_colour()
{
return YELLOW;
@@ -2108,8 +2114,12 @@ int tileidx_feature(int object, int gx, int gy)
case DNGN_LAVA:
return TILE_DNGN_LAVA;
case DNGN_DEEP_WATER:
+ if (_is_sewers())
+ return TILE_DNGN_DEEP_WATER_MURKY;
return TILE_DNGN_DEEP_WATER;
case DNGN_SHALLOW_WATER:
+ if (_is_sewers())
+ return TILE_DNGN_SHALLOW_WATER_MURKY;
return TILE_DNGN_SHALLOW_WATER;
case DNGN_FLOOR:
case DNGN_UNDISCOVERED_TRAP:
@@ -2449,7 +2459,8 @@ static inline void _finalize_tile(unsigned int *tile, bool is_special,
}
else if (orig == TILE_DNGN_CLOSED_DOOR || orig == TILE_DNGN_OPEN_DOOR)
{
- ASSERT(special_flv <= 3);
+ if (special_flv > 3)
+ special_flv = 3;
(*tile) = orig + special_flv;
}
else if (orig < TILE_DNGN_MAX)
@@ -3808,11 +3819,15 @@ void tile_init_flavor()
else if (d_spc && r_spc)
env.tile_flv[x][y].special = SPECIAL_NW;
else if (u_spc)
+ {
env.tile_flv[x][y].special = coinflip() ?
SPECIAL_W : SPECIAL_SW;
+ }
else if (d_spc)
+ {
env.tile_flv[x][y].special = coinflip() ?
SPECIAL_W : SPECIAL_NW;
+ }
else
env.tile_flv[x][y].special = jitter(SPECIAL_W);
}
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 0a039a2830..1b8dff3240 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -519,11 +519,21 @@ void DungeonRegion::draw_foreground(unsigned int bg, unsigned int fg, unsigned i
{
add_quad(TEX_DEFAULT, TILE_MASK_SHALLOW_WATER, x, y);
}
+ else if (bg_idx >= TILE_DNGN_SHALLOW_WATER_MURKY
+ && bg_idx <= TILE_DNGN_SHALLOW_WATER_MURKY+ 3)
+ {
+ add_quad(TEX_DEFAULT, TILE_MASK_SHALLOW_WATER_MURKY, x, y);
+ }
else if (bg_idx >= TILE_DNGN_DEEP_WATER
&& bg_idx <= TILE_DNGN_DEEP_WATER + 3)
{
add_quad(TEX_DEFAULT, TILE_MASK_DEEP_WATER, x, y);
}
+ else if (bg_idx >= TILE_DNGN_DEEP_WATER_MURKY
+ && bg_idx <= TILE_DNGN_DEEP_WATER_MURKY + 3)
+ {
+ add_quad(TEX_DEFAULT, TILE_MASK_DEEP_WATER_MURKY, x, y);
+ }
}
if (fg & TILE_FLAG_NET)
@@ -1233,8 +1243,10 @@ void InventoryRegion::pack_verts()
InventoryTile &item = m_items[i++];
if (item.flag & TILEI_FLAG_FLOOR)
+ {
add_quad(TEX_DUNGEON, get_floor_tile_idx()
+ m_flavour[i] % get_num_floor_flavors(), x, y);
+ }
else
add_quad(TEX_DUNGEON, TILE_ITEM_SLOT, x, y);
}
@@ -1263,8 +1275,13 @@ void InventoryRegion::pack_verts()
else
add_quad(TEX_DEFAULT, TILE_ITEM_SLOT_EQUIP, x, y);
}
- else if (item.flag & TILEI_FLAG_CURSE)
- add_quad(TEX_DEFAULT, TILE_ITEM_SLOT_CURSED, x, y);
+ else
+ {
+ if (item.flag & TILEI_FLAG_MELDED)
+ add_quad(TEX_DEFAULT, TILE_ITEM_SLOT_MELDED, x, y);
+ if (item.flag & TILEI_FLAG_CURSE)
+ add_quad(TEX_DEFAULT, TILE_ITEM_SLOT_CURSED, x, y);
+ }
// TODO enne - need better graphic here
if (item.flag & TILEI_FLAG_SELECT)
diff --git a/crawl-ref/source/tiles.h b/crawl-ref/source/tiles.h
index faf6dbd3d4..7380c3a1e0 100644
--- a/crawl-ref/source/tiles.h
+++ b/crawl-ref/source/tiles.h
@@ -177,7 +177,8 @@ enum
TILEI_FLAG_EQUIP = 0x0400,
TILEI_FLAG_FLOOR = 0x0800,
TILEI_FLAG_CURSE = 0x1000,
- TILEI_FLAG_CURSOR = 0x2000
+ TILEI_FLAG_CURSOR = 0x2000,
+ TILEI_FLAG_MELDED = 0x4000
};
enum
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index 77c940bda7..e6f07a19a2 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -1115,9 +1115,12 @@ void TilesFramework::update_inventory()
for (int eq = 0; eq < NUM_EQUIP; eq++)
{
- if (you.equip[eq] == i && you_tran_can_wear(you.inv[i]))
+ if (you.equip[eq] == i)
{
- desc.flag |= TILEI_FLAG_EQUIP;
+ if (you_tran_can_wear(you.inv[i]))
+ desc.flag |= TILEI_FLAG_EQUIP;
+ else
+ desc.flag |= TILEI_FLAG_MELDED;
break;
}
}
diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc
index f677f4830a..0643dbef37 100644
--- a/crawl-ref/source/transfor.cc
+++ b/crawl-ref/source/transfor.cc
@@ -203,10 +203,24 @@ bool remove_one_equip(equipment_type eq)
return remove_equipment(r);
}
+static bool _tran_may_meld_cursed(int transformation)
+{
+ switch (transformation)
+ {
+ case TRAN_SPIDER:
+ case TRAN_BAT: // Maybe this should depend on xp?
+ case TRAN_AIR:
+ case TRAN_ICE_BEAST:
+ return (false);
+ default:
+ return (true);
+ }
+}
+
// Returns true if any piece of equipment that has to be removed is cursed.
// Useful for keeping low level transformations from being too useful.
-static bool check_for_cursed_equipment(const std::set<equipment_type> &remove,
- bool quiet = false)
+static bool _check_for_cursed_equipment(const std::set<equipment_type> &remove,
+ const int trans, bool quiet = false)
{
std::set<equipment_type>::const_iterator iter;
for (iter = remove.begin(); iter != remove.end(); ++iter)
@@ -215,8 +229,11 @@ static bool check_for_cursed_equipment(const std::set<equipment_type> &remove,
if (you.equip[e] == -1)
continue;
- if (item_cursed( you.inv[ you.equip[e] ] ))
+ if (item_cursed( you.inv[ you.equip[e] ]))
{
+ if (e != EQ_WEAPON && _tran_may_meld_cursed(trans))
+ continue;
+
if (!quiet)
{
mpr( "Your cursed equipment won't allow you to complete the "
@@ -228,7 +245,7 @@ static bool check_for_cursed_equipment(const std::set<equipment_type> &remove,
}
return (false);
-} // end check_for_cursed_equipment()
+}
// Count the stat boosts yielded by all items to be removed, and count
// future losses (caused by the transformation) like a current stat boost,
@@ -423,7 +440,7 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
switch (which_trans)
{
case TRAN_SPIDER: // also AC +3, ev +3, fast_run
- if (check_for_cursed_equipment(rem_stuff, quiet))
+ if (_check_for_cursed_equipment(rem_stuff, which_trans, quiet))
return (false);
// Check in case we'll auto-remove stat boosting equipment.
@@ -447,7 +464,7 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
return (true);
case TRAN_BAT:
- if (check_for_cursed_equipment(rem_stuff, quiet))
+ if (_check_for_cursed_equipment(rem_stuff, which_trans, quiet))
return (false);
if (check_transformation_stat_loss(rem_stuff, quiet, 5)) // Str loss = 5
@@ -475,7 +492,7 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
return (true);
case TRAN_ICE_BEAST: // also AC +3, cold +3, fire -1, pois +1
- if (check_for_cursed_equipment(rem_stuff, quiet))
+ if (_check_for_cursed_equipment(rem_stuff, which_trans, quiet))
return (false);
// Check in case we'll auto-remove stat boosting equipment.
@@ -502,7 +519,7 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
return (true);
case TRAN_BLADE_HANDS:
- if (check_for_cursed_equipment( rem_stuff ))
+ if (_check_for_cursed_equipment(rem_stuff, which_trans, quiet))
return (false);
// Check in case we'll auto-remove stat boosting equipment.
@@ -520,7 +537,7 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
return (true);
case TRAN_STATUE: // also AC +20, ev -5, elec +1, pois +1, neg +1, slow
- if (check_for_cursed_equipment(rem_stuff, quiet))
+ if (_check_for_cursed_equipment(rem_stuff, which_trans, quiet))
return (false);
if (check_transformation_stat_loss(rem_stuff, quiet, 0, 2)) // Dex loss = 2
@@ -556,7 +573,7 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
return (true);
case TRAN_DRAGON: // also AC +10, ev -3, cold -1, fire +2, pois +1, flight
- if (check_for_cursed_equipment(rem_stuff, quiet))
+ if (_check_for_cursed_equipment(rem_stuff, which_trans, quiet))
return (false);
// Check in case we'll auto-remove stat boosting equipment.
@@ -618,7 +635,7 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
rem_stuff.insert(EQ_WEAPON);
}
- if (check_for_cursed_equipment(rem_stuff, quiet))
+ if (_check_for_cursed_equipment(rem_stuff, which_trans, quiet))
return (false);
if (check_transformation_stat_loss(rem_stuff, quiet))
@@ -654,7 +671,7 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
return (true);
case TRAN_AIR:
- if (check_for_cursed_equipment( rem_stuff ))
+ if (_check_for_cursed_equipment(rem_stuff, which_trans, quiet))
return (false);
// Check in case we'll auto-remove stat boosting equipment.
@@ -691,7 +708,7 @@ bool transform(int pow, transformation_type which_trans, bool quiet)
return (true);
case TRAN_SERPENT_OF_HELL:
- if (check_for_cursed_equipment(rem_stuff, quiet))
+ if (_check_for_cursed_equipment(rem_stuff, which_trans, quiet))
return (false);
// Check in case we'll auto-remove stat boosting equipment.