summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-20 15:01:18 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-20 15:01:18 +0000
commit3548833cfbab7a46fe339542183fa65f276ea167 (patch)
treef8377bf76c279646c2654b95ec504ed94963a240
parentbc1869c1a3334676d5cc99df90f7f9b24426274d (diff)
downloadcrawl-ref-3548833cfbab7a46fe339542183fa65f276ea167.tar.gz
crawl-ref-3548833cfbab7a46fe339542183fa65f276ea167.zip
Added classic_item_colours option to go back to 0.1.x item colours. The option
is not retroactive, it only affects items that are created after the option is set. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1072 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/docs/changes.stone_soup4
-rw-r--r--crawl-ref/docs/crawl_manual.txt4
-rw-r--r--crawl-ref/docs/crawl_options.txt7
-rw-r--r--crawl-ref/init.txt3
-rw-r--r--crawl-ref/source/clua.cc6
-rw-r--r--crawl-ref/source/dungeon.cc381
-rw-r--r--crawl-ref/source/externs.h1
-rw-r--r--crawl-ref/source/initfile.cc7
8 files changed, 293 insertions, 120 deletions
diff --git a/crawl-ref/docs/changes.stone_soup b/crawl-ref/docs/changes.stone_soup
index a1ec70a18d..5fc9fad78c 100644
--- a/crawl-ref/docs/changes.stone_soup
+++ b/crawl-ref/docs/changes.stone_soup
@@ -8,6 +8,7 @@ Stone Soup 0.2
* Targeting interface keymaps changed.
* -macro option now specifies a directory, not the macro file.
* Item colours changed.
+* Deeper dungeon levels can have multiple player ghosts.
* Rods of striking now also get magic reservoirs.
* Removed unpoisoned needles and blowguns of venom.
* Stash search also finds altars and portals.
@@ -68,6 +69,7 @@ Stone Soup 0.2
* Fixed duplicated scroll labels.
* Friendly monsters should not flee from the player.
* Fixed detect creatures revealing monster identities in notes.
+* Fixed level-map crashes on large terms.
* no_dark_brand defaults to true.
* Summon horrible things now produces temporary summons.
* Monster abjuration is weaker.
@@ -79,6 +81,8 @@ Stone Soup 0.2
* Monsters fighting hydras can chop off heads if using suitable weapons/claws.
* Interlevel travel handles branch entries and exits more intelligently.
* Added wizmode &~ to instant travel to any level to test special levels.
+* Messages can be coloured individually using pattern matches with the
+ message_colour option.
Stone Soup 0.1.7 (20061231)
---------------------------
diff --git a/crawl-ref/docs/crawl_manual.txt b/crawl-ref/docs/crawl_manual.txt
index 658a2f80eb..a358b67477 100644
--- a/crawl-ref/docs/crawl_manual.txt
+++ b/crawl-ref/docs/crawl_manual.txt
@@ -43,8 +43,8 @@ B. STARTING SCREEN
--------------------------------------------------------------------------------
After starting Crawl, you'll be asked to type in a name. If there is a saved
-game of that character, it will be restored, otherwise you proceed to choose a race
-and class (this can be done in either order). The choice of species affects
+game of that character, it will be restored, otherwise you proceed to choose a
+race and class (this can be done in either order). The choice of species affects
several important characteristics, in particular the speed with which the
different skills are learned. This is very important, and helps to clearly
differentiate the 26 available races. To be complete, the following factors are
diff --git a/crawl-ref/docs/crawl_options.txt b/crawl-ref/docs/crawl_options.txt
index c6db773020..6860d2d1da 100644
--- a/crawl-ref/docs/crawl_options.txt
+++ b/crawl-ref/docs/crawl_options.txt
@@ -70,7 +70,7 @@ The contents of this text are:
6- Miscellaneous.
6-a All OS.
macro_meta_entry, wiz_mode, colours, char_set, cset_ascii,
- cset_ibm, cset_dec, feature
+ cset_ibm, cset_dec, feature, classic_item_colours
6-b DOS and Windows.
dos_use_background_intensity
6-c Unix
@@ -1045,6 +1045,11 @@ feature = <regex> { <symbol>, <magicmap symbol>, <view colour>,
feature = rock wall { , , red } # shows rock walls in red
feature = metal wall {#} # use '#' for metal walls
+classic_item_colours = false
+ Crawl uses 4.0 b26/0.1.x-like item colours if classic_item_colours is
+ set to true. The default (false) is to use the new 0.2 item colours.
+ This option will not affect the colour of existing items, only items
+ generated after the option is set.
6-b DOS and Windows.
------------------------
diff --git a/crawl-ref/init.txt b/crawl-ref/init.txt
index d8eebacb17..ab0e8842ec 100644
--- a/crawl-ref/init.txt
+++ b/crawl-ref/init.txt
@@ -231,9 +231,12 @@ message_colour = lightcyan:LOW MAGIC WARNING
# use_ascii = ascii
# wiz_mode = no
#
+# classic_item_colours = true
+#
# See crawl_options.txt for the options
# char_set, cset_ascii, cset_ibm, cset_dec, cset_any, feature
+
##### 6-b DOS and Windows #######################
#
# dos_use_background_intensity = true
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index ce8dcd358a..ac7c749c41 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -2268,6 +2268,12 @@ bool lua_text_pattern::translate() const
{
if (translated || !isvalid)
return false;
+
+ if (pattern.find("]]") != std::string::npos
+ || pattern.find("[[") != std::string::npos)
+ {
+ return (false);
+ }
std::string textp;
std::string luafn;
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index c0240a4796..5a888473f9 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -6484,6 +6484,267 @@ static void many_pools(unsigned char pool_type)
while (pools < no_pools);
} // end many_pools()
+static int newwave_weapon_colour(const item_def &item)
+{
+ int item_colour = BLACK;
+ if (is_range_weapon( item ))
+ {
+ switch (range_skill(item))
+ {
+ case SK_BOWS:
+ item_colour = BLUE;
+ break;
+ case SK_CROSSBOWS:
+ item_colour = RED;
+ break;
+ case SK_DARTS:
+ item_colour = WHITE;
+ break;
+ case SK_SLINGS:
+ item_colour = BROWN;
+ break;
+ default:
+ // huh?
+ item_colour = MAGENTA;
+ break;
+ }
+ }
+ else
+ {
+ switch (weapon_skill(item))
+ {
+ case SK_SHORT_BLADES:
+ item_colour = CYAN;
+ break;
+ case SK_LONG_SWORDS:
+ item_colour = LIGHTCYAN;
+ break;
+ case SK_AXES:
+ item_colour = DARKGREY;
+ break;
+ case SK_MACES_FLAILS:
+ item_colour = LIGHTGREY;
+ break;
+ case SK_POLEARMS:
+ item_colour = LIGHTGREEN;
+ break;
+ case SK_STAVES:
+ item_colour = GREEN;
+ break;
+ default:
+ // huh?
+ item_colour = random_colour();
+ break;
+ }
+ }
+ return (item_colour);
+}
+
+static int classic_weapon_colour(const item_def &item)
+{
+ int item_colour = BLACK;
+
+ if (is_range_weapon( item ))
+ item_colour = BROWN;
+ else
+ {
+ switch (item.sub_type)
+ {
+ case WPN_CLUB:
+ case WPN_GIANT_CLUB:
+ case WPN_GIANT_SPIKED_CLUB:
+ case WPN_ANCUS:
+ case WPN_WHIP:
+ case WPN_QUARTERSTAFF:
+ item_colour = BROWN;
+ break;
+ case WPN_QUICK_BLADE:
+ item_colour = LIGHTBLUE;
+ break;
+ case WPN_EXECUTIONERS_AXE:
+ item_colour = RED;
+ break;
+ default:
+ item_colour = LIGHTCYAN;
+ if (get_equip_race(item) == ISFLAG_DWARVEN)
+ item_colour = CYAN;
+ break;
+ }
+ }
+
+ return (item_colour);
+}
+
+static int weapon_colour(const item_def &item)
+{
+ return (Options.classic_item_colours?
+ classic_weapon_colour(item) : newwave_weapon_colour(item));
+}
+
+static int newwave_missile_colour(const item_def &item)
+{
+ int item_colour = BLACK;
+ switch (item.sub_type)
+ {
+ case MI_STONE:
+ case MI_LARGE_ROCK:
+ item_colour = BROWN;
+ break;
+ case MI_ARROW:
+ item_colour = BLUE;
+ break;
+ case MI_NEEDLE:
+ item_colour = WHITE;
+ break;
+ case MI_BOLT:
+ item_colour = RED;
+ break;
+ case MI_DART:
+ item_colour = LIGHTRED;
+ break;
+ default:
+ // huh?
+ item_colour = LIGHTCYAN;
+ if (get_equip_race(item) == ISFLAG_DWARVEN)
+ item_colour = CYAN;
+ break;
+ }
+ return (item_colour);
+}
+
+static int classic_missile_colour(const item_def &item)
+{
+ int item_colour = BLACK;
+ switch (item.sub_type)
+ {
+ case MI_STONE:
+ case MI_LARGE_ROCK:
+ case MI_ARROW:
+ item_colour = BROWN;
+ break;
+ case MI_NEEDLE:
+ item_colour = WHITE;
+ break;
+ default:
+ item_colour = LIGHTCYAN;
+ if (get_equip_race(item) == ISFLAG_DWARVEN)
+ item_colour = CYAN;
+ break;
+ }
+ return (item_colour);
+}
+
+static int missile_colour(const item_def &item)
+{
+ return (Options.classic_item_colours?
+ classic_missile_colour(item) : newwave_missile_colour(item));
+}
+
+static int newwave_armour_colour(const item_def &item)
+{
+ int item_colour = BLACK;
+ switch (item.sub_type)
+ {
+ case ARM_CLOAK:
+ item_colour = WHITE;
+ break;
+ case ARM_NAGA_BARDING:
+ item_colour = LIGHTGREEN;
+ break;
+ case ARM_CENTAUR_BARDING:
+ item_colour = GREEN;
+ break;
+ case ARM_ROBE:
+ case ARM_CAP:
+ item_colour = random_uncommon_colour();
+ break;
+
+ case ARM_HELMET:
+ //caps and wizard's hats are random coloured
+ if (get_helmet_type(item) == THELM_CAP
+ || get_helmet_type(item) == THELM_WIZARD_HAT)
+ {
+ item_colour = random_uncommon_colour();
+ }
+ else
+ item_colour = DARKGREY;
+ break;
+
+ case ARM_BOOTS:
+ item_colour = BLUE;
+ break;
+ case ARM_GLOVES:
+ item_colour = LIGHTBLUE;
+ break;
+ case ARM_LEATHER_ARMOUR:
+ item_colour = BROWN;
+ break;
+ case ARM_CRYSTAL_PLATE_MAIL:
+ item_colour = WHITE;
+ break;
+ case ARM_ANIMAL_SKIN:
+ item_colour = YELLOW;
+ break;
+ default:
+ item_colour = LIGHTCYAN;
+ if (get_equip_race(item) == ISFLAG_DWARVEN)
+ item_colour = CYAN;
+ break;
+ }
+
+ return (item_colour);
+}
+
+static int classic_armour_colour(const item_def &item)
+{
+ int item_colour = BLACK;
+ switch (item.sub_type)
+ {
+ case ARM_CLOAK:
+ case ARM_ROBE:
+ case ARM_NAGA_BARDING:
+ case ARM_CENTAUR_BARDING:
+ case ARM_CAP:
+ item_colour = random_colour();
+ break;
+
+ case ARM_HELMET:
+ // caps and wizard's hats are random coloured
+ if (get_helmet_type(item) == THELM_CAP
+ || get_helmet_type(item) == THELM_WIZARD_HAT)
+ {
+ item_colour = random_colour();
+ }
+ else
+ item_colour = LIGHTCYAN;
+ break;
+
+ case ARM_BOOTS: // maybe more interesting boot colours?
+ case ARM_GLOVES:
+ case ARM_LEATHER_ARMOUR:
+ item_colour = BROWN;
+ break;
+ case ARM_CRYSTAL_PLATE_MAIL:
+ item_colour = LIGHTGREY;
+ break;
+ case ARM_ANIMAL_SKIN:
+ item_colour = BROWN;
+ break;
+ default:
+ item_colour = LIGHTCYAN;
+ if (get_equip_race(item) == ISFLAG_DWARVEN)
+ item_colour = CYAN;
+ break;
+ }
+ return (item_colour);
+}
+
+static int armour_colour(const item_def &item)
+{
+ return (Options.classic_item_colours?
+ classic_armour_colour(item) : newwave_armour_colour(item));
+}
+
void item_colour( item_def &item )
{
int switchnum = 0;
@@ -6537,56 +6798,8 @@ void item_colour( item_def &item )
if (is_demonic( item ))
item.colour = random_uncommon_colour();
- else if (is_range_weapon( item ))
- {
- switch (range_skill(item))
- {
- case SK_BOWS:
- item.colour = BLUE;
- break;
- case SK_CROSSBOWS:
- item.colour = RED;
- break;
- case SK_DARTS:
- item.colour = WHITE;
- break;
- case SK_SLINGS:
- item.colour = BROWN;
- break;
- default:
- // huh?
- item.colour = MAGENTA;
- break;
- }
- }
else
- {
- switch (weapon_skill(item))
- {
- case SK_SHORT_BLADES:
- item.colour = CYAN;
- break;
- case SK_LONG_SWORDS:
- item.colour = LIGHTCYAN;
- break;
- case SK_AXES:
- item.colour = DARKGREY;
- break;
- case SK_MACES_FLAILS:
- item.colour = LIGHTGREY;
- break;
- case SK_POLEARMS:
- item.colour = LIGHTGREEN;
- break;
- case SK_STAVES:
- item.colour = GREEN;
- break;
- default:
- // huh?
- item.colour = random_colour();
- break;
- }
- }
+ item.colour = weapon_colour(item);
if (is_random_artefact( item ) && one_chance_in(5))
item.colour = random_colour();
@@ -6594,31 +6807,7 @@ void item_colour( item_def &item )
break;
case OBJ_MISSILES:
- switch (item.sub_type)
- {
- case MI_STONE:
- case MI_LARGE_ROCK:
- item.colour = BROWN;
- break;
- case MI_ARROW:
- item.colour = BLUE;
- break;
- case MI_NEEDLE:
- item.colour = WHITE;
- break;
- case MI_BOLT:
- item.colour = RED;
- break;
- case MI_DART:
- item.colour = LIGHTRED;
- break;
- default:
- // huh?
- item.colour = LIGHTCYAN;
- if (get_equip_race(item) == ISFLAG_DWARVEN)
- item.colour = CYAN;
- break;
- }
+ item.colour = missile_colour(item);
break;
case OBJ_ARMOUR:
@@ -6627,40 +6816,6 @@ void item_colour( item_def &item )
switch (item.sub_type)
{
- case ARM_CLOAK:
- item.colour = WHITE;
- break;
- case ARM_NAGA_BARDING:
- item.colour = LIGHTGREEN;
- break;
- case ARM_CENTAUR_BARDING:
- item.colour = GREEN;
- break;
- case ARM_ROBE:
- case ARM_CAP:
- item.colour = random_uncommon_colour();
- break;
-
- case ARM_HELMET:
- //caps and wizard's hats are random coloured
- if (get_helmet_type(item) == THELM_CAP
- || get_helmet_type(item) == THELM_WIZARD_HAT)
- {
- item.colour = random_uncommon_colour();
- }
- else
- item.colour = DARKGREY;
- break;
-
- case ARM_BOOTS:
- item.colour = BLUE;
- break;
- case ARM_GLOVES:
- item.colour = LIGHTBLUE;
- break;
- case ARM_LEATHER_ARMOUR:
- item.colour = BROWN;
- break;
case ARM_DRAGON_HIDE:
case ARM_DRAGON_ARMOUR:
item.colour = mons_class_colour( MONS_DRAGON );
@@ -6669,9 +6824,6 @@ void item_colour( item_def &item )
case ARM_TROLL_LEATHER_ARMOUR:
item.colour = mons_class_colour( MONS_TROLL );
break;
- case ARM_CRYSTAL_PLATE_MAIL:
- item.colour = WHITE;
- break;
case ARM_ICE_DRAGON_HIDE:
case ARM_ICE_DRAGON_ARMOUR:
item.colour = mons_class_colour( MONS_ICE_DRAGON );
@@ -6692,17 +6844,12 @@ void item_colour( item_def &item )
case ARM_GOLD_DRAGON_ARMOUR:
item.colour = mons_class_colour( MONS_GOLDEN_DRAGON );
break;
- case ARM_ANIMAL_SKIN:
- item.colour = YELLOW;
- break;
case ARM_SWAMP_DRAGON_HIDE:
case ARM_SWAMP_DRAGON_ARMOUR:
item.colour = mons_class_colour( MONS_SWAMP_DRAGON );
break;
default:
- item.colour = LIGHTCYAN;
- if (get_equip_race(item) == ISFLAG_DWARVEN)
- item.colour = CYAN;
+ item.colour = armour_colour(item);
break;
}
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index e2083c1c3a..99c4ba3268 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1250,6 +1250,7 @@ public:
int travel_exclude_radius2; // Square of the travel exclude radius
bool show_waypoints;
+ bool classic_item_colours; // Use old-style item colours
bool item_colour; // Colour items on level map
unsigned detected_monster_colour; // Colour of detected monsters
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 78da3c3519..6e4cde4035 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -632,6 +632,8 @@ void game_options::reset_options()
detected_item_colour = LIGHTGREEN;
detected_monster_colour= LIGHTRED;
+ classic_item_colours = false;
+
easy_exit_menu = true;
#ifdef DOS
dos_use_background_intensity = false;
@@ -734,6 +736,7 @@ void game_options::reset_options()
// Clear vector options.
extra_levels.clear();
+
dump_order.clear();
new_dump_fields("header,stats,misc,inventory,skills,"
"spells,,overview,mutations,messages,screenshot,"
@@ -2123,6 +2126,10 @@ void game_options::read_option_line(const std::string &str, bool runscript)
{
tc_disconnected = str_to_colour(field, tc_disconnected);
}
+ else if (key == "classic_item_colours")
+ {
+ classic_item_colours = read_bool(field, classic_item_colours);
+ }
else if (key == "item_colour" || key == "item_color")
{
item_colour = read_bool(field, item_colour);