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
/
ESTAR.PRO
< prev
next >
Wrap
Text File
|
1989-09-27
|
4KB
|
129 lines
procedure Error(ErrNo, ErrAddr: Integer);{see READ.ME from Turbo}
begin
stringvar:=thiscargo.acargoname;
writeln('thiscargo:',stringvar);
stringvar:=thiscargotype.cargoname;
writeln('thiscargotype:',stringvar);
writeln('index,jndex,kndex,mndex,cargonum,star,thistar,realstar');
writeln(index,' ',jndex,' ',kndex,' ',mndex,' ',cargonum,' ',star,' ',thistar,' ',realstar);
writeln('triplength,gamelength:',triplength,' ',gamelength);
writeln('speed,tspeed,cspeed,hull,thull,chull',speed,' ',tspeed,' ',cspeed,' ',hull,' ',thull,chull);
writeln('probes,boats,laser,tlaser,claser');
writeln(probes,' ',boats,' ',laser,' ',tlaser,' ',claser);
writeln('<CR> to continue var listing');
readln;
writeln('crew:',crew);
writeln('drivecrew,lasercrew,hullcrew,space,morale,moralebounce:');
writeln(drivecrew,' ',lasercrew,' ',hullcrew,' ',space,' ',morale,' ',moralebounce);
writeln('num,trial,inp:',num,' ',trial,' ',inp);
writeln('t,dt,credits,realvar,salary:',t,dt,credits,realvar,salary);
writeln('probehere,boathere,navy,messageflag,autodoc,assignment,roll');
writeln(probehere,' ',boathere,' ',navy,' ',messageflag,' ',autodoc,' ',assignment,' ',roll);
writeln('prize',prize);
writeln('OrigEpower:',OrigEpower);
writeln('Epower:', Epower);
writeln('action,battle,newship,nomessage,moraleflag:',action,' ',battle,' ',newship,' ',nomessage,' ',moraleflag);
writeln('traderflag,quitter:',traderflag,' ',quitter);
end;{procedure error}
procedure inputs; {read and check integer inputs}
begin
{$I-}
readln(Trial);
if IOresult<>0 then begin
writeln('Please type a numeral');
inp:=0;{restarts menu}
end
{$I+}
else inp:=trial
end;
procedure format(pretty:real);
begin
str(pretty:9:0,stringvar);
if (pretty>999) or (pretty<-999) then insert(',',stringvar,length(stringvar)-2)
else insert(' ',stringvar,1);
if (pretty>9.99999E5) or (pretty<-9.99999E5) then insert(',',stringvar,length(stringvar)-6)
else insert(' ',stringvar,1);
write(stringvar);
end;
procedure realround(toround:real);
begin
if frac(toround)>=0.5 then toround:=toround+1;
toround:=int(toround);
end;
procedure shortposts;
begin
num:=6-lasercrew;
if num<0 then num:=0;
if odd(num) then num:= num-1;
num:=num div 2;
if num>claser then claser:=0 else claser:=laser-num;
num:=6-hullcrew;
if num<0 then num:=0;
if odd(num) then num:= num-1;
num:=num div 2;
if num>chull then chull:=0 else chull:=hull-num;
num:=8-drivecrew;
if num<0 then num:=0;
if odd(num) then num:= num-1;
num:=num div 2;
if num>cspeed then cspeed:=0 else cspeed:=speed-num;
end;
procedure jumpship;
begin
if ((boats=0) and (star<>thistar)) or (crew=0) then exit;
if (t>gamelength-1) and (battle=false) then exit;{no go if less than one year elapsed}
index:=random(crew);
if odd(index)=true then index:=index-1;
index:=index div 2;
if index>4 then index:=4;
if index=0 then index:=1;
writeln(chr(7),index,' OF YOUR CREW HAVE JUMPED SHIP.');
if thistar<>star then begin
writeln('A lifeboat is missing.');
boats:=boats-1;
end;{ifthen}
crew:=crew-index;
end;{jumpship}
procedure showcash;
begin
write('you have ');
format(credits);
writeln(' credits. Time left ',t:2:3);
writeln('unused lifting capacity, ',space,' tons');
end;
procedure status;
begin
if newship=true then exit;
writeln('The merchantman ',name,' has: speed: ',cspeed,', hull integrity: ',chull);
writeln('laser power: ',claser,', probes: ',probes,', small craft: ',boats,', crew: ',crew);
writeln('morale factor=',morale);
end;
procedure confiscation;
begin
for index:=1 to random(2)+1 do
jndex:=random(holdnum)+1;
with holdnow[jndex] do
begin
writeln('The cargo in hold ',jndex,' has been taken.');
if category=0 then writeln('...but that hold was empty.')
else
begin
stringvar:=acargoname;
writeln('The cargo was ',stringvar);
space:=space+aweight;
category:=0;
end;{else}
end;{with}
end;{confiscation}