summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/skill_menu.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2012-01-04 17:53:54 -0500
committerNeil Moore <neil@s-z.org>2012-01-05 01:01:35 -0500
commit5ee2d78f0c0e0025939bbd8eafed5eec35b1d3a0 (patch)
treea345aa7b0b714107c643bc8818c0a25fba1fc451 /crawl-ref/source/skill_menu.cc
parent010988d48063d0871b13aad29e01c9d2ddb9fecb (diff)
downloadcrawl-ref-5ee2d78f0c0e0025939bbd8eafed5eec35b1d3a0.tar.gz
crawl-ref-5ee2d78f0c0e0025939bbd8eafed5eec35b1d3a0.zip
Show manual bonuses with crosstraining.
Use lightgreen to contrast with the green for crosstraining. Two crosstraining bonuses plus a manual is a +12 aptitude; display this as just "12" to fit. Antitraining plus manual is shown with a lightgreen skill name and a magenta "-0".
Diffstat (limited to 'crawl-ref/source/skill_menu.cc')
-rw-r--r--crawl-ref/source/skill_menu.cc46
1 files changed, 32 insertions, 14 deletions
diff --git a/crawl-ref/source/skill_menu.cc b/crawl-ref/source/skill_menu.cc
index 6d298ee913..fcd7d8a52b 100644
--- a/crawl-ref/source/skill_menu.cc
+++ b/crawl-ref/source/skill_menu.cc
@@ -269,6 +269,12 @@ COLORS SkillMenuEntry::get_colour() const
return YELLOW;
else if (!you.training[m_sk])
return DARKGREY;
+ else if (you.manual_skill == m_sk)
+ {
+ if (is_set(SKMF_APTITUDE))
+ return LIGHTGREEN;
+ return you.train[m_sk] ? LIGHTGREEN : GREEN;
+ }
else if (crosstrain_bonus(m_sk) > 1 && is_set(SKMF_APTITUDE))
return GREEN;
else if (is_antitrained(m_sk) && is_set(SKMF_APTITUDE))
@@ -304,10 +310,16 @@ void SkillMenuEntry::set_aptitude()
{
std::string text = "<red>";
+ const bool manual = you.manual_skill == m_sk;
const int apt = species_apt(m_sk, you.species);
- const int ct_bonus = crosstrain_bonus(m_sk);
const bool show_all = m_skm->get_state(SKM_SHOW) == SKM_SHOW_ALL;
+ // Crosstraining + manuals aptitude bonus.
+ int ct_bonus = manual ? 4 : 0;
+
+ for (int ct_mult = crosstrain_bonus(m_sk); ct_mult > 1; ct_mult /= 2)
+ ct_bonus += 4;
+
if (apt != 0)
text += make_stringf("%+d", apt);
else
@@ -315,27 +327,33 @@ void SkillMenuEntry::set_aptitude()
text += "</red>";
- if (crosstrain_other(m_sk, show_all) || ct_bonus > 1)
- {
- m_skm->set_flag(SKMF_CROSSTRAIN);
- text += "<green>";
- text += crosstrain_other(m_sk, show_all) ? "*" : " ";
-
- if ( ct_bonus > 1)
- text += make_stringf("+%d", ct_bonus * 2);
-
- text += "</green>";
- }
- else if (antitrain_other(m_sk, show_all) || is_antitrained(m_sk))
+ if (antitrain_other(m_sk, show_all) || is_antitrained(m_sk))
{
m_skm->set_flag(SKMF_ANTITRAIN);
text += "<magenta>";
text += antitrain_other(m_sk, show_all) ? "*" : " ";
if (is_antitrained(m_sk))
- text += "-4";
+ text += make_stringf("-%d", ct_bonus - 4);
text += "</magenta>";
}
+ else if (crosstrain_other(m_sk, show_all) || ct_bonus)
+ {
+ m_skm->set_flag(SKMF_CROSSTRAIN);
+ text += manual ? "<lightgreen>" : "<green>";
+ text += crosstrain_other(m_sk, show_all) ? "*" : " ";
+
+ if (ct_bonus)
+ {
+ // Only room for two characters.
+ if (ct_bonus < 10)
+ text += make_stringf("+%d", ct_bonus);
+ else
+ text += make_stringf("%d", ct_bonus);
+ }
+
+ text += manual ? "</lightgreen>" : "</green>";
+ }
m_aptitude->set_text(text);
}