diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-01-29 16:57:10 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-01-29 16:57:10 +0000 |
commit | 1b87b6c8d4c8fb34b16eb8ddc4787f6421068222 (patch) | |
tree | cab50e8c0b765a98d81e577848ac230d058c64e1 /crawl-ref/source/util/levcomp.ypp | |
parent | 9295e4fb393749bedc6ccdbe99c5147435949d35 (diff) | |
download | crawl-ref-1b87b6c8d4c8fb34b16eb8ddc4787f6421068222.tar.gz crawl-ref-1b87b6c8d4c8fb34b16eb8ddc4787f6421068222.zip |
Allow maps to use SHUFFLE: directive to shuffle symbols in the map definition
(David).
For instance, SHUFFLE: def will shuffle its argument (to "efd", for instance)
and replace each occurrence of the symbols in its argument with the
corresponding symbol in the shuffled list (so all d will be replaced with e,
all e with f, and all f with d in the example).
Multiple SHUFFLE: lines can be used, and each shuffle will be applied
independently.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@906 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/util/levcomp.ypp')
-rw-r--r-- | crawl-ref/source/util/levcomp.ypp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp index d223161b02..41848978f8 100644 --- a/crawl-ref/source/util/levcomp.ypp +++ b/crawl-ref/source/util/levcomp.ypp @@ -25,7 +25,7 @@ void yyerror(const char *e) } %token <i> BRANCHDEF BRANCH DESC DEFAULT -%token <i> DEFAULT_DEPTH SYMBOL TAGS +%token <i> DEFAULT_DEPTH SYMBOL TAGS SHUFFLE %token <i> NAME DEPTH ORIENT PLACE CHANCE FLAGS MONS ITEM %token <i> ROOT_DEPTH ENTRY_MSG EXIT_MSG %token <i> ROCK_COLOUR FLOOR_COLOUR @@ -130,8 +130,15 @@ metaline : place | items | symbol | tags + | shuffle ; +shuffle : SHUFFLE { } + | SHUFFLE STRING + { + lc_map.add_shuffle($2); + } + tags : TAGS tagstrings {} ; |