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
/
E1.PRO
< prev
next >
Wrap
Text File
|
1989-09-27
|
5KB
|
167 lines
procedure shortcrew;
begin
if crew>=complement then
begin
writeln('All stations personed and ready, Captain.');
claser:=laser;
chull:=hull;
cspeed:=speed;
lasercrew:=5;
hullcrew:=5;
drivecrew:=crew-(lasercrew+hullcrew);
end{ifthen}
else if crew>=complement-3 then
begin
claser:=laser;
chull:=hull;
cspeed:=speed;
lasercrew:=5;
hullcrew:=5;
drivecrew:=crew-(lasercrew+hullcrew);
writeln('You are shorthanded, but able to carry on');
end{ifthen,else}
else
begin
if crew<0 then crew:=0;
status;
writeln('You are critically short of crew.');
writeln('Same assignments as before?');
readln(yorn);
if upcase(yorn)='Y' then if lasercrew+drivecrew+hullcrew<>crew then writeln('same assignments not possible, Captian') else
begin
shortposts;
exit;
end;{ifthen on yorn}
writeln(' Normal| |Now at posts| |Efficiency lost ');
writeln('FIRE CONTROL 6 ',lasercrew,' ',laser-claser);
writeln('NAVIGATION 8 ',drivecrew,' ',speed-cspeed);
writeln('DAMAGE CONTROL 6 ',hullcrew,' ',hull-chull);
writeln;
writeln('One point of efficiency lost for each TWO crew short at a post.');
flag:=false; {flag used to prevent overlength code line}
if crew<>(lasercrew+drivecrew+hullcrew) then flag:=true;
if ((drivecrew<0) or (lasercrew<0) or (hullcrew<0)) then flag:=true;
if flag=true then writeln('Reassignment necessary')
else
begin
writeln('Re-assign crew?');
readln(yorn);
end;{inside else}
while (upcase(yorn)='Y') or (crew<>(lasercrew+drivecrew+hullcrew)) or (lasercrew<0) or (hullcrew<0) or (drivecrew<0) do
begin
writeln('You have a crew of ',crew,' How many to fire control?');
inputs;
lasercrew:=inp;
writeln(crew-lasercrew,' left for navigation and hull. How many for navigation?');
inputs;
drivecrew:=inp;
writeln(crew-(lasercrew+drivecrew),' left for damage control. Reassign again?');
readln(yorn);
if upcase(yorn)='N' then hullcrew:=crew-(lasercrew+drivecrew);
if (lasercrew<0) or (hullcrew<0) or (drivecrew<0) then yorn:='Y';{recycle}
status;
end;{whiledo};
end;{else}
shortposts;
end;{shortcrew}
procedure abandon;
begin;
writeln('You are adrift in a lifeboat. You got away with your cash,');
if autodoc then writeln('your autodoc,');
writeln('and all your crew, but nothing else.');
writeln('Now you will have to try to lease another ship.');
writeln('(No sense asking for a refund on the old lease.)');
if (credits<1.4E5) and (credits<t*1E5) then begin
writeln('Sorry, you don''t have enough credits. Maybe the navy is looking');
writeln('for an experienced officer. Or perhaps you know some other trade.');
halt;
end
else
begin
newship:=true;
speed:=10;
cspeed:=10;{dummy values for lifeboat trip}
end;
badguys:=false;
objectcount:=0;
end;{abandon}
procedure surrender;
begin
index:=random(10);
case index of
0..4: begin
writeln('Your captors take your cargo but don''t find your money');
for jndex:=1 to holdnum do
with holdnow[jndex] do
begin
if category>0 then space:=space+aweight;
category:=0
end{with}
end;{case 0..4}
5,6: begin
writeln('Your captors take your money and let you go.');
credits:=0;
end;
7: writeln('Your captors take a liking to you, and let you go');
8: begin
writeln('Your captors kill you!');
halt;
end;{case 8}
9: begin
writeln('Your captors take your cargo and your ship!');
abandon;
end;{case 9}
end;{case}
battle:=false;
end;
procedure mutiny;
begin
writeln('Your crew has mutinied');
surrender;
battle:=false;
badguys:=false;
objectcount:=0;
salary:=salary*2;
writeln('A new crew will cost twice the salary');
morale:=100;
moralebounce:=0;
end;
procedure crewpains;
begin
if (crew>=complement) or (morale>=200) then exit;
realvar:=random*random*random*crew*sqr(morale)/complement;
{note that if random=.5 and all quantities are as at start then realvar=1250}
if (realvar<200) and (battle=false) then mutiny
else if realvar<600 then jumpship
else if realvar<1000 then
begin
morale:=morale-3;
moralebounce:=moralebounce-3;
writeln('The crew complains of conditions');
end;{else}
end;{crewpains}
procedure crewloss(localbyte:byte);
begin
writeln(localbyte,' crew injured; they are unable to perform');
writeln('their duties and will have to be left at the next port.');
if autodoc=true then begin
localbyte:=localbyte-1;
writeln('Your autodoc heals one crewmember');
morale:=morale+1;
end;
crew:=crew-localbyte;
morale:=morale-5*localbyte;
moralebounce:=moralebounce-2*localbyte;
crewpains;
shortcrew;
end;