diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-12 02:52:05 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-12 02:52:27 -0800 |
commit | 4ec1ab4e076a371dccb54072a220b7d4000021c6 (patch) | |
tree | c86dd7ef6b97e7cc8e7d938effa5158be15e4ba1 /crawl-ref/source/dungeon.cc | |
parent | af5862b9ed2d4e622b2ba6cb2fd4113bdb65ab3e (diff) | |
download | crawl-ref-4ec1ab4e076a371dccb54072a220b7d4000021c6.tar.gz crawl-ref-4ec1ab4e076a371dccb54072a220b7d4000021c6.zip |
Randomly placed overflow temples
Specialized single-altar overflow temples which also have the tag
"uniq_altar_GODNAME" can be placed randomly even if that altar has been
chosen at new-game time to be an overflow temple on a specific level,
and if it's randomly placed before being generated specifically then it
will only be placed once, rather than also being placed a second time at
the location chosen at new-game time.
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r-- | crawl-ref/source/dungeon.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 9ace2a865e..b42e2b1f82 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -1702,17 +1702,30 @@ static void _build_overflow_temples(int level_number) { CrawlVector &god_vec = temple[TEMPLE_GODS_KEY]; god_type god = (god_type) god_vec[0].get_byte(); + + std::string name = god_name(god); + name = replace_all(name, " ", "_"); + lowercase(name); - vault_tag = make_stringf("temple_overflow_%s", - god_name(god).c_str()); - vault_tag = replace_all(vault_tag, " ", "_"); - lowercase(vault_tag); + if (you.uniq_map_tags.find("uniq_altar_" + name) + != you.uniq_map_tags.end()) + { + // We've already placed a specialized temple for this + // god, so do nothing. +#ifdef DEBUG_DIAGNOSTICS + mprf(MSGCH_DIAGNOSTICS, "Already placed specialized " + "single-altar temple for %s", name.c_str()); +#endif + continue; + } + + vault_tag = make_stringf("temple_overflow_%s", name.c_str()); vault = random_map_for_tag(vault_tag, true); #ifdef DEBUG_DIAGNOSTICS if (vault == NULL) mprf(MSGCH_DIAGNOSTICS, "Couldn't find overflow temple " - "for god %s", god_name(god).c_str()); + "for god %s", name.c_str()); #endif } |