diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-09 21:52:44 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-09 21:52:44 +1000 |
commit | b03ae0bd75db95fd72cf484da6caec7eb47ad21c (patch) | |
tree | 7ef2787815630f4b273524ced5424be070e96236 /crawl-ref/source/mapdef.cc | |
parent | b186dbd518d138ee1d9c228d801ad0f3607ea76d (diff) | |
download | crawl-ref-b03ae0bd75db95fd72cf484da6caec7eb47ad21c.tar.gz crawl-ref-b03ae0bd75db95fd72cf484da6caec7eb47ad21c.zip |
Massively expand tile functionality in vault definitions.
This commit creates a new specifier for vaults: "TILE". Used much in the
same way as COLOUR, it can apply any specific tile to a feature. Example
syntax is specified in the syntax file, but copied here for clarity:
TILE: x = wall_flesh
Identical to FTILE and RTILE in syntax, but closer to COLOUR in
functionality. Instead of replacing the floor or relevant rock
tiles, this can be used to replace the tile used for any specific
feature.
This can be used in combination with FTILE and RTILE to change
the appearance of features. It can only be used with previously
specified tiles, however.
Like COLOUR and FTILE, this should be used sparingly and to good
effect.
Please, feel free to update vaults to use this! We want to ensure that
tiles players get the same experience as ASCII players do. This is only
the first stage in a push for greater flexibiltiy through tiles, but
hopefully it'll have a good impact.
Diffstat (limited to 'crawl-ref/source/mapdef.cc')
-rw-r--r-- | crawl-ref/source/mapdef.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index 628b3f39c6..066848536a 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -509,6 +509,12 @@ void map_lines::apply_grid_overlay(const coord_def &c) int offset = random2(tile_dngn_count(rock)); env.tile_flv(gc).wall = rock + offset; } + const int tile = (*overlay)(x, y).tile; + if (tile) + { + int offset = random2(tile_dngn_count(tile)); + env.tile_flv(gc).ftile = tile + offset; + } #endif } } @@ -1193,6 +1199,8 @@ void map_lines::overlay_tiles(tile_spec &spec) { if (spec.floor) (*overlay)(pos, y).floortile = spec.get_tile(); + else if (spec.feat) + (*overlay)(pos, y).tile = spec.get_tile(); else (*overlay)(pos, y).rocktile = spec.get_tile(); ++pos; @@ -1715,7 +1723,7 @@ bool map_tile_list::parse(const std::string &s, int weight) return true; } -std::string map_lines::add_tile(const std::string &sub, bool is_floor) +std::string map_lines::add_tile(const std::string &sub, bool is_floor, bool is_feat) { std::string s = trimmed_string(sub); @@ -1735,7 +1743,7 @@ std::string map_lines::add_tile(const std::string &sub, bool is_floor) if (!err.empty()) return (err); - tile_spec spec(key, sep == ':', is_floor, list); + tile_spec spec(key, sep == ':', is_floor, is_feat, list); overlay_tiles(spec); return (""); @@ -1743,12 +1751,17 @@ std::string map_lines::add_tile(const std::string &sub, bool is_floor) std::string map_lines::add_rocktile(const std::string &sub) { - return add_tile(sub, false); + return add_tile(sub, false, false); } std::string map_lines::add_floortile(const std::string &sub) { - return add_tile(sub, true); + return add_tile(sub, true, false); +} + +std::string map_lines::add_spec_tile(const std::string &sub) +{ + return add_tile(sub, false, true); } ////////////////////////////////////////////////////////////////////////// |