From 63318a4b57b03ffc4686e4a3b78d64b73f50b6b9 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Wed, 19 Sep 2007 04:18:53 +0000 Subject: 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 --- crawl-ref/source/dungeon.cc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'crawl-ref/source/dungeon.cc') 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); -- cgit v1.2.3-54-g00ecf