summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/externs.h
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-13 01:00:01 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-13 01:00:01 +0000
commit42d0d63ae25d7ec3e5ded02ae77489cc5e8371f9 (patch)
treedfa131b93bdbc36c38bc31adb71d717ce44a659b /crawl-ref/source/externs.h
parent43d6d67d143b01bacbf10dad61f460c7446db1fb (diff)
downloadcrawl-ref-42d0d63ae25d7ec3e5ded02ae77489cc5e8371f9.tar.gz
crawl-ref-42d0d63ae25d7ec3e5ded02ae77489cc5e8371f9.zip
Breaks savefile compatibility.
Allow Shadow Creatures spell (along with anything that uses create_monster(), mons_place(), place_monster() or pick_random_monster()) to work in portal vaults; only fixed ziggurats to use it. Must be done by manually calling dgn.set_random_mon_list(); can't automatically set it from MONS since the actual frequency of the monster specified that way is controlled by the number of 1/2/3/etc symbols that are in the map combined with symbol shufflings and substitutions. Can add an RMONS keyword to handle it if needed. Limitations: can only use level id or monster type + base type. Monster number (specific number of hydra heads), colour, items, band, and patrolling are all discarded/ignored. This can be improved if it's too limiting. New per-level env.properties CrawlHashTable stores the information. env.properties can be used to store new per-level data without breaking savefile compatibility (though changing the handling of old data in env.properties can still break compatibility). Random monster spawn rate is now controlled by the per-level env.spawn_random_rate (though the default rates are all the same as before), in case any weird portal vaults want to turn on random monster spawning. Could also be used to alter the random spawn rate for places like Vault:8 Prevented Shadow Creatues from working in the Temple. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7816 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/externs.h')
-rw-r--r--crawl-ref/source/externs.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 4be82a7c62..7cdaad0d20 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -491,6 +491,7 @@ public:
}
static level_id parse_level_id(const std::string &s) throw (std::string);
+ static level_id from_packed_place(const unsigned short place);
unsigned short packed_place() const;
std::string describe(bool long_name = false, bool with_number = true) const;
@@ -1685,7 +1686,16 @@ public:
FixedVector< monster_type, 20 > mons_alloc;
map_markers markers;
- double elapsed_time; // used during level load
+ // Place to associate arbitrary data with a particular level.
+ // Sort of like player::atribute
+ CrawlHashTable properties;
+
+ // Rate at which random monsters spawn, with lower numbers making
+ // them spawn more often (5 or less causes one to spawn about every
+ // 5 turns). Set to 0 to stop random generation.
+ int spawn_random_rate;
+
+ double elapsed_time; // used during level load
// Number of turns the player has spent on this level.
int turns_on_level;