diff --git a/combat-trainer.lic b/combat-trainer.lic index e2467e5cc4..f39f7a8c8e 100644 --- a/combat-trainer.lic +++ b/combat-trainer.lic @@ -174,6 +174,7 @@ class SetupProcess echo('new skill needed for training') if $debug_mode_ct game_state.reset_action_count + @last_exp = -1 # If you're training with summoned moon weapons but you haven't cast the moonblade spell yet # then skip those weapon skills and train something else while we wait for moonblade spell to be cast. @@ -4312,6 +4313,11 @@ class GameState $ranged_skills << 'Brawling' end + @last_exp = -1 + @no_gain_list = Hash.new + @weapons_to_train.each { |skill_name, weapon_name| @no_gain_list[skill_name] = 0 } + echo(" @no_gain_list: #{@no_gain_list}") if $debug_mode_ct + @use_stealth_attacks = settings.use_stealth_attacks echo(" @use_stealth_attacks: #{@use_stealth_attacks}") if $debug_mode_ct @@ -4821,6 +4827,31 @@ class GameState echo("action count: #{@action_count} vs #{@target_action_count}") if $debug_mode_ct echo("skill exp: #{current_exp} vs #{@target_weapon_skill}") if $debug_mode_ct + # gain_check code: logic to account for a weapon that is not gaining any MS at all + + if @gain_check then + if (current_exp <= @last_exp) && (current_exp != 34) then + @no_gain_list[weapon_skill] += 1 + else + @no_gain_list[weapon_skill] = 0 + end + echo("updated @no_gain_list: #{@no_gain_list}") if $debug_mode_ct + + @last_exp = current_exp + + # blacklist skill if it hasn't been gaining for a while + if ((@no_gain_list[weapon_skill] > @gain_check) then + DRC.message("WARNING: Supppressing #{weapon_skill} due to skill not training") + @weapons_to_train.delete(weapon_skill) + return true + end + + # if weapon is at 34, don't black list but do (try to) switch weapons. + if current_exp == 34 then + return true + return + end + @action_count >= @target_action_count || current_exp >= @target_weapon_skill end