summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-11-06 18:02:32 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-11-06 18:02:32 +0000
commite281018a4712cc89f07b7cc24f70b7c0afbe21a6 (patch)
treefb8a78e7ecdbedd5566a065afa169cfa4edadd4c
parenta09b382df5689377f1bf5d5d359dca4c9e1aa240 (diff)
downloadcrawl-ref-e281018a4712cc89f07b7cc24f70b7c0afbe21a6.tar.gz
crawl-ref-e281018a4712cc89f07b7cc24f70b7c0afbe21a6.zip
Added an option, increasing_skill_progress (default false), which if true
makes skills display in increasing percentiles. Better names for the option are welcome. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@346 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/init.txt1
-rw-r--r--crawl-ref/source/clua.cc1
-rw-r--r--crawl-ref/source/externs.h1
-rw-r--r--crawl-ref/source/initfile.cc5
-rw-r--r--crawl-ref/source/skills2.cc14
5 files changed, 19 insertions, 3 deletions
diff --git a/crawl-ref/init.txt b/crawl-ref/init.txt
index b8b7716688..c3ccbf3670 100644
--- a/crawl-ref/init.txt
+++ b/crawl-ref/init.txt
@@ -153,6 +153,7 @@ hp_warning = 25
# terse_hand = false
# delay_message_clear = true
# always_greet = true
+# increasing_skill_progress = true
#
# menu_colour = lightred: cursed.*(worn|neck|hand|weapon)\)
# menu_colour = green:(worn|neck|hand|weapon)\)
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index c74ac719f5..9885fc05d3 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -1882,6 +1882,7 @@ static option_handler handlers[] =
{ "easy_unequip", &Options.easy_unequip, option_hboolean },
{ "easy_butcher", &Options.easy_butcher, option_hboolean },
{ "terse_hand", &Options.terse_hand, option_hboolean },
+ { "increasing_skill_progress", &Options.increasing_skill_progress, option_hboolean },
{ "confirm_self_target", &Options.confirm_self_target, option_hboolean },
{ "safe_autopickup", &Options.safe_autopickup, option_hboolean },
{ "note_skill_max", &Options.note_skill_max, option_hboolean },
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 3569d570cd..619f459d31 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -697,6 +697,7 @@ struct game_options
bool easy_open; // open doors with movement
bool easy_unequip; // allow auto-removing of armour / jewelry
bool easy_butcher; // open doors with movement
+ bool increasing_skill_progress; // skills go from 0-10 or 10-0
bool confirm_self_target; // require confirmation before selftarget
bool safe_autopickup; // don't autopickup when monsters visible
bool note_skill_max; // take note when skills reach new max
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index d5ef24f202..9f5cfc51c3 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -523,6 +523,7 @@ void reset_options(bool clear_name)
Options.note_hp_percent = 0;
Options.ood_interesting = 8;
Options.terse_hand = true;
+ Options.increasing_skill_progress = false;
Options.auto_list = false;
Options.delay_message_clear = false;
Options.pickup_dropped = true;
@@ -1515,6 +1516,10 @@ void parse_option_line(const std::string &str, bool runscript)
{
Options.terse_hand = read_bool( field, Options.terse_hand );
}
+ else if (key == "increasing_skill_progress")
+ {
+ Options.increasing_skill_progress = read_bool( field, Options.increasing_skill_progress );
+ }
else if (key == "flush")
{
if (subkey == "failure")
diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc
index 3cf3e33fb8..55a123f76d 100644
--- a/crawl-ref/source/skills2.cc
+++ b/crawl-ref/source/skills2.cc
@@ -1885,9 +1885,17 @@ void show_skills(void)
const int prev_needed = skill_exp_needed(you.skills[x] + 1);
const int spec_abil = species_skills(x, you.species);
- cprintf( " (%d)",
- (((needed * spec_abil) / 100 - you.skill_points[x]) * 10) /
- (((needed - prev_needed) * spec_abil) / 100) );
+ int percent_done = ((you.skill_points[x] - (prev_needed * spec_abil) / 100) * 100) / (((needed - prev_needed) * spec_abil) / 100);
+
+ if ( percent_done == 100 )
+ --percent_done;
+ if ( percent_done == 0 )
+ ++percent_done;
+
+ if ( !Options.increasing_skill_progress )
+ cprintf( " (%d)", (100 - percent_done) / 10 );
+ else
+ cprintf( " (%2d%%)", (percent_done / 5) * 5 );
}
scrln++;