Skip to content

Commit

Permalink
Update combat-trainer.lic
Browse files Browse the repository at this point in the history
  • Loading branch information
mdr55 authored Jan 26, 2025
1 parent 5d11dbc commit e752f7e
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions combat-trainer.lic
Original file line number Diff line number Diff line change
Expand Up @@ -4878,25 +4878,25 @@ 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_active && weapon_training.reject { |skill, _| DRSkill.getxp(skill) > @focus_threshold }.empty?
# all weapons above threshold
DRC.message("Focussing on single weapon")
@target_action_count = 1000
@target_increment = 34
@focus_threshold_active = true
return true
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
@focus_threshold_active = false
return true
else
return false
if (@focus_threshold > 10)
if !@focus_threshold_active && weapon_training.reject { |skill, _| DRSkill.getxp(skill) > @focus_threshold }.empty?
# all weapons above threshold
DRC.message("Focussing on single weapon")
@target_action_count = 1000
@target_increment = 34
@focus_threshold_active = true
return true
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
@focus_threshold_active = false
return true
else
return false
end
end
end
@action_count >= @target_action_count || current_exp >= @target_weapon_skill
end

Expand Down

0 comments on commit e752f7e

Please sign in to comment.