Skip to content

Commit ee009a7

Browse files
committed
A more classic - yet improved - LRS
1 parent 00ca518 commit ee009a7

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

ErrorCollision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class ErrorEnterpriseCollision(Exception):
22
'''
3-
... because some problems simpy have to wait ... =)
3+
... because some problems simply have to wait ... =)
44
'''
55
def __init__(self, glyph):
66
super().__init__()

ShipEnterprise.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from AbsShip import AbsShip
33
from ShipStarbase import ShipStarbase
44
from Quadrant import Quadrant
5+
import Glyphs
56

67
class ShipEnterprise(AbsShip):
78

@@ -120,26 +121,27 @@ def long_range_scan(self, game):
120121
game.display(Quips.jibe_damage('Long Ranged Scanners'))
121122
game.display()
122123
return
123-
sb = ""
124+
124125
pw_sector = game.game_map.sector
125-
if pw_sector < 5:
126-
pw_sector = 6
127-
elif pw_sector > 59:
128-
pw_sector = 59
129-
dots = None
130-
for peek in range(pw_sector-5, pw_sector + 6):
126+
if pw_sector < 4:
127+
pw_sector = 5
128+
elif pw_sector > 60:
129+
pw_sector = 60
130+
lines = []
131+
for peek in range(pw_sector-4, pw_sector + 5):
131132
quad = game.game_map.scan_quad(peek)
132-
lines = \
133-
(f"| Sector: {quad.number:>02}",
134-
f"Enemies: {quad.klingons:>02}",
135-
f"Bases: {quad.starbases:>02}",
136-
f"Stars: {quad.stars:>03} |")
137-
str_ = ' | '.join(lines)
138-
dots = '-' * len(str_) + "\n"
139-
sb += dots
140-
sb += str_
141-
game.display(sb)
142-
sb = ""
133+
lines.append(f"SEC: {quad.number:>03}")
134+
lines.append(f"{Glyphs.KLINGON}: {quad.klingons:>03}")
135+
lines.append(f"{Glyphs.STARBASE}: {quad.starbases:>03}")
136+
lines.append(f"{Glyphs.STAR}: {quad.stars:>03}")
137+
dots = ' +' + ('-' * 35) + '+'
138+
game.display(dots)
139+
game.display(' | LONG RANGE SCAN |')
143140
game.display(dots)
141+
for ss in range(0,(len(lines)-1),12):
142+
for offs in range(4):
143+
line = f' | {lines[ss+offs]:<9} | {lines[ss+4+offs]:<9} | {lines[ss+8+offs]:<9} |'
144+
game.display(line)
145+
game.display(dots)
144146
game.display()
145147

TrekStrings.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,9 @@
9898

9999
HELM_CMDS = [
100100
"--- Commands -----------------",
101-
"nav = Warp Speed srs = Short Range Scan",
102-
"sub = Sublight Speed lrs = Long Range Scan",
103-
"pha = Phasers tor = Photon Torpedos",
104-
"she = Shields com = Access Computer",
105-
"qui = Quit",
101+
"nav = Warp Speed srs = Short Range Scan tor = Photon Torpedos",
102+
"sub = Sublight Speed lrs = Long Range Scan pha = Phasers",
103+
"qui = Quit com = Access Computer she = Shields",
106104
]
107105

108106
CPU_CMDS = [

0 commit comments

Comments
 (0)