From fa25a347164bc7fb888629c65a4e3daee6c65950 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 26 May 2008 18:33:14 +0000 Subject: 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 --- crawl-ref/source/misc.cc | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'crawl-ref/source/misc.cc') 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; } -- cgit v1.2.3-54-g00ecf