Skip to content

Commit

Permalink
Merge pull request #6809 from MahtraDR/common_moonmage_reconcile
Browse files Browse the repository at this point in the history
[scripts][common-moonmage] De-duplicating code
  • Loading branch information
MahtraDR authored May 3, 2024
2 parents 90f39f9 + 4f5835f commit 6e8a8fa
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions common-moonmage.lic
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,23 @@ module DRCMM
end

def center_telescope(target)
DRC.bput("center telescope on #{target}",
'Center what',
'You put your eye',
'open it to make any use of it',
'The pain is too much',
"That's a bit tough to do when you can't see the sky",
"You would probably need a periscope to do that",
'Your search for',
'Your vision is too fuzzy',
'You must have both hands free')
case DRC.bput("center telescope on #{target}",
'Center what',
'You put your eye',
'open it to make any use of it',
'The pain is too much',
"That's a bit tough to do when you can't see the sky",
"You would probably need a periscope to do that",
'Your search for',
'Your vision is too fuzzy',
"You'll need to open it to make any use of it",
'You must have both hands free')
when 'The pain is too much', "That's a bit tough to do when you can't see the sky"
echo("Planet #{target} not visible. Are you indoors perhaps?")
when "You'll need to open it to make any use of it"
fput("open my telescope")
fput("center telescope on #{target}")
end
end

def align(skill)
Expand Down Expand Up @@ -300,10 +307,7 @@ module DRCMM
observed_planets = []

planets.each do |planet|
case DRC.bput("center telescope on #{planet}", 'You put your eye', 'The pain is too much', "That's a bit tough to do when you can't see the sky")
when 'The pain is too much', "That's a bit tough to do when you can't see the sky"
break
end
center_telescope(planet)
observed_planets << planet unless Flags['planet-not-visible']
Flags.reset('planet-not-visible')
end
Expand Down

0 comments on commit 6e8a8fa

Please sign in to comment.