home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
GAMES
/
STARSHIP.ARC
/
STAR2.PRO
< prev
next >
Wrap
Text File
|
1989-09-27
|
12KB
|
371 lines
procedure getship;
begin
if credits<t*1E5 then
begin
while credits<t*1E5 do t:=t-1;
writeln('You only had enough to lease a ship for ',t:8:0,' years');
credits:=credits-t*1E5;
end;{if}
tspeed:=speedstart;
tlaser:=laserstart;
thull:=hullstart;
speed:=tspeed;
laser:=tlaser;
hull:=thull;
boats:=boatstart;
probes:=probestart;
space:=200;
for index:=1 to holdnum do holdnow[index].category:=0;
writeln;
writeln('You have leased another ship.');
writeln('What will you call her?');
readln(name);
status;
showcash;
shortposts;
newship:=false;
end;{getship}
procedure fix;
begin
t:=t-0.02*index;
credits:=credits-realvar;
format(realvar);
writeln(' paid to repair yards;');
if speed<tspeed then
begin
speed:=speed+1;
cspeed:=cspeed+1;
end;
if speed<tspeed then
begin
speed:=speed+1;
cspeed:=cspeed+1;
end;
if hull<thull then
begin
hull:=hull+1;
chull:=chull+1;
end;
if laser<tlaser then
begin
laser:=laser+1;
claser:=claser+1;
end;
if (speed=tspeed) and (hull=thull) and (laser=tlaser) then
writeln(name,' in full repair.')
else writeln('only partial repairs were possible in this port.');
status;
if crew<complement-3 then writeln('THIS DOES NOT COUNT CREW SHORTAGE');
end;{fix}
procedure repair;
begin
index:=0;
if speed<tspeed-1 then index:=index+2 else if speed<tspeed then index:=index+1;
if hull<thull then index:=index+1;
if laser<tlaser then index:=index+1;
realvar:=(random*6E4+2E4)*index;
if star>7 then begin
repeat
showcash;
write(chr(7),'=> Repairs will cost ');
format(realvar);
writeln(' credits. Will you make repairs?');
readln(yorn);
if upcase(yorn)='Y' then fix;
if upcase(yorn)='N' then
begin
morale:=morale-2;
moralebounce:=moralebounce-1;
end;{ifthen}
until (upcase(yorn)='Y') or (upcase(yorn)='N');
end{ifthen on star>7}
else {ie if star<8}
begin
writeln('repairs are mandatory in this jurisdiction');
fix;
end;{else}
lasercrew:=complement+1;{this forces shortcrew when underpersoned}
end;{repair}
procedure map;{travel table}
begin
distance[thistar]:=0;
case thistar of
1:begin
angle[2]:=324;angle[3]:=252;angle[4]:=321;angle[5]:=291;
angle[6]:=321;angle[7]:=248;angle[8]:=269;angle[9]:=265;angle[10]:=282;
distance[2]:=6;distance[3]:=18;distance[4]:=12;distance[5]:=8;distance[6]:=15;
distance[7]:=15;distance[8]:=15;distance[9]:=17;distance[10]:=18;end;
2:begin
angle[1]:=144;angle[3]:=231;angle[4]:=316;angle[5]:=236;
angle[6]:=319;angle[7]:=223;angle[8]:=244;angle[9]:=242;angle[10]:=264;
distance[1]:=6;distance[3]:=17;distance[4]:=5;distance[5]:=4;distance[6]:=9;
distance[7]:=15;distance[8]:=12;distance[9]:=15;distance[10]:=14;end;
3:begin
angle[1]:=72;angle[2]:=51;angle[4]:=34;angle[5]:=50;
angle[6]:=25;angle[7]:=91;angle[8]:=25;angle[9]:=9;angle[10]:=358;
distance[1]:=18;distance[2]:=17;distance[4]:=18;distance[5]:=13;distance[6]:=19;
distance[7]:=3;distance[8]:=6;distance[9]:=4;distance[10]:=9;end;
4:begin
angle[1]:=141;angle[2]:=136;angle[3]:=214;angle[5]:=180;
angle[6]:=323;angle[7]:=205;angle[8]:=219;angle[9]:=221;angle[10]:=243;
distance[1]:=12;distance[2]:=5;distance[3]:=18;distance[5]:=6;distance[6]:=3;
distance[7]:=16;distance[8]:=12;distance[9]:=14;distance[10]:=12;end;
5:begin
angle[1]:=111;angle[2]:=56;angle[3]:=230;angle[4]:=360;
angle[6]:=347;angle[7]:=218;angle[8]:=248;angle[9]:=245;angle[10]:=275;
distance[1]:=8;distance[2]:=4;distance[3]:=13;distance[4]:=6;distance[6]:=9;
distance[7]:=11;distance[8]:=8;distance[9]:=10;distance[10]:=10;end;
6:begin
angle[1]:=141;angle[2]:=139;angle[3]:=205;angle[4]:=143;angle[5]:=167;
angle[7]:=195;angle[8]:=204;angle[9]:=209;angle[10]:=226;
distance[1]:=15;distance[2]:=9;distance[3]:=19;distance[4]:=3;distance[5]:=9;
distance[7]:=18;distance[8]:=13;distance[9]:=15;distance[10]:=11;end;
7:begin
angle[1]:=68;angle[2]:=43;angle[3]:=271;angle[4]:=25;angle[5]:=38;
angle[6]:=15;angle[8]:=352;angle[9]:=327;angle[10]:=339;
distance[1]:=15;distance[2]:=15;distance[3]:=3;distance[4]:=16;distance[5]:=11;
distance[6]:=18;distance[8]:=6;distance[9]:=5;distance[10]:=10;end;
8:begin
angle[1]:=89;angle[2]:=64;angle[3]:=205;angle[4]:=39;angle[5]:=68;
angle[6]:=24;angle[7]:=172;angle[9]:=233;angle[10]:=324;
distance[1]:=15;distance[2]:=12;distance[3]:=6;distance[4]:=12;distance[5]:=8;
distance[6]:=13;distance[7]:=6;distance[9]:=2;distance[10]:=5;end;
9:begin
angle[1]:=85;angle[2]:=62;angle[3]:=189;angle[4]:=41;angle[5]:=65;
angle[6]:=29;angle[7]:=147;angle[8]:=53;angle[10]:=350;
distance[1]:=17;distance[2]:=15;distance[3]:=4;distance[4]:=14;distance[5]:=10;
distance[6]:=15;distance[7]:=5;distance[8]:=2;distance[10]:=5;end;
10:begin
angle[1]:=102;angle[2]:=84;angle[3]:=176;angle[4]:=63;angle[5]:=95;
angle[6]:=46;angle[7]:=159;angle[8]:=144;angle[9]:=170;
distance[1]:=18;distance[2]:=14;distance[3]:=9;distance[4]:=12;distance[5]:=10;
distance[6]:=11;distance[7]:=10;distance[8]:=5;distance[9]:=5;end;
end;{case}
end;{procedure map}
procedure firstvisit;
begin;
writeln('Since this is your first visit,');
index:=random(10)+1;
case index of
1: writeln('the mayor of Portside City gives you a warm handshake.');
2: writeln('you and your officers get a free cup of pseudotea');
3: begin
writeln('you and your crew are challenged to a game of no-gravity football.');
morale:=morale+5;
moralebounce:=moralebounce+2;
end;
4: writeln('you get a coupon good for a free shipwash');
5: begin
realvar:=random*(1E5)+30000;
credits:=credits+realvar;
str(realvar:5:0,filename);
writeln('you are offered ',filename,' credits to paint ads on the ',name);
end;{case 5}
6: begin
writeln('you are presented with a secret speed-enhancing device;');
jndex:=random(3)+1;
speed:=speed+jndex;
tspeed:=tspeed+jndex;
cspeed:=cspeed+jndex;
writeln('speed of the good ship ',name,' now ',cspeed);
end;{case 6}
7: begin
writeln('the greatful inhabitants rebuild the ',name);
jndex:=random(3);
hull:=hull+jndex;
thull:=thull+jndex;
chull:=chull+jndex;
space:=space+40;
writeln('Her lifting capacity is improved by 40 tons');
if jndex>0 then writeln('and hull strength now ',chull);
end;{case 7}
8: begin
writeln('your crew is given free tatoos.');
morale:=morale+5;
moralebounce:=moralebounce+5;
end;
9: begin
writeln('you are given a brand new lifeboat.');
boats:=boats+1;
end;
10: begin
writeln('The crew is so happy that they gladly take a 20% pay cut');
writeln('in exchange for ground leave.');
salary:=salary*0.8;
morale:=morale+4;
moralebounce:=moralebounce+2;
end;
end;{case}
end;{firstvisit}
procedure fine;
begin
realvar:=random*random*random*2E5;
writeln('You are ordered to pay ',realvar:5:0,' credits court expenses');
credits:=credits-realvar;
end;
procedure prison;
begin
realvar:=0.01*random;
t:=t-realvar;
writeln('You were held for ',realvar:0:3,' years');
end;
procedure localevent;
begin
writeln('-\|/- ');
case star of
1: local1:=true;
2: if been[star]=true then
begin
writeln('the escheatment laws have changed since your last visit.');
realvar:=credits*random/12;
if realvar>0.75E6 then realvar:=0.75E6+((credits-9E6)*random/36);
if realvar>1E6 then realvar:=0.75E6+((credits-12E6)*random/60);
realvar:=realvar+0.6E5;
credits:=credits-realvar;
write('you lose ');
format(realvar);
writeln(' credits.');
end; {ifthen}
3: begin
writeln('You must increase the crew''s salaries to keep them from');
writeln('jumping ship to take up farming.');
salary:=salary+random*random*salary;
write('salary now ');
format(salary);
writeln(' credits per year.');
end;{case 3}
4: begin
writeln('You and your crew have been quarentined to prevent the spread of');
case random(5) of
0: writeln('tooth decay');
1: writeln('peculiar ideas');
2: writeln('outlandish customs');
3: writeln('chewing gum addiction');
4: writeln('space rot');
end;{case}
dt:=random*random*random*0.1+0.002;
realvar:=random*random*random*2E6;
writeln('You will be held for ',dt:0:3,' years');
write('unless you pay a ');
format(realvar);
writeln(' credit sanitation fee');
writeln('Will you pay?');
readln(yorn);
if upcase(yorn)='N' then
begin
t:=t-dt;
morale:=morale-5;
moralebounce:=moralebounce-2;
end
else credits:=credits-realvar;
end;{case 4}
5: begin
write('Your pocket has been picked.');
if credits<0 then writeln(' Luckily, there was nothing to steal but your tatoos.')
else
begin
realvar:=random*credits/20;
if realvar>0.5E6 then realvar:=0.5E6-random*(1E5);
credits:=credits-realvar;
format(realvar);
writeln(' credits are missing');
end;{else}
end;{case 5}
6: begin
writeln('You have been elected to the local Knights of Commerce.');
writeln('You are offered five more cargoes to buy.');
local6:=true;
writeln('<Carraige Return> to continue');
readln;
end;{case 6}
7: local7:=true;
8: begin
writeln(chr(7),'A synchronoplastic infundiblium has caused a navigation error.');
index:=random(10)+1;
star:=index;
writeln('You are somewhere near star #',star);
badguys:=false;
objectcount:=random(2);
chain(chnfile);
end;
9: begin write('You and your crew are arrested for ');
case random(9) of
0: writeln('suspicion of wearing colored underwear');
1: writeln('applying for a license without a license');
2: writeln('suspicion of suspicion');
3: writeln('drug evasion');
4: writeln('being mugged');
5: writeln('reversion to type');
6: writeln('drinking water');
7: writeln('taking off your hat');
8: writeln('setting the national anthem to jazz');
end;{inner case}
case random(7) of
0: fine;
1: confiscation;
2: prison;
3: writeln('But the jail janitor lets you go.');
4: begin fine; prison; end;
5: begin fine; confiscation; end;
6: begin fine; prison; confiscation; end;
end;{inner case}
end;{case 9}
10: begin
writeln('You have been picked up on trumped-up charges of monogamy');
realvar:=random(10)*0.001;
t:=t-realvar;
writeln('You are released after waiting ',realvar:0:3,' years for permission');
writeln('to be arrested.');
end;
end;{case}
end;{localevent}
procedure trader2;
begin
writeln('It''s a trading ship like yours...they want to trade.');
realstar:=star;
star:=random(10)+1;{trader has same prices as this star}
forsale;
evaluate;
repeat
showcash;
writeln(' Your command:');
writeln;
writeln('1. Show cargo in hold');
writeln('2. Show cargo for sale');
writeln('3. Buy cargo');
writeln('4. Sell cargo');
writeln('6. Break off contact and continue the journey');
writeln('8. Status of the ',name);
inputs;
mndex:=inp;
case mndex of
1: begin
showhold;
writeln('<carraige return> to continue');
readln(yorn);
end;
2: showforsale;
3: buy;
4: sell;
6: writeln('Goodbye and good luck!');
8: status;
else writeln('Option ',inp,' not available');
end;{case}
until mndex=6;
star:=realstar;
traderflag:=false;
end;{trader2}