Skip to content

Commit aa07e4d

Browse files
authored
fix(combat-trainer): use modern telescope API to prevent telescope stuck in hand (elanthia-online#7323)
1 parent 8f35db0 commit aa07e4d

1 file changed

Lines changed: 8 additions & 21 deletions

File tree

combat-trainer.lic

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3088,6 +3088,9 @@ class TrainerProcess
30883088
@have_telescope = settings.have_telescope
30893089
echo(" @have_telescope: #{@have_telescope}") if $debug_mode_ct
30903090

3091+
@telescope_name = settings.telescope_name
3092+
echo(" @telescope_name: #{@telescope_name}") if $debug_mode_ct
3093+
30913094
@astrology_prediction_skills_survival = settings.astrology_prediction_skills['survival']
30923095
echo(" @astrology_prediction_skills_survival: #{@astrology_prediction_skills_survival}") if $debug_mode_ct
30933096

@@ -3493,14 +3496,7 @@ class TrainerProcess
34933496
def check_heavens(game_state)
34943497
@equipment_manager.stow_weapon(game_state.weapon_name)
34953498
if @have_telescope
3496-
case DRCMM.get_telescope(@telescope_storage)
3497-
when 'You get a', 'You untie', 'You remove'
3498-
determine_time
3499-
when 'You need a free hand to pick that up.'
3500-
return
3501-
when 'You are already holding that.'
3502-
determine_time
3503-
end
3499+
determine_time if DRCMM.get_telescope?(@telescope_name, @telescope_storage)
35043500
else
35053501
determine_time
35063502
end
@@ -3519,12 +3515,8 @@ class TrainerProcess
35193515

35203516
def center(target)
35213517
if @have_telescope
3522-
case DRCMM.center_telescope(target)
3523-
when "That's a bit tough to do when you can't see the sky", 'Your search for', "You must have both hands free"
3524-
DRCMM.store_telescope(@telescope_storage)
3525-
else
3526-
observe
3527-
end
3518+
DRCMM.center_telescope(target)
3519+
observe
35283520
else
35293521
fput("observe #{target}")
35303522
check_predict
@@ -3544,18 +3536,13 @@ class TrainerProcess
35443536
full_pool = result.any? { |line| line.match?(Regexp.union(get_data('constellations').observe_full_messages)) }
35453537
injured = result.any? { |line| line.match?(Regexp.union(get_data('constellations').observe_injured_messages)) }
35463538
end
3539+
waitrt?
3540+
DRCMM.store_telescope?(@telescope_name, @telescope_storage)
35473541
case
35483542
when full_pool
3549-
waitrt?
3550-
DRCMM.store_telescope(@telescope_storage)
35513543
check_predict
35523544
when injured
3553-
waitrt?
3554-
DRCMM.store_telescope(@telescope_storage)
35553545
@training_abilities.delete('Astro')
3556-
else
3557-
waitrt?
3558-
DRCMM.store_telescope(@telescope_storage)
35593546
end
35603547
end
35613548

0 commit comments

Comments
 (0)