summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-26 18:33:14 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-26 18:33:14 +0000
commitfa25a347164bc7fb888629c65a4e3daee6c65950 (patch)
tree7d1184ce6643808d82eb77d34d9c4a514fc29089 /crawl-ref/source/misc.cc
parent8a501759a388cda29346d5b07854135e19a1193d (diff)
downloadcrawl-ref-fa25a347164bc7fb888629c65a4e3daee6c65950.tar.gz
crawl-ref-fa25a347164bc7fb888629c65a4e3daee6c65950.zip
Outsource the list of colors in weird_colour(), and add a few more
entries to it. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5266 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc35
1 files changed, 3 insertions, 32 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index e7e8405c53..4f319c0721 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -44,6 +44,7 @@
#include "chardump.h"
#include "clua.h"
#include "cloud.h"
+#include "database.h"
#include "delay.h"
#include "directn.h"
#include "dgnevent.h"
@@ -2375,39 +2376,9 @@ void new_level(void)
static std::string weird_colour()
{
- int temp_rand; // for probability determinations {dlb}
- std::string result;
+ std::string result = getRandNameString("colour_name");
- temp_rand = random2(27);
- result =
- (temp_rand == 0) ? "red" :
- (temp_rand == 1) ? "purple" :
- (temp_rand == 2) ? "orange" :
- (temp_rand == 3) ? "green" :
- (temp_rand == 4) ? "magenta" :
- (temp_rand == 5) ? "black" :
- (temp_rand == 6) ? "blue" :
- (temp_rand == 7) ? "grey" :
- (temp_rand == 8) ? "umber" :
- (temp_rand == 9) ? "charcoal" :
- (temp_rand == 10) ? "bronze" :
- (temp_rand == 11) ? "silver" :
- (temp_rand == 12) ? "gold" :
- (temp_rand == 13) ? "pink" :
- (temp_rand == 14) ? "yellow" :
- (temp_rand == 15) ? "white" :
- (temp_rand == 16) ? "brown" :
- (temp_rand == 17) ? "cyan" :
- (temp_rand == 18) ? "aubergine" :
- (temp_rand == 19) ? "ochre" :
- (temp_rand == 20) ? "leaf green" :
- (temp_rand == 21) ? "mauve" :
- (temp_rand == 22) ? "azure" :
- (temp_rand == 23) ? "lime green" :
- (temp_rand == 24) ? "scarlet" :
- (temp_rand == 25) ? "chartreuse" :
- (temp_rand == 26) ? "rubric"
- : "colourless";
+ lowercase(result);
return result;
}