(0025475)
floatingatoll (reporter)
2014-03-06 03:17
edited on: 2014-03-06 03:18
|
I debugged further; this issue is due to "if (crosstrain_other(m_sk, show_all))" returning false, and thus not placing the green * for the skill responsible for the crosstraining.
This change fixes the skill menu to correctly show the green *:
for (unsigned int i = 0; i < crosstrain_skills.size(); ++i)
if (you.skill(crosstrain_skills[i], 10, true)
- <= you.skill(sk, 10, true) - CROSSTRAIN_THRESHOLD
- && (you.skills[crosstrain_skills[i]] > 0 || show_zero))
+ <= you.skill(sk, 10, true) - CROSSTRAIN_THRESHOLD)
{
return true;
And that's probably a bad idea, since there's actually a show_all boolean specifically for this:
const bool show_all = skm.get_state(SKM_SHOW) == SKM_SHOW_ALL;
Which, if I read this right, is only enabled when the skill menu is set to show *all* skills, not just the ones available for training.
And sure enough, pressing '*' to change to "Show: all" results in the green * being displayed correctly.
So, when crafting an entry for the skill menu, the _bonus functions need to be provided show_all = true *rather than* whatever the skill menu's SHOW_ALL value is.
And so these two changes repair the skill menu to correctly indicate the source of crosstraining, without altering any of the actual skill code.
@@ -349,12 +349,12 @@ void SkillMenuEntry::set_aptitude()
- if (antitrain_other(m_sk, show_all))
+ if (antitrain_other(m_sk, true))
...
- else if (crosstrain_other(m_sk, show_all))
+ else if (crosstrain_other(m_sk, true))
|
(0025478)
floatingatoll (reporter)
2014-03-06 03:48
|
bh helped me repro this on webtiles, and |amethyst notes that it requires the source of the crosstraining (Slings, for instance) to be 0 (or less than 1, I think?).
antitrain_other() and crosstrain_other() are only used by the skillmenu, so they could be altered to do the right thing if needed.
my idea of adding , true breaks if Throwing is 2.0 and Slings is not available to train.
I tried to do this:
~ && (you.skills[crosstrain_skills[i]] > 0 || show_zero || you.skills[crosstra
in_skills[i]].can_train))
But it turns out that you can't just call methods on a skill integer value (wishful thinking, fail). |
(0025482)
floatingatoll (reporter)
2014-03-06 04:00
|
The addition of a you.can_train test:
&& (you.skills[crosstrain_skills[i]] > 0 || you.can_train[crosstrain_skills[i]] || show_z
ero))
Fixes the issue correctly for every test I've come across so far (Long 2.1, Short 0.0, carrying or not a short sword).
|amethyst is working out a patch that moves this crosstrain_other() function, which is only used by the skill menu, into the skill_menu.cc code to make better use of the 'should I show a skill or not' function for this. That's beyond my skill level, but I agree anyways :) |