summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.cc
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/tags.cc
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/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index b2a5a78100..7921420285 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1019,7 +1019,10 @@ static void tag_construct_you_dungeon(struct tagHeader &th)
// how many branches?
marshallByte(th, NUM_BRANCHES);
for (j = 0; j < NUM_BRANCHES; ++j)
+ {
marshallLong(th, branches[j].startdepth);
+ marshallLong(th, branches[j].branch_flags);
+ }
marshallShort(th, MAX_LEVELS);
for (i = 0; i < MAX_LEVELS; ++i)
@@ -1407,7 +1410,10 @@ static void tag_read_you_dungeon(struct tagHeader &th)
// how many branches?
count_c = unmarshallByte(th);
for (j = 0; j < count_c; ++j)
- branches[j].startdepth = unmarshallLong(th);
+ {
+ branches[j].startdepth = unmarshallLong(th);
+ branches[j].branch_flags = (unsigned long) unmarshallLong(th);
+ }
count_s = unmarshallShort(th);
for (i = 0; i < count_s; ++i)
@@ -1467,6 +1473,8 @@ static void tag_read_lost_monsters(tagHeader &th, int minorVersion)
static void tag_construct_level(struct tagHeader &th)
{
+ marshallLong(th, env.level_flags);
+
marshallFloat(th, (float)you.elapsed_time);
// map grids
@@ -1686,6 +1694,8 @@ void tag_construct_level_attitude(struct tagHeader &th)
static void tag_read_level( struct tagHeader &th, char minorVersion )
{
+ env.level_flags = (unsigned long) unmarshallLong(th);
+
env.elapsed_time = unmarshallFloat(th);
// map grids
// how many X?