summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/lev-pand.cc
diff options
context:
space:
mode:
authorChris Campbell <chriscampbell89@gmail.com>2013-04-22 22:22:34 +0100
committerChris Campbell <chriscampbell89@gmail.com>2013-04-22 22:22:34 +0100
commitd69058b34d72309af6cf66264ec4eb58400ef68d (patch)
treea0fa6bdffe01ed015024cf0c96fb144a4a978199 /crawl-ref/source/lev-pand.cc
parentbf6416b067dfdae02f5a204076106911597d4914 (diff)
downloadcrawl-ref-d69058b34d72309af6cf66264ec4eb58400ef68d.tar.gz
crawl-ref-d69058b34d72309af6cf66264ec4eb58400ef68d.zip
Choose Pan floor/wall colours randomly instead of basing them on monsters
This could be abused to identify the presence of particularly dangerous monsters in advance (for example by recolouring lots of demons, see #5985). Removed dgn_set_colours_from_monsters(), since the Abyss also already has its own way of picking colours.
Diffstat (limited to 'crawl-ref/source/lev-pand.cc')
-rw-r--r--crawl-ref/source/lev-pand.cc36
1 files changed, 27 insertions, 9 deletions
diff --git a/crawl-ref/source/lev-pand.cc b/crawl-ref/source/lev-pand.cc
index 2354ec7ca7..222de9fb4b 100644
--- a/crawl-ref/source/lev-pand.cc
+++ b/crawl-ref/source/lev-pand.cc
@@ -10,6 +10,7 @@
#include "lev-pand.h"
#include "externs.h"
+#include "colour.h"
#include "dungeon.h"
#include "env.h"
#include "mon-place.h"
@@ -17,11 +18,32 @@
#include "mon-pick.h"
#include "random.h"
-void init_pandemonium(void)
+static colour_t _pan_floor_colour()
+{
+ colour_t col;
+
+ do
+ col = random_colour();
+ // Don't use halo colours for floors.
+ while (col == DARKGREY || col == CYAN || col == YELLOW);
+
+ return col;
+}
+
+static colour_t _pan_rock_colour()
{
- // colour of monster 9 is colour of floor, 8 is colour of rock
- // IIRC, BLACK is set to LIGHTGREY
+ colour_t col;
+ do
+ col = random_colour();
+ // Don't use rock or metal colours for walls.
+ while (col == DARKGREY || col == LIGHTGREY || col == CYAN);
+
+ return col;
+}
+
+void init_pandemonium(void)
+{
for (int pc = 0; pc < 10; ++pc)
{
env.mons_alloc[pc] = random_choose(
@@ -100,12 +122,8 @@ void init_pandemonium(void)
if (one_chance_in(10))
env.mons_alloc[7 + random2(3)] = MONS_HELL_SENTINEL;
- // Set at least some specific monsters for the special levels - this
- // can also be used to set some colours.
-
- env.floor_colour = BLACK;
- env.rock_colour = BLACK;
- dgn_set_colours_from_monsters();
+ env.floor_colour = _pan_floor_colour();
+ env.rock_colour = _pan_rock_colour();
}
void pandemonium_mons(void)