_PALETTECOLOR 1, _RGB32(255, 255, 255)
COLOR 0, 1
fontpath$ = ENVIRON$("SYSTEMROOT") + "\fonts\LiberationMono-Bold.ttf" 'Find Windows Folder Path.
fontpath$ = ENVIRON$("SYSTEMROOT") + "\fonts\DroidSansMono.ttf" 'Find Windows Folder Path.
'fontpath$ = ENVIRON$("SYSTEMROOT") + "\fonts\consolab.ttf" 'Find Windows Folder Path.
'fontpath$ = ENVIRON$("SYSTEMROOT") + "\fonts\ARLRDBD.ttf" 'Find Windows Folder Path.
'fontpath$ = "cyberbit.ttf"
'fontpath$ = "consola.ttf"
style$ = "MONOSPACE, BOLD, ITALIC"
font& = _LOADFONT(fontpath$, 22, style$)
_FONT font&



CLS
OPEN "ship.dat" FOR INPUT AS #1
INPUT #1, x$, Ship$
INPUT #1, x$, Depth
INPUT #1, x$, SG$
INPUT #1, x$, Sail$
INPUT #1, x$, Seamanship1
INPUT #1, x$, Seamanship2
INPUT #1, x$, Shipwright1
INPUT #1, x$, Shipwright2
INPUT #1, x$, Hazardrating1
INPUT #1, x$, Hazardrating2
INPUT #1, x$, Hullfactor
INPUT #1, x$, hdamage
INPUT #1, x$, Tightness
INPUT #1, x$, Tdamage
INPUT #1, x$, Rigging
INPUT #1, x$, Rdamage

CLOSE #1

ships = 41

DIM ShipType$(ships), Depth(ships), SG$(ships), OG$(ships), HF(ships), TGT(ships), RF(ships), Sail$(ships)
ShipType$(0) = Ship$
Depth(0) = Depth
SG$(0) = SG$
OG$(0) = OG$
HF(0) = Hullfactor
TGT(0) = Tightness
RF(0) = Rigging
Sail$(0) = Sail$

FOR i = 0 TO ships:
    IF i > 0 THEN READ ShipType$(i), Depth(i), SG$(i), OG$(i), HF(i), TGT(i), RF(i), Sail$(i)
    PRINT USING "##. "; i;
    PRINT ShipType$(i); SPC(14 - LEN(ShipType$(i)));
    PRINT LEFT$(Sail$(i), 1); "-"; SG$(i);
    'PRINT Sail$(i); SPC(6 - LEN(Sail$(i)));

    '    PRINT USING "###% "; (Depth(i) - 5) * 5;
    PRINT "     ";
    ix = i + 1
    IF INT(ix / 3) = ix / 3 THEN PRINT
NEXT
DATA "Pinda 12",2,"C","B",75,56,67,"Venyn"
DATA "Pinda 15",2.4,"C","B",75,56,67,"Venyn"
DATA "Pinda 18",2.8,"C","B",75,56,68,"Venyn"
DATA "Pinda 21",3.2,"C","B",75,56,68,"Venyn"

DATA "Talbar 24",3,"D","D",60,56,68,"Square"
DATA "Talbar 30",3,"D","D",60,56,69,"Square"
DATA "Talbar 36",4,"D","D",60,56,70,"Square"
DATA "Talbar 42",5,"D","D",60,56,70,"Square"

DATA "Nivik 24",4,"C","-",65,57,68,"Square"
DATA "Nivik 36",4,"C","-",65,58,69,"Square"
DATA "Nivik 48",8,"C","-",65,58,70,"Square"
DATA "Nivik 60",10,"C","-",65,59,71,"Square"

DATA "Warboat 60",5,"B","C",75,57,74,"Square"
DATA "Warboat 80",6,"B","C",75,57,75,"Square"
DATA "Longship 100",8,"B","C",75,58,77,"Square"
DATA "Dragonship 120",10,"B","C",75,59,78,"Square"

DATA "Dak 48",10,"D","-",70,76,71,"Square"
DATA "Dak 60",13,"D","-",70,78,73,"Square"
DATA "Dak 64",14,"D","-",84,80,82,"Square"
DATA "Dak 72",16,"D","-",70,80,75,"Square"
DATA "Dak 84",19,"D","-",70,81,76,"Square"

DATA "Karune 60",11,"C","-",65,77,67,"Mixed"
DATA "Karune 72",13,"C","-",65,79,69,"Mixed"
DATA "Karune 84",15,"C","-",65,80,70,"Mixed"
DATA "Karune 96",17,"C","-",65,82,72,"Mixed"

DATA "Venar 24",4,"C","-",55,57,58,"Venyn"
DATA "Venar 36",6,"C","-",55,57,59,"Venyn"
DATA "Venar 48",8,"C","-",55,58,60,"Venyn"
DATA "Venar 60",10,"C","-",55,59,62,"Venyn"

DATA "Raem 48",9,"D","-",60,69,61,"Venyn"
DATA "Raem 60",11,"D","-",60,69,62,"Venyn"
DATA "Raem 72",13,"D","-",60,70,63,"Venyn"
DATA "Raem 84",15,"D","-",60,71,65,"Venyn"

DATA "Laru 60",5,"C","B",60,57,59,"Venyn"
DATA "Laru 90",7,"C","B",60,58,61,"Venyn"
DATA "Laru120",10,"C","B",60,59,63,"Venyn"
DATA "Laru150",12,"C","B",60,60,65,"Venyn"

DATA "Larumamar  60",6,"C","C",55,67,60,"Venyn"
DATA "Larumamar  90",9,"C","C",55,68,63,"Venyn"
DATA "Larumamar 120",12,"C","C",55,70,65,"Venyn"
DATA "Larumamar 150",15,"C","C",55,71,68,"Venyn"

DATA "Indathik 18",2.1,"D","D",80,71,67,"Square"
DATA "Indathik 21",2.5,"D","D",80,71,68,"Square"
DATA "Indathik 24",2.9,"D","D",80,71,68,"Square"
DATA "Indathik 27",3.2,"D","D",80,72,68,"Square"

