Skip to content

Commit

Permalink
Update combat-trainer.lic
Browse files Browse the repository at this point in the history
mdr55 authored Jan 22, 2025
1 parent 1a66c5c commit b73b1b8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions combat-trainer.lic
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b73b1b8

Please sign in to comment.