Skip to content

Commit

Permalink
Merge pull request #7076 from mdr55/CT-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtraDR authored Jan 27, 2025
2 parents a40751e + ef4b1e4 commit 4b0dd06
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions combat-trainer.lic
Original file line number Diff line number Diff line change
Expand Up @@ -4310,6 +4310,7 @@ class GameState

@target_action_count = settings.combat_trainer_action_count
echo(" @target_action_count: #{@target_action_count}") if $debug_mode_ct
@target_action_count_original = @target_action_count

@dance_threshold = settings.dance_threshold.to_i
echo(" @dance_threshold: #{@dance_threshold}") if $debug_mode_ct
Expand Down Expand Up @@ -4337,6 +4338,7 @@ class GameState

@target_increment = settings.combat_trainer_target_increment
echo(" @target_increment: #{@target_increment}") if $debug_mode_ct
@target_increment_original = @target_increment

@gain_check = settings.combat_trainer_gain_check
echo(" @gain_check: #{@gain_check}") if $debug_mode_ct
Expand Down Expand Up @@ -4945,7 +4947,7 @@ class GameState
# The code will allow CT to focus on a single weapon once we know all weapons are draining;
# the focus means there is no weapon switching costs being incurred.

if (@focus_threshold >= 10)
if (@focus_threshold > 1)
if !@focus_threshold_active && weapon_training.reject { |skill, _| DRSkill.getxp(skill) > @focus_threshold }.empty?
# all weapons above threshold
DRC.message("Focussing on single weapon")
Expand All @@ -4956,8 +4958,8 @@ class GameState
elsif @focus_threshold_active && weapon_training.any? { |skill, _| DRSkill.getxp(skill) < (@focus_threshold / 2) }
# any weapon below threshold/2
DRC.message("Spreading attention to all weapons")
@target_action_count = settings.combat_trainer_action_count
@target_increment = settings.combat_trainer_target_increment
@target_action_count = @target_action_count_original
@target_increment = @target_increment_original
@focus_threshold_active = false
return true
end
Expand Down

0 comments on commit 4b0dd06

Please sign in to comment.