DATA "Skarth 25",2.5,"B","C",60,61,67,"Square"
DATA "Skarth 30",3.0,"B","C",60,62,67,"Square"
DATA "Skarth 35",3.5,"B","C",60,62,67,"Square"
DATA "Skarth 40",4.0,"B","C",60,62,68,"Square"


'Hullfactor = 84: hdamage = 28
'Tightness = 80: tdamage = 26
'Rigging = 82: rdamage = 27

PRINT: PRINT
INPUT " Choose a shiptype "; ship
SG$ = SG$(ship)
Tightness = TGT(ship)
Rigging = RF(ship)
Ship$ = ShipType$(ship)
Sail$ = Sail$(ship)
Hullfactor = HF(ship)
Detph = (Depth(ship) - 5) * 5

CLS
PRINT " "; Ship$; ", "; Sail$; "rigged, Sailgrade : "; SG$; ", Port Watch"
PRINT
IF ship = 0 GOTO 2
INPUT " Seamanship   ", Seamanship1
INPUT " Shipwright   ", Shipwright1
INPUT " Hazardrating ", Hazardrating1

IF Seamanship1 = 0 THEN Seamanship1 = 62
IF Shipwright1 = 0 THEN Shipwright1 = 48
IF Hazardrating1 = 0 THEN Hazardrating1 = 91

PRINT
PRINT " Starboard Watch"
PRINT
INPUT " Seamanship   ", Seamanship2
INPUT " Shipwright   ", Shipwright2
INPUT " Hazardrating ", Hazardrating2

IF Seamanship2 = 0 THEN Seamanship2 = 72
IF Shipwright2 = 0 THEN Shipwright2 = 48
IF Hazardrating2 = 0 THEN Hazardrating2 = 67




2 GOTO 3
PRINT Seamanship1
PRINT Seamanship2
PRINT Shipwright1
PRINT Shipwright2
PRINT Hazardrating1
PRINT Hazardrating2
PRINT Hullfactor
PRINT hdamage
PRINT Tightness
PRINT Tdamage
PRINT Rigging
PRINT Rdamage

INPUT a$











3



DIM month$(12), season(12)
month$(1) = "Nuzyael": season(1) = 1
month$(2) = "Peonu": season(2) = 1
month$(3) = "Kelen": season(3) = 1
month$(4) = "Nolus": season(4) = 2
month$(5) = "Larane": season(5) = 2
month$(6) = "Agrazhar": season(6) = 2
month$(7) = "Azura": season(7) = 3
month$(8) = "Halane": season(8) = 3
month$(9) = "Savor": season(9) = 3
month$(10) = "Ilvin": season(10) = 4
month$(11) = "Navek": season(11) = 4
month$(12) = "Morgat": season(12) = 4

CLS: PRINT "Choose Month and Day": PRINT
FOR i = 1 TO 12
    PRINT USING "##. "; i,
    PRINT month$(i)
NEXT: PRINT
INPUT " Month     : ", month: IF month = 0 THEN month = 3
SEASON = season(month)
INPUT " Day       : ", monthday: IF monthday = 0 THEN monthday = 30
INPUT " Watch 1-6 : ", watch: IF watch = 0 THEN watch = 3

'Spring: Nuzyael, Peonu, Kelen
'Summer: Nolus, Larane, Agrazhar
'Autumn: Azura, Halane, Savor
'Winter: Ilvin, Navek, Morgat


