summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/arena.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-05 09:47:37 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-05 09:47:37 +0000
commit22c92033c028930a987503953731a630b817c4f0 (patch)
tree13b44d5d9f320bb449cf7b84266a074450e125fc /crawl-ref/source/arena.cc
parent739361a8ab7f6a7a3d22c5461e8b903957e57d50 (diff)
downloadcrawl-ref-22c92033c028930a987503953731a630b817c4f0.tar.gz
crawl-ref-22c92033c028930a987503953731a630b817c4f0.zip
Place arena factions in different order on alternating rounds to prevent one team from getting the first move advantage on all rounds.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8241 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/arena.cc')
-rw-r--r--crawl-ref/source/arena.cc29
1 files changed, 26 insertions, 3 deletions
diff --git a/crawl-ref/source/arena.cc b/crawl-ref/source/arena.cc
index 3866f2a783..d1b7dff844 100644
--- a/crawl-ref/source/arena.cc
+++ b/crawl-ref/source/arena.cc
@@ -27,6 +27,8 @@ extern void world_reacts();
namespace arena
{
+ void write_error(const std::string &error);
+
// A faction is just a big list of monsters. Monsters will be dropped
// around the appropriate marker.
struct faction
@@ -327,8 +329,21 @@ namespace arena
place_a = dgn_find_feature_marker(DNGN_STONE_STAIRS_UP_I);
place_b = dgn_find_feature_marker(DNGN_STONE_STAIRS_DOWN_I);
- faction_a.place_at(place_a);
- faction_b.place_at(place_b);
+
+ // Place the different factions in different orders on
+ // alternating rounds so that one side doesn't get the
+ // first-move advantage for all rounds.
+ if (trials_done & 1)
+ {
+ faction_a.place_at(place_a);
+ faction_b.place_at(place_b);
+ }
+ else
+ {
+ faction_b.place_at(place_b);
+ faction_a.place_at(place_a);
+ }
+
adjust_monsters();
}
@@ -575,7 +590,15 @@ namespace arena
void global_setup()
{
// Set various options from the arena spec's tags
- parse_monster_spec();
+ try
+ {
+ parse_monster_spec();
+ }
+ catch (const std::string &error)
+ {
+ write_error(error);
+ end(0, false, "%s", error.c_str());
+ }
if (file != NULL)
end(0, false, "Results file already open");