diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-10-31 08:56:30 -0500 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-10-31 09:00:43 -0500 |
commit | ebd817b97aee46e383185f99d022fb9c559033d9 (patch) | |
tree | 68957d69448760dc6b55a5b9286f3b6283ce6bbe /crawl-ref/source/colour.cc | |
parent | a6fe99646bdf76151337e2217a26f6b9839510fc (diff) | |
download | crawl-ref-ebd817b97aee46e383185f99d022fb9c559033d9.tar.gz crawl-ref-ebd817b97aee46e383185f99d022fb9c559033d9.zip |
Implement [2889948]: In the console version, make (very) ugly thing
corpses randomly cycle through all their available colors instead of
always being (light)red.
Diffstat (limited to 'crawl-ref/source/colour.cc')
-rw-r--r-- | crawl-ref/source/colour.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/crawl-ref/source/colour.cc b/crawl-ref/source/colour.cc index 6a27c04b6a..cbdd536886 100644 --- a/crawl-ref/source/colour.cc +++ b/crawl-ref/source/colour.cc @@ -3,6 +3,7 @@ #include "colour.h" #include "env.h" +#include "mon-util.h" #include "player.h" #include "random.h" @@ -65,7 +66,10 @@ int element_colour( int element, bool no_random ) // which might want a consistent result. int tmp_rand = (no_random ? 0 : random2(120)); - switch (element & 0x007f) // strip COLFLAGs just in case + // Strip COLFLAGs just in case. + element &= 0x007f; + + switch (element) { case ETC_FIRE: ret = (tmp_rand < 40) ? RED : @@ -251,6 +255,13 @@ int element_colour( int element, bool no_random ) ret = (tmp_rand < 90) ? WHITE : LIGHTGREY; break; + case ETC_UGLY: + case ETC_VERY_UGLY: + ret = ugly_thing_random_colour(); + if (element == ETC_VERY_UGLY) + ret = make_high_colour(ret); + break; + case ETC_RANDOM: ret = 1 + random2(15); // always random break; @@ -261,7 +272,7 @@ int element_colour( int element, bool no_random ) break; } - ASSERT( !is_element_colour( ret ) ); + ASSERT(!is_element_colour(ret)); return ((ret == BLACK) ? GREEN : ret); } @@ -330,7 +341,7 @@ int str_to_colour( const std::string &str, int default_colour, "beogh", "crystal", "blood", "smoke", "slime", "jewel", "elven", "dwarven", "orcish", "gila", "floor", "rock", "stone", "mist", "shimmer_blue", "decay", "silver", "gold", - "iron", "bone", "random" + "iron", "bone", "ugly", "very_ugly", "random" }; ASSERT(ARRAYSZ(element_cols) == (ETC_RANDOM - ETC_FIRE) + 1); |