DIM row(4, 20), DTEMP$(4, 20), NTEMP$(4, 20), cloud(4, 20), Wind$(4, 20), W1(4, 20), W2(4, 20), special$(4, 20)
DIM force$(4), season$(4)
4
' Spring
spring = 1
DATA 1,"cold","cold",2,"N",1,3,"Sleet"
DATA 2,"cool","cool",1,"NE",1,3,""
DATA 3,"warm","warm",0,"SE",0,2,"Fog"
DATA 4,"warm","warm",1,"SW",1,3,"Light rain"
DATA 5,"cool","cool",2,"NW",2,4,"Light rain"
DATA 6,"cold","cold",2,"NW",2,4,"Hail"
DATA 7,"cold","freezing",1,"SW",1,3,""
DATA 8,"cool","cool",1,"SW",1,3,""
DATA 9,"cold","cold",1,"NW",1,3,""
DATA 10,"freezing","freezing",1,"N",0,2,"Fog"
DATA 11,"cold","freezing",0,"N",1,3,""
DATA 12,"cool","freezing",1,"NE",1,3,""
DATA 13,"warm","cool",0,"SE",0,2,"Fog"
DATA 14,"hot","warm",0,"S",0,2,"Fog"
DATA 15,"warm","warm",1,"SW",0,2,"THUNDERSTORM"
DATA 16,"cool","cold",0,"NW",1,3,""
DATA 17,"cool","cool",1,"SW",2,4,"Light rain"
DATA 18,"cool","cool",2,"SW",2,4,"Heavy rain"
DATA 19,"cold","cold",1,"NW",2,4,"Sleet"
DATA 20,"cold","cold",2,"NW",1,3,""
'Summer
DATA 1,"cool","cool",1,"N",0,2,""
DATA 2,"warm","warm",1,"NE",0,2,"Light rain"
DATA 3,"hot","cool",0,"SE",0,2,""
DATA 4,"hot","warm",0,"S",0,2,""
DATA 5,"warm","warm",1,"SW",0,2,"THUNDERSTORM"
DATA 6,"warm","cool",1,"S",0,2,""
DATA 7,"cool","cool",2,"SW",1,3,"Heavy rain"
DATA 8,"cool","cool",2,"NW",2,4,"Light rain"
DATA 9,"warm","cool",1,"SW",1,3,""
DATA 10,"warm","cool",0,"NW",1,3,""
DATA 11,"warm","cool",0,"N",1,3,""
DATA 12,"hot","cool",0,"NE",0,2,"Fog"
DATA 13,"hot","warm",1,"SE",0,2,"THUNDERSTORM"
DATA 14,"warm","cool",1,"S",0,2,""
DATA 15,"warm","warm",1,"SW",0,2,""
DATA 16,"warm","cool",1,"SW",1,3,""
DATA 17,"cool","cool",2,"SW",2,4,""
DATA 18,"cool","cool",2,"SW",1,3,"Light rain"
DATA 19,"cool","cool",2,"SW",2,4,"Heavy rain"
DATA 20,"cold","cold",2,"NW",0,2,"Heavy rain"
'Autumn
DATA 1,"cool","cold",1,"N",0,2,"Fog"
DATA 2,"warm","cool",1,"N",0,2,""
DATA 3,"warm","cool",0,"NE",0,2,"Fog"
DATA 4,"hot","warm",0,"SE",0,2,"Fog"
DATA 5,"hot","warm",1,"S",0,2,"THUNDERSTORM"
DATA 6,"warm","warm",2,"SW",0,2,"Light rain"
DATA 7,"cool","cool",2,"NW",1,3,"Heavy Rain"
DATA 8,"cold","cold",2,"SW",1,3,"Heavy Rain"
DATA 9,"cold","cold",2,"NW",2,4,"Heavy Rain"
DATA 10,"cold","cold",2,"NW",1,3,""
DATA 11,"cold","cold",2,"N",2,4,""
DATA 12,"cool","cool",2,"NE",1,3,"Light rain"
DATA 13,"warm","cool",1,"SE",0,2,"Fog"
DATA 14,"cool","cool",2,"S",1,3,"Heavy Rain"
DATA 15,"cool","cool",2,"SW",2,4,""
DATA 16,"warm","cool",1,"S",1,3,"Light rain"
DATA 17,"warm","cool",0,"SW",1,3,""
DATA 18,"cool","cold",1,"NW",2,4,""
DATA 19,"cold","freezing",2,"SW",2,4,"Sleet"
DATA 20,"freezing","freezing",1,"NW",1,3,""
'Winter
DATA 1,"cold","freezing",2,"N",0,2,"Snow"
DATA 2,"freezing","freezing",2,"NW",1,3,"Sleet"
DATA 3,"cold","cold",2,"N",2,4,""
DATA 4,"cool","cold",1,"NE",1,3,""
DATA 5,"warm","cold",0,"SE",0,2,"Fog"
DATA 6,"cool","freezing",2,"S",0,2,"Light rain"
DATA 7,"cold","cold",2,"SW",1,3,"Heavy Rain"
DATA 8,"cold","cold",2,"NW",0,2,"Sleet"
DATA 9,"cool","cool",2,"SW",1,3,"Light rain"
DATA 10,"cold","cold",2,"NW",1,3,"Sleet"
DATA 11,"cold","cold",2,"N",2,4,"Snow"
DATA 12,"freezing","freezing",2,"N",1,3,""
DATA 13,"cool","freezing",0,"NE",2,4,""
DATA 14,"cool","cold",1,"SE",1,3,""
DATA 15,"cold","freezing",0,"S",1,3,""
DATA 16,"cool","cold",2,"SW",2,4,"Light rain"
DATA 17,"cold","freezing",2,"NW",1,3,"Snow"
DATA 18,"cold","cold",2,"SW",2,4,"Sleet"
DATA 19,"cold","cold",1,"SW",1,3,"Hail"
DATA 20,"cold","cold",2,"NW",1,3,""


DATA "Calm","Light Wind","Steady Wind","Gale","Storm"
DATA "Spring","Summer","Autumn","Winter"


RESTORE 4
FOR i = 1 TO 4
    FOR j = 1 TO 20
    READ row(i, j), DTEMP$(i, j), NTEMP$(i, j), cloud(i, j), Wind$(i, j), W1(i, j), W2(i, j), special$(i, j): NEXT
NEXT
FOR i = 0 TO 4: READ force$(i): NEXT
FOR i = 1 TO 4: READ season$(i): NEXT
9 RESTORE 9
DIM sailgrade$(5)
DIM SquareR(5), SquareH(5), SquareB(5)
DIM MixedR(5), MixedH(5), MixedB(5)
DIM VenynR(5), VenynH(5), VenynB(5)
DIM oar(5)
'sailing Table
DATA "A",2,7,12,2,6,10,3,5,8,2
DATA "B",2,8,15,3,7,12,4,6,9,3
DATA "C",3,9,18,4,8,14,4,7,10,4
DATA "D",4,10,21,4,9,16,5,8,11,5
DATA "E",4,11,24,5,10,18,5,9,12,6
FOR i = 1 TO 5
    READ sailgrade$(i)
    READ SquareR(i), SquareH(i), SquareB(i)
    READ MixedR(i), MixedH(i), MixedB(i)
    READ VenynR(i), VenynH(i), VenynB(i)
    READ oar(i)
NEXT
IF SG$ = "A" THEN SX = 1
IF SG$ = "B" THEN SX = 2
IF SG$ = "C" THEN SX = 3
IF SG$ = "D" THEN SX = 4
IF SG$ = "E" THEN SX = 5

IF Sail$ = "Square" THEN SailRun = SquareR(SX): SailHaul = SquareH(SX): SailBeat = SquareB(SX)
IF Sail$ = "Mixed" THEN SailRun = MixedR(SX): SailHaul = MixedH(SX): SailBeat = MixedB(SX)
IF Sail$ = "Venyn" THEN SailRun = VenynR(SX): SailHaul = VenynH(SX): SailBeat = VenynB(SX)

DIM watch$(6)
watch$(1) = "Middle"
watch$(2) = "Morning"
watch$(3) = "Forenoon"
watch$(4) = "Afternoon"
watch$(5) = "Evening"
watch$(6) = "Night"


NOW = INT(RND * 20) + 1
day = 1: watch = 3


10 'Beginn of Watch

