From 1b87b6c8d4c8fb34b16eb8ddc4787f6421068222 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 29 Jan 2007 16:57:10 +0000 Subject: 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 --- crawl-ref/source/util/levcomp.ypp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/util/levcomp.ypp') 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 BRANCHDEF BRANCH DESC DEFAULT -%token DEFAULT_DEPTH SYMBOL TAGS +%token DEFAULT_DEPTH SYMBOL TAGS SHUFFLE %token NAME DEPTH ORIENT PLACE CHANCE FLAGS MONS ITEM %token ROOT_DEPTH ENTRY_MSG EXIT_MSG %token 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 {} ; -- cgit v1.2.3-54-g00ecf