summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-12-09 21:52:44 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-12-09 21:52:44 +1000
commitb03ae0bd75db95fd72cf484da6caec7eb47ad21c (patch)
tree7ef2787815630f4b273524ced5424be070e96236 /crawl-ref/source/util
parentb186dbd518d138ee1d9c228d801ad0f3607ea76d (diff)
downloadcrawl-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/util')
-rw-r--r--crawl-ref/source/util/levcomp.lpp1
-rw-r--r--crawl-ref/source/util/levcomp.ypp20
2 files changed, 20 insertions, 1 deletions
diff --git a/crawl-ref/source/util/levcomp.lpp b/crawl-ref/source/util/levcomp.lpp
index 151ef1418e..0de769b58a 100644
--- a/crawl-ref/source/util/levcomp.lpp
+++ b/crawl-ref/source/util/levcomp.lpp
@@ -251,6 +251,7 @@ LFLOORTILE: { CBEGIN(ARGUMENT); return LFLOORTILE; }
LROCKTILE: { CBEGIN(ARGUMENT); return LROCKTILE; }
FTILE: { CBEGIN(ITEM_LIST); return FTILE; }
RTILE: { CBEGIN(ITEM_LIST); return RTILE; }
+TILE: { CBEGIN(ITEM_LIST); return TILE; }
MONS: { CBEGIN(MNAME); return MONS; }
ITEM: { CBEGIN(ITEM_LIST); return ITEM; }
MARKER: { CBEGIN(ARGUMENT); return MARKER; }
diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp
index f13f102da0..2a5bf231df 100644
--- a/crawl-ref/source/util/levcomp.ypp
+++ b/crawl-ref/source/util/levcomp.ypp
@@ -54,7 +54,7 @@ level_range set_range(const char *s, int start, int end)
%token <i> DEFAULT_DEPTH SHUFFLE SUBST TAGS KFEAT KITEM KMONS KMASK KPROP
%token <i> NAME DEPTH ORIENT PLACE CHANCE WEIGHT MONS ITEM MARKER COLOUR
%token <i> PRELUDE MAIN VALIDATE VETO NSUBST WELCOME LFLAGS BFLAGS
-%token <i> LFLOORCOL LROCKCOL LFLOORTILE LROCKTILE FTILE RTILE SUBVAULT
+%token <i> LFLOORCOL LROCKCOL LFLOORTILE LROCKTILE FTILE RTILE TILE SUBVAULT
%token <i> COMMA COLON PERC INTEGER CHARACTER
@@ -166,6 +166,7 @@ metaline : place
| lrocktile
| ftile
| rtile
+ | tile
| shuffle
| tags
| lflags
@@ -437,6 +438,23 @@ rtile_specifier : ITEM_INFO
}
;
+tile : TILE tile_specifiers
+ ;
+
+tile_specifiers : tile_specifier
+ | tile_specifiers COMMA tile_specifier
+ ;
+
+tile_specifier : ITEM_INFO
+ {
+ lc_map.main.add(
+ yylineno,
+ make_stringf("tile(\"%s\")",
+ quote_lua_string($1).c_str()));
+ }
+ ;
+
+
colour_specifiers : colour_specifier { }
| colour_specifiers COMMA colour_specifier { }
;