IF INT(watch / 2) = watch / 2 THEN GOTO 11

Seamanship = Seamanship1
Shipwright = Shipwright1
Hazardrating = Hazardrating1
GOTO 12

11
Seamanship = Seamanship2
Shipwright = Shipwright2
Hazardrating = Hazardrating2

12




day = 0
IF watch = 1 THEN day = 0
IF watch = 2 THEN day = .1
IF watch = 2 AND SEASON = 2 THEN day = 1
IF watch = 2 AND saeson = 4 THEN day = 0
IF watch = 3 THEN day = 1
IF watch = 4 THEN day = 1
IF watch = 5 THEN day = .9
IF watch = 5 AND SEASON = 2 THEN day = 1
IF watch = 5 AND saeson = 4 THEN day = 0
IF watch = 6 THEN day = 0

light$ = "Daylight": temperature$ = DTEMP$(SEASON, NOW):
IF day = 0 THEN light$ = "Night": temperature$ = NTEMP$(SEASON, NOW)
IF day = .1 THEN light$ = "Sunrise": IF NTEMP$(SEASON, NOW) <> DTEMP$(SEASON, NOW) THEN temperature$ = NTEMP$(SEASON, NOW) + " later " + DTEMP$(SEASON, NOW)
IF day = .9 THEN light$ = "Sunset": IF NTEMP$(SEASON, NOW) <> DTEMP$(SEASON, NOW) THEN temperature$ = DTEMP$(SEASON, NOW) + " later " + NTEMP$(SEASON, NOW)

IF cloud(SEASON, NOW) = 0 THEN cloud$ = "clear skies"
IF cloud(SEASON, NOW) = 1 THEN cloud$ = "cloudy skies"
IF cloud(SEASON, NOW) = 2 THEN cloud$ = "overcast"
SailNT = 0
SailNE = 0
SailSE = 0
SailST = 0
SailSW = 0
SailNW = 0

Sailing = SailRun
IF Wind$(SEASON, NOW) = "N" THEN wind$ = " from the North.": SailNT = SailBeat: SailNE = SailHaul: SailNW = SailHaul
IF Wind$(SEASON, NOW) = "NW" THEN wind$ = " from the Northwest.": SailNW = SailBeat: SailNT = SailHaul: SailSW = SailHaul
IF Wind$(SEASON, NOW) = "NE" THEN wind$ = " from the Northeast.": SailNE = SailBeat: SailNT = SailHaul: SailSE = SailHaul
IF Wind$(SEASON, NOW) = "S" THEN wind$ = " from the South.": SailST = SailBeat: SailSE = SailHaul: SailSW = SailHaul
IF Wind$(SEASON, NOW) = "SW" THEN wind$ = " from the Southwest.": SailSW = SailBeat: SailST = SailHaul: SailNW = SailHaul
IF Wind$(SEASON, NOW) = "SE" THEN wind$ = " from the Southeast.": SailSE = SailBeat: SailNE = SailHaul: SailST = SailHaul
IF SailNT = 0 THEN SailNT = SailRun
IF SailNE = 0 THEN SailNE = SailRun
IF SailSE = 0 THEN SailSE = SailRun
IF SailST = 0 THEN SailST = SailRun
IF SailSW = 0 THEN SailSW = SailRun
IF SailNW = 0 THEN SailNW = SailRun



wind = W1(SEASON, NOW)
force = INT(RND * 6) + 1

50 'Sheltered
IF a$ <> "S" THEN GOTO 55
location$ = "Sheltered Coast": local$ = "C"
blow = W1(SEASON, NOW)
IF force > 2 THEN blow = blow + 1
IF force > 4 THEN blow = W2(SEASON, NOW)
GOTO 80

55 'Dangerous
IF a$ <> "R" THEN GOTO 60
location$ = "Dangerous Coast": local$ = "R"
blow = W1(SEASON, NOW)
IF force > 2 THEN blow = blow + 1
IF force > 4 THEN blow = W2(SEASON, NOW)
GOTO 80



blow = W1(SEASON, NOW)
IF force > 2 THEN blow = blow + 1
IF force > 4 THEN blow = W2(SEASON, NOW)
GOTO 80

60 'Inland water
IF a$ <> "I" GOTO 70
location$ = "Inland water": local$ = "I"
blow = W1(SEASON, NOW)

IF force > 3 THEN blow = blow + 1
IF force = 6 THEN blow = W2(SEASON, NOW)
GOTO 80

70 'Open Sea
location$ = "Open Sea": local$ = "O"
blow = W1(SEASON, NOW)
IF force > 1 THEN blow = blow + 1
IF force > 3 THEN blow = W2(SEASON, NOW)

80



wind$ = force$(blow) + wind$: IF blow = 0 THEN wind$ = "No wind."

special$ = special$(SEASON, NOW)
IF special$ = "Fog" AND blow = 0 THEN cloud$ = "Dense fog, no sky visible"
IF special$ = "Fog" AND blow > 0 THEN special$ = ""
IF special$ = "Hail" AND INT(RND * 10) + 1 <> 1 THEN special$ = ""
IF special$ = "THUNDERSTORM" AND INT(RND * 10) + 1 <> 1 THEN special$ = ""

sqfactor = 4
IF (Rigging - Rdamage) / Rigging < .8 THEN sqfactor = 3
IF (Rigging - Rdamage) / Rigging < .6 THEN sqfactor = 2
IF (Rigging - Rdamage) / Rigging < .4 THEN sqfactor = 1

CLS
PRINT USING " ##. "; monthday; 'NOW;
PRINT month$(month); "-"; season$(SEASON); ", ";
PRINT watch$(watch); "watch, "; light$; ", "; cloud$; ", ";
PRINT temperature$; "."


tabh = 2: tabv = 3
LOCATE tabv, tabh
PRINT Ship$; VAL(RIGHT$(Ship$, 3)) * .305; "m"
LOCATE tabv + 1, tabh
PRINT Sail$; "rigged"
LOCATE tabv + 2, tabh
PRINT "Sailgrade "; SG$;: PRINT USING "##/##/##"; SailRun; SailHaul; SailBeat






