Skip to content

Commit

Permalink
Merge pull request #6707 from Nyt3/combatTrainer-healthcheck
Browse files Browse the repository at this point in the history
[scripts][combat-trainer] Include an optional health check for parasites
  • Loading branch information
MahtraDR authored Sep 29, 2023
2 parents 8f732fd + 7c85bbd commit c37ef0d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions combat-trainer.lic
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,7 @@ class SafetyProcess
Flags.add('ct-itemdropped', '^Your (?<item>.*) falls to your feet\.', '^You cannot maintain your grip on the (?<item>.*), and it falls to the ground!')
Flags.add('ct-germshieldlost', 'It jerks the.* (?<shield>\w+) out of your hands')
Flags.add('active-mitigation', 'You believe you could \b(?<action>\w+) out of the way of the \b(?<obstacle>\w+)')
Flags.add('ct-parasite', 'blood mite on your (?<body_part>.*)\.')
@equipment_manager = equipment_manager
@health_threshold = settings.health_threshold
echo(" @health_threshold: #{@health_threshold}") if $debug_mode_ct
Expand All @@ -1080,6 +1081,7 @@ class SafetyProcess
DRC.fix_standing
check_item_recovery(game_state)
tend_lodged
tend_parasite
active_mitigation
game_state.danger = in_danger?(game_state.danger)
keep_away if !game_state.danger && game_state.retreating?
Expand Down Expand Up @@ -1147,6 +1149,13 @@ class SafetyProcess
Flags.reset('ct-lodged')
end

def tend_parasite
return unless Flags['ct-parasite']

DRC.wait_for_script_to_complete('tendme')
Flags.reset('ct-parasite')
end

def keep_away
return unless Flags['ct-engaged']

Expand Down Expand Up @@ -5322,6 +5331,7 @@ before_dying do
Flags.delete('pouch-full')
Flags.delete('container-full')
Flags.delete('ct-lodged')
Flags.delete('ct-parasite')
Flags.delete('ct-engaged')
Flags.delete('active-mitigation')
Flags.delete('ct-spelllost')
Expand Down

0 comments on commit c37ef0d

Please sign in to comment.