summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 04:18:53 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 04:18:53 +0000
commit63318a4b57b03ffc4686e4a3b78d64b73f50b6b9 (patch)
treead233d952c0197fdf2ec3e1707cd1cc6d31a2bff /crawl-ref/source/dungeon.cc
parent5b3a525f14d218f3a8efec572ea347c2f6c13c3d (diff)
downloadcrawl-ref-63318a4b57b03ffc4686e4a3b78d64b73f50b6b9.tar.gz
crawl-ref-63318a4b57b03ffc4686e4a3b78d64b73f50b6b9.zip
If wizard mode is on when going through a portal to a bazaar, Crawl will
ask the user for the name of a bazaar map to load (minus the "bazaar_" at the front of the name); escape or enter can be pressed to get a random map. Adds new wizard command 'P', to create portal-vault-portals to arbitrary destinations (though any desitnation but "bazaar" will currently cause an assertion when the portal is entered). Adds new map marker class map_wiz_props_marker, which can be used by wizard commands to create a map marker with abritrary properties. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2143 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 5fc822b31d..8abb604604 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -68,6 +68,10 @@
#include "travel.h"
#include "view.h"
+#ifdef WIZARD
+#include "cio.h" // for cancelable_get_line()
+#endif
+
#define MAX_PIT_MONSTERS 10
struct pit_mons_def
@@ -1473,6 +1477,35 @@ static void fixup_bazaar_stairs()
static void bazaar_level(int level_number)
{
int vault = random_map_for_place(level_id::current(), false);
+
+#ifdef WIZARD
+ if (vault == -1 && you.wizard)
+ {
+ char buf[80];
+
+ do
+ {
+ mprf(MSGCH_PROMPT, "Which bazaar (ESC or ENTER for random): ");
+ if (cancelable_get_line(buf, sizeof buf))
+ break;
+
+ std::string name = buf;
+ trim_string(name);
+
+ if (name.empty())
+ break;
+
+ lowercase(name);
+ name = replace_all(name, " ", "_");
+
+ vault = find_map_by_name("bazaar_" + name);
+
+ if (vault == -1)
+ mprf(MSGCH_DIAGNOSTICS, "No such bazaar, try again.");
+ } while (vault == -1);
+ }
+#endif
+
if (vault == -1)
vault = random_map_for_tag("bazaar", false);