tabh = 26: tabv = 3
LOCATE tabv, tabh
PRINT USING "Hull Factor ##/## ###%"; Hullfactor; Hullfactor - hdamage; (Hullfactor - hdamage) / Hullfactor * 100
LOCATE tabv + 1, tabh
PRINT USING "Tightness   ##/## ###%"; Tightness; Tightness - Tdamage; (Tightness - Tdamage) / Tightness * 100
LOCATE tabv + 2, tabh
PRINT USING "Rigging     ##/## ###% SQ#"; Rigging; Rigging - Rdamage; (Rigging - Rdamage) / Rigging * 100; sqfactor
LOCATE tabv + 3, tabh
IF flooding > 0 THEN PRINT USING "Flooding       ## ###%"; flooding; flooding * 10


tabh = 57: tabv = 3
LOCATE tabv, tabh
PRINT "Seamanship   :"; Seamanship
LOCATE tabv + 1, tabh
PRINT "Shipwright   :"; Shipwright
LOCATE tabv + 2, tabh
PRINT "Hazardrating :"; Hazardrating
'PRINT USING " Watch:#"; watch; ' NOW;
LOCATE 7, 1
PRINT " "; location$; ", "; wind$;
IF special$ <> "" THEN PRINT " "; special$; ".";
PRINT

sqfactor = 4
IF (Rigging - Rdamage) / Rigging < .8 THEN sqfactor = 3
IF (Rigging - Rdamage) / Rigging < .6 THEN sqfactor = 2
IF (Rigging - Rdamage) / Rigging < .4 THEN sqfactor = 1


100
'IF blow < 3 THEN PRINT USING " SQ 0-# "; sqfactor: GOTO 110
LOCATE 9, 1
PRINT " SAIL QUARTERS";

FOR j = 0 TO sqfactor: hzg = 0
    PRINT USING "##"; j;
    IF blow > 0 GOTO 101
    IF j < 3 THEN mp = 0
    IF j = 3 THEN mp = 1
    IF j = 4 THEN mp = 2
    IF oar = 1 THEN mp = 4
    GOTO 105
    101
    IF blow > 1 GOTO 102
    mp = j
    IF oar = 1 THEN mp = 3
    GOTO 105
    102
    IF blow > 2 GOTO 103
    mp = j * 2
    IF oar = 1 THEN mp = 2
    GOTO 105
    103
    IF blow > 3 THEN GOTO 104
    IF j = 0 THEN mp = 0: hzg = 25
    IF j = 1 THEN mp = 3: hzg = 5
    IF j = 2 THEN mp = 5: hzg = 10
    IF j = 3 THEN mp = 7: hzg = 15
    IF j = 4 THEN mp = 9: hzg = 20
    IF oar = 1 THEN mp = 0: hzg = 5
    GOTO 105
    104
    IF j = 0 THEN mp = 0: hzg = 50
    IF j = 1 THEN mp = 3: hzg = 10
    IF j = 2 THEN mp = 5: hzg = 20
    IF j = 3 THEN mp = 7: hzg = 30
    IF j = 4 THEN mp = 9: hzg = 40
    IF oar = 1 THEN mp = 0: hzg = 10
    105
    hzg = hzg + flooding * 5
    IF mp / SailRun + .01 > .5 THEN PRINT USING "=#Hex"; mp / SailRun + .01; ELSE PRINT "/-";


    IF blow > 2 THEN PRINT USING " ##%,"; Hazardrating - hzg;

NEXT:
IF blow = 3 THEN PRINT USING " (A)nchor=##%"; Hazardrating;
IF blow = 4 THEN PRINT USING " (A)nchor=##%"; Hazardrating - 5;

PRINT: PRINT
PRINT USING " ENTER [0-#"; sqfactor;
IF blow > 2 THEN PRINT ",A";
IF local$ <> "O" THEN PRINT ",G]" ELSE PRINT "]"
hzbase = hzg + flooding * 5 + Detph


110
GOSUB 1000
IF VAL(a$) = 0 AND a$ <> "0" AND a$ <> "G" AND a$ <> "A" THEN GOTO 110


sq = VAL(a$): IF sq > sqfactor GOTO 110
'LOCATE 11, 1
'FOR z = 1 TO 5: PRINT SPC(70): NEXT

LOCATE 11, 1
IF blow > 2 OR a$ = "G" THEN PRINT " Hazardcheck               "
GOSUB 2000

'Repairs
LOCATE 18, 1
IF Rdamage > 0 OR hdamage > 0 OR Tdamage > 0 OR flooding > 0 THEN PRINT " Repaircheck"
GOSUB 3400
'PRINT
'PRINT mp; "Movement points": PRINT

REM PRINT SailRun; SailHaul; SailBeat
tabi = 36: tabih = 10
tabi = 69: tabih = 16
'PRINT " North    ";:
LOCATE tabih, tabi
direc$ = "N ": Sailing = SailNT: GOSUB 1500
'PRINT " Northeast";

LOCATE tabih + 2, tabi + 4
direc$ = "NE": Sailing = SailNE: GOSUB 1500
'PRINT " Southeast";:
LOCATE tabih + 4, tabi + 4
direc$ = "SE": Sailing = SailSE: GOSUB 1500
'PRINT " South    ";
LOCATE tabih + 6, tabi
direc$ = "S ": Sailing = SailST: GOSUB 1500
'PRINT " Southwest";
LOCATE tabih + 4, tabi - 4

direc$ = "SW": Sailing = SailSW: GOSUB 1500
'PRINT " Northwest";
LOCATE tabih + 2, tabi - 4

direc$ = "NW": Sailing = SailNW: GOSUB 1500

LOCATE tabih + 3, tabi: PRINT "<O>";






