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 >
Text File  |  1989-09-27  |  5KB  |  167 lines

  1.  
  2. procedure shortcrew;
  3. begin
  4. if crew>=complement then
  5.    begin
  6.    writeln('All stations personed and ready, Captain.');
  7.    claser:=laser;
  8.    chull:=hull;
  9.    cspeed:=speed;
  10.    lasercrew:=5;
  11.    hullcrew:=5;
  12.    drivecrew:=crew-(lasercrew+hullcrew);
  13.    end{ifthen}
  14. else if crew>=complement-3 then
  15.    begin
  16.    claser:=laser;
  17.    chull:=hull;
  18.    cspeed:=speed;
  19.    lasercrew:=5;
  20.    hullcrew:=5;
  21.    drivecrew:=crew-(lasercrew+hullcrew);
  22.    writeln('You are shorthanded, but able to carry on');
  23.    end{ifthen,else}
  24. else
  25.    begin
  26.    if crew<0 then crew:=0;
  27.    status;
  28.    writeln('You are critically short of crew.');
  29.    writeln('Same assignments as before?');
  30.    readln(yorn);
  31.    if upcase(yorn)='Y' then if lasercrew+drivecrew+hullcrew<>crew then writeln('same assignments not possible, Captian') else
  32.       begin
  33.       shortposts;
  34.       exit;
  35.       end;{ifthen on yorn}
  36.    writeln('            Normal| |Now at posts| |Efficiency lost ');
  37.    writeln('FIRE CONTROL   6       ',lasercrew,'             ',laser-claser);
  38.    writeln('NAVIGATION     8       ',drivecrew,'             ',speed-cspeed);
  39.    writeln('DAMAGE CONTROL 6       ',hullcrew,'             ',hull-chull);
  40.    writeln;
  41.    writeln('One point of efficiency lost for each TWO crew short at a post.');
  42.    flag:=false;   {flag used to prevent overlength code line}
  43.    if crew<>(lasercrew+drivecrew+hullcrew) then flag:=true;
  44.    if ((drivecrew<0) or (lasercrew<0) or (hullcrew<0)) then flag:=true;
  45.    if flag=true then writeln('Reassignment necessary')
  46.    else
  47.       begin
  48.       writeln('Re-assign crew?');
  49.       readln(yorn);
  50.       end;{inside else}
  51.    while (upcase(yorn)='Y') or (crew<>(lasercrew+drivecrew+hullcrew)) or (lasercrew<0) or (hullcrew<0) or (drivecrew<0) do
  52.       begin
  53.       writeln('You have a crew of ',crew,' How many to fire control?');
  54.       inputs;
  55.       lasercrew:=inp;
  56.       writeln(crew-lasercrew,' left for navigation and hull. How many for navigation?');
  57.       inputs;
  58.       drivecrew:=inp;
  59.       writeln(crew-(lasercrew+drivecrew),' left for damage control. Reassign again?');
  60.       readln(yorn);
  61.       if upcase(yorn)='N' then hullcrew:=crew-(lasercrew+drivecrew);
  62.       if (lasercrew<0) or (hullcrew<0) or (drivecrew<0) then yorn:='Y';{recycle}
  63.       status;
  64.       end;{whiledo};
  65.    end;{else}
  66. shortposts;
  67. end;{shortcrew}
  68.  
  69. procedure abandon;
  70. begin;
  71. writeln('You are adrift in a lifeboat. You got away with your cash,');
  72. if autodoc then writeln('your autodoc,');
  73. writeln('and all your crew, but nothing else.');
  74. writeln('Now you will have to try to lease another ship.');
  75. writeln('(No sense asking for a refund on the old lease.)');
  76. if (credits<1.4E5) and (credits<t*1E5) then begin
  77.    writeln('Sorry, you don''t have enough credits. Maybe the navy is looking');
  78.    writeln('for an experienced officer. Or perhaps you know some other trade.');
  79.    halt;
  80.    end
  81. else
  82.    begin
  83.    newship:=true;
  84.    speed:=10;
  85.    cspeed:=10;{dummy values for lifeboat trip}
  86.    end;
  87. badguys:=false;
  88. objectcount:=0;
  89. end;{abandon}
  90.  
  91.  
  92. procedure surrender;
  93. begin
  94. index:=random(10);
  95. case index of
  96.    0..4: begin
  97.          writeln('Your captors take your cargo but don''t find your money');
  98.          for jndex:=1 to holdnum do
  99.             with holdnow[jndex] do
  100.                begin
  101.                if category>0 then space:=space+aweight;
  102.                category:=0
  103.                end{with}
  104.          end;{case 0..4}
  105.    5,6:  begin
  106.          writeln('Your captors take your money and let you go.');
  107.          credits:=0;
  108.          end;
  109.    7:    writeln('Your captors take a liking to you, and let you go');
  110.    8:    begin
  111.          writeln('Your captors kill you!');
  112.          halt;
  113.          end;{case 8}
  114.    9:    begin
  115.          writeln('Your captors take your cargo and your ship!');
  116.          abandon;
  117.          end;{case 9}
  118.    end;{case}
  119. battle:=false;
  120. end;
  121.  
  122.  
  123. procedure mutiny;
  124. begin
  125. writeln('Your crew has mutinied');
  126. surrender;
  127. battle:=false;
  128. badguys:=false;
  129. objectcount:=0;
  130. salary:=salary*2;
  131. writeln('A new crew will cost twice the salary');
  132. morale:=100;
  133. moralebounce:=0;
  134. end;
  135.  
  136. procedure crewpains;
  137. begin
  138. if (crew>=complement) or (morale>=200) then exit;
  139. realvar:=random*random*random*crew*sqr(morale)/complement;
  140. {note that if random=.5 and all quantities are as at start then realvar=1250}
  141. if (realvar<200) and (battle=false) then mutiny
  142.    else if realvar<600 then jumpship
  143.       else if realvar<1000 then
  144.          begin
  145.          morale:=morale-3;
  146.          moralebounce:=moralebounce-3;
  147.          writeln('The crew complains of conditions');
  148.          end;{else}
  149. end;{crewpains}
  150.  
  151. procedure crewloss(localbyte:byte);
  152. begin
  153. writeln(localbyte,' crew injured; they are unable to perform');
  154. writeln('their duties and will have to be left at the next port.');
  155. if autodoc=true then begin
  156.    localbyte:=localbyte-1;
  157.    writeln('Your autodoc heals one crewmember');
  158.    morale:=morale+1;
  159.    end;
  160. crew:=crew-localbyte;
  161. morale:=morale-5*localbyte;
  162. moralebounce:=moralebounce-2*localbyte;
  163. crewpains;
  164. shortcrew;
  165. end;
  166.  
  167.