summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 08:55:18 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 08:55:18 +0000
commitae6c83ec9f0273d13ad57f1382528d7715189a2b (patch)
tree2a09386686dc53e703cf1a6ce4b25acd069b3017 /crawl-ref/source/util
parent4958b84b497fe729eaf14bc90b8d01874722c33d (diff)
downloadcrawl-ref-ae6c83ec9f0273d13ad57f1382528d7715189a2b.tar.gz
crawl-ref-ae6c83ec9f0273d13ad57f1382528d7715189a2b.zip
This change moves the logic for when a level or branch prohibits
teleport control from the C++ code into the vault .des files. This is done with the additions of two things: * Changeable, persistent per-level and per-branch flags which affect game play. * Dungeon events for the killing of monsters, picking up of objects and changing of features. The current level and branch flags are for teleport control prevention, making a level unmappable (like the Abyss or a Labyrinth), and preventing magic mapping from working (like the Abyss or a Labyrinth). Some related changes: * The new .des header KMASK allows for dungeon grid masks like no_monster_gen to be applied to specific symbols rather than the entire vault. * If the wizard mapping command (&{) is used in a place which is unmappable, it will ask if you wish to force the area to be mappable (so you can see what an entire Labyrinth or Abyss level looks like without having to hack the source). * A new wizard-mode level-map command, 'T', will teleport the player to wherever the cursor is pointing. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2146 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/util')
-rw-r--r--crawl-ref/source/util/levcomp.lpp3
-rw-r--r--crawl-ref/source/util/levcomp.ypp34
2 files changed, 35 insertions, 2 deletions
diff --git a/crawl-ref/source/util/levcomp.lpp b/crawl-ref/source/util/levcomp.lpp
index c86d4d9396..a2044da067 100644
--- a/crawl-ref/source/util/levcomp.lpp
+++ b/crawl-ref/source/util/levcomp.lpp
@@ -194,6 +194,8 @@ CHANCE: return CHANCE;
WEIGHT: return CHANCE;
FLAGS: { BEGIN(KEYWORDS); return TAGS; }
TAGS: { BEGIN(KEYWORDS); return TAGS; }
+LFLAGS: { BEGIN(ARGUMENT); return LFLAGS; }
+BFLAGS: { BEGIN(ARGUMENT); return BFLAGS; }
SUBST: { BEGIN(ITEM_LIST); return SUBST; }
NSUBST: { BEGIN(ITEM_LIST); return NSUBST; }
MONS: { BEGIN(MNAME); return MONS; }
@@ -204,6 +206,7 @@ SHUFFLE: { BEGIN(ITEM_LIST); return SHUFFLE; }
KFEAT: { BEGIN(ARGUMENT); return KFEAT; }
KITEM: { BEGIN(ARGUMENT); return KITEM; }
KMONS: { BEGIN(ARGUMENT); return KMONS; }
+KMASK: { BEGIN(ARGUMENT); return KMASK; }
, return COMMA;
diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp
index 26f736cd23..74cc7ff68f 100644
--- a/crawl-ref/source/util/levcomp.ypp
+++ b/crawl-ref/source/util/levcomp.ypp
@@ -52,9 +52,9 @@ level_range set_range(const char *s, int start, int end)
/* Two harmless shift/reduce conflicts */
%expect 2
-%token <i> DEFAULT_DEPTH SHUFFLE SUBST TAGS KFEAT KITEM KMONS
+%token <i> DEFAULT_DEPTH SHUFFLE SUBST TAGS KFEAT KITEM KMONS KMASK
%token <i> NAME DEPTH ORIENT PLACE CHANCE MONS ITEM MARKER
-%token <i> PRELUDE MAIN VALIDATE VETO NSUBST WELCOME
+%token <i> PRELUDE MAIN VALIDATE VETO NSUBST WELCOME LFLAGS BFLAGS
%token <i> COMMA INTEGER CHARACTER
@@ -160,9 +160,12 @@ metaline : place
| nsubst
| shuffle
| tags
+ | lflags
+ | bflags
| kfeat
| kitem
| kmons
+ | kmask
| main_lua
| prelude_lua
| validate_lua
@@ -252,6 +255,15 @@ kitem : KITEM { }
quote_lua_string($2).c_str()));
}
+kmask : KMASK { }
+ | KMASK STRING
+ {
+ lc_map.main.add(
+ yylineno,
+ make_stringf("kmask(\"%s\")",
+ quote_lua_string($2).c_str()));
+ }
+
shuffle : SHUFFLE shuffle_specifiers {}
;
@@ -283,6 +295,24 @@ tagstring : STRING
}
;
+lflags : LFLAGS STRING
+ {
+ lc_map.main.add(
+ yylineno,
+ make_stringf("lflags(\"%s\")",
+ quote_lua_string($2).c_str()));
+ }
+ ;
+
+bflags : BFLAGS STRING
+ {
+ lc_map.main.add(
+ yylineno,
+ make_stringf("bflags(\"%s\")",
+ quote_lua_string($2).c_str()));
+ }
+ ;
+
marker : MARKER
{
lc_map.main.add(yylineno, "marker(");