200 LOCATE 24, 1: PRINT " End of "; watch$(watch); "watch (I)nland, (S)heltered coast, (R)eef coast, (O)pen Sea";
GOSUB 1000: local$ = "": IF a$ <> "I" AND a$ <> "S" AND a$ <> "O" AND a$ <> "R" THEN local$ = a$: GOTO 200



change = INT(RND * 10) + 1
IF change = 1 THEN NOW = NOW + 1
IF change > 7 THEN NOW = NOW - 1
IF change = 10 THEN NOW = NOW - 1
IF NOW < 1 THEN NOW = 20
IF NOW > 20 THEN NOW = 1
watch = watch + 1
IF watch = 7 THEN watch = 1: monthday = monthday + 1
IF monthday > 30 THEN monthday = 1: month = month + 1
IF month > 12 THEN month = 1
SEASON = season(month)
GOTO 10







































1000 a$ = UCASE$(INKEY$): IF a$ = "" GOTO 1000
'IF a$ = "Q" THEN END
'IF a$ = "R" THEN RUN

RETURN


1500 'move in hexes
hex = mp / Sailing
'PRINT USING "## ##.## ## "; Sailing; hex; CINT(hex + .01);
'direc$="  "
PRINT direc$;
PRINT USING "#"; hex + .01
RETURN

2000 'Movement points and hazards
mp = 0: hzg = 0: target = 0
IF a$ = "A" THEN GOTO 2300

IF a$ = "G" THEN GOTO 2500

IF blow > 0 GOTO 2100
IF sq < 3 THEN mp = 0
IF sq = 3 THEN mp = 1
IF sq = 4 THEN mp = 2
IF oar = 1 THEN mp = 4
RETURN

2100
IF blow > 1 GOTO 2200
mp = sq
IF oar = 1 THEN mp = 3
RETURN

2200
IF blow > 2 GOTO 2300
mp = sq * 2
IF oar = 1 THEN mp = 2
RETURN

2300 'Gale
IF blow > 3 THEN GOTO 2400
IF sq = 0 THEN mp = 0: hzg = 25
IF sq = 1 THEN mp = 3: hzg = 5
IF sq = 2 THEN mp = 5: hzg = 10
IF sq = 3 THEN mp = 7: hzg = 15
IF sq = 4 THEN mp = 9: hzg = 20
IF oar = 1 THEN mp = 0: hzg = 5
IF a$ = "A" THEN hzg = 0

hzg = hzg + flooding * 5
result$ = ""
target = Hazardrating - hzg
dieroll = INT(RND * 100) + 1
GOSUB 2800
'PRINT USING "###/## "; dieroll; target;: PRINT drs$; "- ";
IF drs$ = "CS" THEN result$ = "No problems"
IF drs$ = "MS" THEN result$ = "No problems"
IF drs$ = "MF" THEN result$ = "F R C1"
IF drs$ = "CF" THEN result$ = "H F R L C2"
GOSUB 2950

IF result$ = "F R C1" THEN GOSUB 3100: GOSUB 3200: WW = 1: GOSUB 3300
IF result$ = "H F R L C2" THEN GOSUB 3000: GOSUB 3100: GOSUB 3200: WW = 2: GOSUB 3300
RETURN

2400 'Storm
IF sq = 0 THEN mp = 0: hzg = 50
IF sq = 1 THEN mp = 3: hzg = 10
IF sq = 2 THEN mp = 5: hzg = 20
IF sq = 3 THEN mp = 7: hzg = 30
IF sq = 4 THEN mp = 9: hzg = 40
IF oar = 1 THEN mp = 0: hzg = 10
IF a$ = "A" THEN hzg = 5
hzg = hzg + flooding * 5
result$ = ""
target = Hazardrating - hzg
dieroll = INT(RND * 100) + 1
GOSUB 2800
IF drs$ = "CS" THEN result$ = "No problems"
IF drs$ = "MS" THEN result$ = "F R C1"
IF drs$ = "MF" THEN result$ = "F R L C2"
IF drs$ = "CF" THEN result$ = "H F R L C3"
GOSUB 2950
IF result$ = "F R C1" THEN GOSUB 3100: GOSUB 3200: WW = 1: GOSUB 3300
IF result$ = "F R L C2" THEN GOSUB 3100: GOSUB 3200: WW = 2: GOSUB 3300
IF result$ = "H F R L C3" THEN GOSUB 3000: GOSUB 3100: GOSUB 3200: WW = 3: GOSUB 3300
RETURN

2500 'Grounding
result$ = "Grounding"
IF local$ = "I" THEN river = 1: result$ = "Grounded in a River"
IF local$ = "C" THEN coast = 1: result$ = "Grounded on a Coast"
IF local$ = "R" THEN reef = 1: result$ = "Grounded on a Reef"
result$ = result$ + STR$(-hzbase)

hzg = hzg + Detph + flooding * 5
hzg = hzbase
target = Hazardrating - hzg
dieroll = INT(RND * 100) + 1
GOSUB 2800:

GOSUB 2950
IF drs$ = "CS" OR drs$ = "MS" THEN RETURN

GOSUB 2800
result$ = "H F R C1": GOSUB 3000: GOSUB 3100: GOSUB 3200: WW = 1: GOSUB 3300
RETURN


2800 'Dieroll

IF dieroll <= target AND INT(dieroll / 5) = dieroll / 5 THEN drs$ = "CS": GOTO 2900
IF dieroll <= target AND INT(dieroll / 5) <> dieroll / 5 THEN drs$ = "MS": GOTO 2900
IF dieroll > target AND INT(dieroll / 5) = dieroll / 5 THEN drs$ = "CF": GOTO 2900
IF dieroll > target AND INT(dieroll / 5) <> dieroll / 5 THEN drs$ = "MF": GOTO 2900

2900
RETURN
2950 'Result table
PRINT USING "###/## "; dieroll; target;: PRINT drs$; " "; result$
RETURN


