diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-30 15:59:29 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-30 21:32:06 +0100 |
commit | c72f09adfa6f776ff5cabd0b8e4b4e0a2e752703 (patch) | |
tree | 4d8df78d7c26029a1849bb20caf13b98756d0196 /crawl-ref/source/colour.h | |
parent | 764ee1d67a579678d69aa690e92e263fee2b02e3 (diff) | |
download | crawl-ref-c72f09adfa6f776ff5cabd0b8e4b4e0a2e752703.tar.gz crawl-ref-c72f09adfa6f776ff5cabd0b8e4b4e0a2e752703.zip |
Splitting up stuff.cc.
New: colour.cc, coord.cc, coordit.cc, random.cc, rng.cc.
Diffstat (limited to 'crawl-ref/source/colour.h')
-rw-r--r-- | crawl-ref/source/colour.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/crawl-ref/source/colour.h b/crawl-ref/source/colour.h new file mode 100644 index 0000000000..1d8acfe9a4 --- /dev/null +++ b/crawl-ref/source/colour.h @@ -0,0 +1,62 @@ +#ifndef COLOUR_H +#define COLOUR_H + +// various elemental colour schemes... used for abstracting random +// short lists. When adding colours, please also add their names in +// str_to_colour! +enum element_type +{ + ETC_FIRE = 32, // fiery colours (must be first and > highest colour) + ETC_ICE, // icy colours + ETC_EARTH, // earthy colours + ETC_ELECTRICITY, // electrical side of air + ETC_AIR, // non-electric and general air magic + ETC_POISON, // used only for venom mage and stalker stuff + ETC_WATER, // used only for the elemental + ETC_MAGIC, // general magical effect + ETC_MUTAGENIC, // transmute, poly, radiation effects + ETC_WARP, // teleportation and anything similar + ETC_ENCHANT, // magical enhancements + ETC_HEAL, // holy healing (not necromantic stuff) + ETC_HOLY, // general "good" god effects + ETC_DARK, // darkness + ETC_DEATH, // currently only assassin (and equal to ETC_NECRO) + ETC_NECRO, // necromancy stuff + ETC_UNHOLY, // demonology stuff + ETC_VEHUMET, // vehumet's oddball colours + ETC_BEOGH, // Beogh altar colours + ETC_CRYSTAL, // colours of crystal + ETC_BLOOD, // colours of blood + ETC_SMOKE, // colours of smoke + ETC_SLIME, // colours of slime + ETC_JEWEL, // colourful + ETC_ELVEN, // used for colouring elf fabric items + ETC_DWARVEN, // used for colouring dwarf fabric items + ETC_ORCISH, // used for colouring orc fabric items + ETC_GILA, // gila monster colours + ETC_FLOOR, // colour of the area's floor + ETC_ROCK, // colour of the area's rock + ETC_STONE, // colour of the area's stone + ETC_MIST, // colour of mist + ETC_SHIMMER_BLUE, // shimmering colours of blue. + ETC_DECAY, // colour of decay/swamp + ETC_SILVER, // colour of silver + ETC_GOLD, // colour of gold + ETC_IRON, // colour of iron + ETC_BONE, // colour of bone + ETC_RANDOM // any colour (except BLACK) +}; + +int str_to_colour(const std::string &str, int default_colour = -1, + bool accept_number = true); +const std::string colour_to_str(unsigned char colour); +unsigned int str_to_tile_colour(std::string colour); + +unsigned char random_colour(); +unsigned char random_uncommon_colour(); +unsigned char make_low_colour(unsigned char colour); +unsigned char make_high_colour(unsigned char colour); +bool is_element_colour(int col); +int element_colour(int element, bool no_random = false); + +#endif |