summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-28 14:09:26 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-28 14:09:26 +0000
commit90d0e8c3f9d3fdcd0aa0ef1a479ad178ca3ad7e2 (patch)
tree0b0c8adc8bd00bc67b00f9e76e5db073339792e0 /crawl-ref/source/initfile.cc
parent971e4ca792042d987cd898ae8144f849da188f2f (diff)
downloadcrawl-ref-90d0e8c3f9d3fdcd0aa0ef1a479ad178ca3ad7e2.tar.gz
crawl-ref-90d0e8c3f9d3fdcd0aa0ef1a479ad178ca3ad7e2.zip
Fix 2471146: equipment being melded due to mutations.
Fix 2426301: melding not working properly for Merfolk transformation. Colour melded equipment darkgrey on the % screen. Disallow Merfolk slipping out of their boots if doing so would kill the player due to stat loss. (Falling into water when flying will still kill them.) When this is the case, deep water is regarded as unsafe for travel. TODO: Ending a transformation should likewise be impossible if doing so would cause stat loss due to unmelding of items. Add a stat_colour option to highlight the stats when they're below a given threshold. By default, lightred at 1, red at 2-3. You could argue for setting the default to 7 but that would mean colouring almost all stats for each beginning character. (FR 2022232) Tidy up the stat colouring methods. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8004 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r--crawl-ref/source/initfile.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 856b35d5c5..14e9e69f57 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -895,6 +895,9 @@ void game_options::reset_options()
mp_colour.clear();
mp_colour.push_back(std::pair<int, int>(50, YELLOW));
mp_colour.push_back(std::pair<int, int>(25, RED));
+ stat_colour.clear();
+ stat_colour.push_back(std::pair<int, int>(1, LIGHTRED));
+ stat_colour.push_back(std::pair<int, int>(3, RED));
force_autopickup.clear();
note_monsters.clear();
@@ -2486,6 +2489,30 @@ void game_options::read_option_line(const std::string &str, bool runscript)
mp_colour.push_back(std::pair<int, int>(mp_percent, scolour));
}
}
+ else if (key == "stat_colour" || key == "stat_color")
+ {
+ stat_colour.clear();
+ std::vector<std::string> thesplit = split_string(",", field);
+ for (unsigned i = 0; i < thesplit.size(); ++i)
+ {
+ std::vector<std::string> insplit = split_string(":", thesplit[i]);
+
+ if (insplit.size() == 0 || insplit.size() > 2
+ || insplit.size() == 1 && i != 0)
+ {
+ crawl_state.add_startup_error(
+ make_stringf("Bad stat_colour string: %s\n", field.c_str()));
+ break;
+ }
+
+ int stat_limit = 1;
+ if (insplit.size() == 2 )
+ stat_limit = atoi(insplit[0].c_str());
+
+ int scolour = str_to_colour(insplit[(insplit.size() == 1) ? 0 : 1]);
+ stat_colour.push_back(std::pair<int, int>(stat_limit, scolour));
+ }
+ }
else if (key == "note_skill_levels")
{
std::vector<std::string> thesplit = split_string(",", field);