3000 'Hull Damage
result$ = ""
target = Hullfactor - hdamage
dieroll = INT(RND * 100) + 1
GOSUB 2800
IF reef = 1 AND drs$ = "CS" THEN result$ = "Tightness not compromised!"
IF reef = 1 AND drs$ = "MS" THEN result$ = "Tightness - 2D6 / Hull -1D6": Tdamage = Tdamage + INT(RND * 6) + INT(RND * 6) + 2: hdamage = hdamage + INT(RND * 6) + 1
IF reef = 1 AND drs$ = "MF" THEN result$ = "Tightness - 4D6 / Hull -2D6": FOR x = 1 TO 4: Tdamage = Tdamage + INT(RND * 6) + 1: NEXT: hdamage = hdamage + INT(RND * 6) + INT(RND * 6) + 2
IF reef = 1 AND drs$ = "CF" THEN result$ = "Tightness - 8D6 / Hull -4D6": FOR x = 1 TO 8: Tdamage = Tdamage + INT(RND * 6) + 1: NEXT: FOR x = 1 TO 4: hdamage = hdamage + INT(RND * 6) + 1: NEXT
IF reef = 1 THEN GOSUB 2950: RETURN

IF coast = 1 AND drs$ = "CS" THEN result$ = "Tightness not compromised!"
IF coast = 1 AND drs$ = "MS" THEN result$ = "Tightness - 1D6": Tdamage = Tdamage + INT(RND * 6) + 1
IF coast = 1 AND drs$ = "MF" THEN result$ = "Tightness - 2D6 / Hull -1D6": Tdamage = Tdamage + INT(RND * 6) + INT(RND * 6) + 2: hdamage = hdamage + INT(RND * 6) + 1
IF coast = 1 AND drs$ = "CF" THEN result$ = "Tightness - 4D6 / Hull -2D6": Tdamage = Tdamage + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + 4: hdamage = hdamage + INT(RND * 6) + INT(RND * 6) + 2
IF coast = 1 THEN GOSUB 2950: RETURN

IF river = 1 AND drs$ = "CS" THEN result$ = "Tightness not compromised!"
IF river = 1 AND drs$ = "MS" THEN result$ = "Tightness not compromised!"
IF river = 1 AND drs$ = "MF" THEN result$ = "Tightness - 2D6": Tdamage = Tdamage + INT(RND * 6) + INT(RND * 6) + 2
IF river = 1 AND drs$ = "CF" THEN result$ = "Tightness - 3D6 / Hull -1D6": Tdamage = Tdamage + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + 3: hdamage = hdamage + INT(RND * 6) + 1
IF river = 1 THEN GOSUB 2950: RETURN


IF blow = 3 AND drs$ = "CS" THEN result$ = "Tightness not compromised!"
IF blow = 3 AND drs$ = "MS" THEN result$ = "Tightness not compromised!"
IF blow = 3 AND drs$ = "MF" THEN result$ = "Tightness -1D6": Tdamage = Tdamage + INT(RND * 6) + 1
IF blow = 3 AND drs$ = "CF" THEN result$ = "Tightness -3D6": Tdamage = Tdamage + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + 3

IF blow = 4 AND drs$ = "CS" THEN result$ = "Tightness not compromised!"
IF blow = 4 AND drs$ = "MS" THEN result$ = "Tightness - 1D6": Tdamage = Tdamage + INT(RND * 6) + 1
IF blow = 4 AND drs$ = "MF" THEN result$ = "Tightness - 2D6": Tdamage = Tdamage + INT(RND * 6) + INT(RND * 6) + 2
IF blow = 4 AND drs$ = "CF" THEN result$ = "Tightness - 4D6 / Hull -1D6": Tdamage = Tdamage + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + 4: hdamage = hdamage + INT(RND * 6) + 1

GOSUB 2950
RETURN


3100 'Flooding Roll
result$ = ""
target = Tightness - Tdamage
dieroll = INT(RND * 100) + 1
GOSUB 2800
IF drs$ = "CS" THEN result$ = "Flooding averted!"
IF drs$ = "MS" THEN result$ = "Flooding +1": flooding = flooding + 1
IF drs$ = "MF" THEN result$ = "Flooding +1D3": flooding = flooding + INT(RND * 3) + 1
IF drs$ = "CF" THEN result$ = "Flooding +2D4": flooding = flooding + INT(RND * 4) + INT(RND * 4) + 2
GOSUB 2950
IF flooding > 9 THEN END
RETURN

3200 'Rigging Damage
result$ = ""
target = Rigging - Rdamage
dieroll = INT(RND * 100) + 1
GOSUB 2800

IF reef = 1 AND drs$ = "CS" THEN result$ = "Rigging damage averted!"
IF reef = 1 AND drs$ = "MS" THEN result$ = "Rigging - 2D6": Rdamage = Rdamage + INT(RND * 6) + INT(RND * 6) + 2
IF reef = 1 AND drs$ = "MF" THEN result$ = "Rigging - 3D6": Rdamage = Rdamage + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + 3
IF reef = 1 AND drs$ = "CF" THEN result$ = "Rigging - 5D6": FOR j = 1 TO 5: Rdamage = Rdamage + INT(RND * 6) + 1: NEXT
IF reef = 1 THEN GOSUB 2950: RETURN

IF coast = 1 AND drs$ = "CS" THEN result$ = "Rigging damage averted!"
IF coast = 1 AND drs$ = "MS" THEN result$ = "Rigging - 1D6": Rdamage = Rdamage + INT(RND * 6) + 1
IF coast = 1 AND drs$ = "MF" THEN result$ = "Rigging - 2D6": Rdamage = Rdamage + INT(RND * 6) + INT(RND * 6) + 2
IF coast = 1 AND drs$ = "CF" THEN result$ = "Rigging - 3D6": FOR j = 1 TO 3: Rdamage = Rdamage + INT(RND * 6) + 1: NEXT
IF coast = 1 THEN GOSUB 2950: RETURN

