summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-04 05:05:42 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-04 05:05:42 +0000
commit13f47218bbda7251a2521eda0c4a858ea333bbee (patch)
treefef4d2076355461b7c64dedd1676a90351cbc23d /crawl-ref/source/util
parent92c238f2c7ed33f3ebffc22fe08b1c51f98814b1 (diff)
downloadcrawl-ref-13f47218bbda7251a2521eda0c4a858ea333bbee.tar.gz
crawl-ref-13f47218bbda7251a2521eda0c4a858ea333bbee.zip
Moved all of the bazaar specific logic/code to dat/bazaar (or turned the
code into Lua utility functions which can be reused by things other than bazaars). Related changes: * Portal vault entrances now work if they have destinations ("dst" property) besides "bazaar" (though it still causes an assert if no matchng maps for the destination can be found). * The floor and rock colour for a level are generated once and then stored in the save file, rather than being constantly regenerated (which means that bazaar floor colours are now truly random, rather than being tied to the depth of the bazaar entrance). * The floor and rock colour for a portal vault (or for any level containing any vault) can be set with ROCKCOL and FLOORCOL (which currently only accepts a single colour, unlike COLOUR); there are also Lua functions for querying and setting the colours. * Each portal vault level_type_name can have an associated Lua callback which is called when level generation is complete; it can be used for things like stair fixup. I also moved the Halls of Zot rock/floor colour special casing to the dat/zot.des file, since it was easy once ROCKCOL and FLOORCOL had been implemented. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2314 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/util')
-rw-r--r--crawl-ref/source/util/levcomp.lpp2
-rw-r--r--crawl-ref/source/util/levcomp.ypp21
2 files changed, 23 insertions, 0 deletions
diff --git a/crawl-ref/source/util/levcomp.lpp b/crawl-ref/source/util/levcomp.lpp
index ffff5860f8..4d7e0278bd 100644
--- a/crawl-ref/source/util/levcomp.lpp
+++ b/crawl-ref/source/util/levcomp.lpp
@@ -199,6 +199,8 @@ BFLAGS: { BEGIN(ARGUMENT); return BFLAGS; }
SUBST: { BEGIN(ITEM_LIST); return SUBST; }
NSUBST: { BEGIN(ITEM_LIST); return NSUBST; }
COLOUR: { BEGIN(ITEM_LIST); return COLOUR; }
+FLOORCOL: { BEGIN(ARGUMENT); return FLOORCOL; }
+ROCKCOL: { BEGIN(ARGUMENT); return ROCKCOL; }
MONS: { BEGIN(MNAME); return MONS; }
ITEM: { BEGIN(ITEM_LIST); return ITEM; }
MARKER: { BEGIN(TOEOL); return MARKER; }
diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp
index 98b71047b4..614a357bbc 100644
--- a/crawl-ref/source/util/levcomp.ypp
+++ b/crawl-ref/source/util/levcomp.ypp
@@ -55,6 +55,7 @@ level_range set_range(const char *s, int start, int end)
%token <i> DEFAULT_DEPTH SHUFFLE SUBST TAGS KFEAT KITEM KMONS KMASK
%token <i> NAME DEPTH ORIENT PLACE CHANCE MONS ITEM MARKER COLOUR
%token <i> PRELUDE MAIN VALIDATE VETO NSUBST WELCOME LFLAGS BFLAGS
+%token <i> FLOORCOL ROCKCOL
%token <i> COMMA INTEGER CHARACTER
@@ -159,6 +160,8 @@ metaline : place
| subst
| nsubst
| colour
+ | floorcol
+ | rockcol
| shuffle
| tags
| lflags
@@ -346,6 +349,24 @@ mspec_segment : STRING
colour : COLOUR colour_specifiers { }
;
+floorcol : FLOORCOL { }
+ | FLOORCOL STRING
+ {
+ lc_map.main.add(
+ yylineno,
+ make_stringf("floor_colour(\"%s\")",
+ quote_lua_string($2).c_str()));
+ }
+
+rockcol : ROCKCOL { }
+ | ROCKCOL STRING
+ {
+ lc_map.main.add(
+ yylineno,
+ make_stringf("rock_colour(\"%s\")",
+ quote_lua_string($2).c_str()));
+ }
+
colour_specifiers : colour_specifier { }
| colour_specifiers COMMA colour_specifier { }
;