IF river = 1 AND drs$ = "CS" THEN result$ = "Rigging damage averted!"
IF river = 1 AND drs$ = "MS" THEN result$ = "Rigging damage averted!"
IF river = 1 AND drs$ = "MF" THEN result$ = "Rigging - 4D6": Rdamage = Rdamage + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + 4
IF river = 1 AND drs$ = "CF" THEN result$ = "Rigging - 8D6": FOR j = 1 TO 2: Rdamage = Rdamage + INT(RND * 6) + 1: NEXT
IF river = 1 THEN GOSUB 2950: RETURN





IF blow = 3 AND drs$ = "CS" THEN result$ = "Rigging damage averted!"
IF blow = 3 AND drs$ = "MS" THEN result$ = "Rigging - 1D6": Rdamage = Rdamage + INT(RND * 6) + 1
IF blow = 3 AND drs$ = "MF" THEN result$ = "Rigging - 2D6": Rdamage = Rdamage + INT(RND * 6) + INT(RND * 6) + 2
IF blow = 3 AND drs$ = "CF" THEN result$ = "Rigging - 4D6": Rdamage = Rdamage + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + 4

IF blow = 4 AND drs$ = "CS" THEN result$ = "Rigging damage averted!"
IF blow = 4 AND drs$ = "MS" THEN result$ = "Rigging - 2D6": Rdamage = Rdamage + INT(RND * 6) + INT(RND * 6) + 2
IF blow = 4 AND drs$ = "MF" THEN result$ = "Rigging - 4D6": Rdamage = Rdamage + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + INT(RND * 6) + 4
IF blow = 4 AND drs$ = "CF" THEN result$ = "Rigging - 8D6": FOR j = 1 TO 8: Rdamage = Rdamage + INT(RND * 6) + 1: NEXT


IF Rdamage > Rigging THEN Rdamage = Rigging
GOSUB 2950
RETURN


3300 'Crew Injury
target = Seamanship
dieroll = INT(RND * 100) + 1
GOSUB 2800
IF drs$ = "CS" THEN result$ = "No crew casualties!"
IF drs$ = "MS" THEN result$ = "No crew casualties!"
IF drs$ = "MF" THEN result$ = "3D6 Injury"
IF drs$ = "CF" THEN result$ = "Man Overboard!"
GOSUB 2950
RETURN

3400 'Repairs
result$ = ""
IF flooding = 0 GOTO 3410
target = Seamanship
dieroll = INT(RND * 100) + 1
GOSUB 2800
IF drs$ = "CS" THEN result$ = "-2 Flooding": flooding = flooding - 2
IF drs$ = "MS" THEN result$ = "-1 Flooding": flooding = flooding - 1
IF drs$ = "MF" THEN result$ = "Flooding unchanged"
IF drs$ = "CF" THEN result$ = "Flooding +2": flooding = flooding + 2
IF flooding < 0 THEN flooding = 0
GOSUB 2950

3410
IF hdamage = 0 GOTO 3420
result$ = ""
target = Shipwright
dieroll = INT(RND * 100) + 1
GOSUB 2800
IF drs$ = "CS" THEN result$ = "-2 Hulldamage": hdamage = hdamage - 2
IF drs$ = "MS" THEN result$ = "-1 Hulldamage": hdamage = hdamage - 1
IF drs$ = "MF" THEN result$ = "No hull repairs"
IF drs$ = "CF" THEN result$ = "Hulldamage +2": hdamage = hdamage + 2
IF hdamage < 0 THEN hdamage = 0
GOSUB 2950

3420
IF Tdamage = 0 GOTO 3430
result$ = ""
target = Shipwright
dieroll = INT(RND * 100) + 1
GOSUB 2800
IF drs$ = "CS" THEN result$ = "+4 Tightness": Tdamage = Tdamage - 4
IF drs$ = "MS" THEN result$ = "+2 Tightness": Tdamage = Tdamage - 2
IF drs$ = "MF" THEN result$ = "No tightness repairs"
IF drs$ = "CF" THEN result$ = "Tightness -2": Tdamage = Tdamage + 2
IF Tdamage < 0 THEN Tdamage = 0
GOSUB 2950

3430
IF Rdamage = 0 THEN RETURN
result$ = ""
target = Shipwright
dieroll = INT(RND * 100) + 1
GOSUB 2800
IF drs$ = "CS" THEN result$ = "+6 Rigging": Rdamage = Rdamage - 6
IF drs$ = "MS" THEN result$ = "+3 Rigging": Rdamage = Rdamage - 3
IF drs$ = "MF" THEN result$ = "No Rigging repairs"
IF drs$ = "CF" THEN result$ = "Rigging -2": Rdamage = Rdamage + 2
IF Rdamage < 0 THEN Rdamage = 0
GOSUB 2950
RETURN








RETURN







4000
'Encounters
DATA "River Sealane Open Encounter"
DATA "01-34  01-25  01-05 Local Fishing Boat"
DATA "   35  26-30  06-08 Foreign Fishing Boat"
DATA "36-65  31-55  09-22 Local Merchantman"
DATA "66-75  56-65  23-29 Foreign Merchantman"
DATA "76-80  66-70  30-40 Pirate/Privateer/etc."
DATA "81-84  71-74  41-44 Local Warship"
DATA "   85     75    45 Foreign Warship"
DATA "86-90  76-80  46-59 Mutiny/Dissent/Argument"
DATA "91-94  81-82  60 Maelstrom/Freak Current"
DATA "95-96  83-84  61-62 Fire on Board"
DATA "97-98  85-86  63-65 Equipment Failure"
DATA "   99  87-90  66-70 Food and/or Water Spoilage"
DATA "          91  71-72 Killer Whale (Orca)"
DATA "       92-94  73-77 Dolphin/Porpoise"
DATA "          95  78-81 Gray/finback/sperm Whale"
DATA "          96  82-84 Humpback/bowhead Whale"
DATA "       97-98  85-90 Right Whale/Narwhal"
DATA "          99  91-98 Seal/Walrus/Sealion"
DATA "              99-00 Sea Monster or Water Monster"


