home *** CD-ROM | disk | FTP | other *** search
/ synchro.net / synchro.net.tar / synchro.net / main / BBS / GEO.ZIP / ROUTINE1.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  2003-06-05  |  33.4 KB  |  663 lines

  1. overlay procedure diplomacy; {Overlay source for Geopolitik v 1.0}
  2.  
  3. label ex;
  4. var
  5.    sel,p1:char;
  6.    f1,f2:integer;
  7.    p,sak:bigstring;
  8.    lm1,lm2:bigstring;
  9.    newname:namstring;
  10. begin
  11.    cls;
  12.    repeat
  13.      nl;
  14.      prt('Diplomacy command [A,C,D,H,L,M,Q,S,V,?] ');
  15.      onek(sel,'ACDHLMQSV?');
  16.      case sel of
  17.           'H':printfile('HELPD.GEO');
  18.           'L':begin
  19.                  ab:=false;
  20.                  for f1:=1 to 20 do begin
  21.                   ansic(2);
  22.                   pa(nation[f1].nombre+' controls:');
  23.                   ansic(0);
  24.                   for f2:=1 to 80 do with region[f2] do if (controller=f1) then pa('   '+nombre);
  25.                  end;
  26.               end;
  27.           'A':begin
  28.                    print('If you really wish to abdicate, type "I''M A QUITTER"');
  29.                    checkhangup;
  30.                    if hangup then goodbye;
  31.                    input(p,13);
  32.                    if hangup then goodbye;
  33.                    if p='I''M A QUITTER' then begin
  34.                       with nation[cn] do if cont(cn)=0 then controller:='NOBODY' else controller:='&&&';
  35.                       reset(trashcan);
  36.                       seek(trashcan,filesize(trashcan)+1);
  37.                       write(trashcan,handl);
  38.                       close(trashcan);
  39.                       print('Now slink off to the main menu and hit "Q"');
  40.                    end
  41.               end;
  42.           'M':begin
  43.                    print('Announcement (75 characters, RETURN aborts): ');
  44.                    checkhangup;
  45.                    if hangup then goodbye;
  46.                    inputl(lilmess,75);
  47.                    if hangup then goodbye;
  48.                    if lilmess='' then begin
  49.                       print('Aborted.');
  50.                       goto ex;
  51.                    end;
  52.                    addon(nation[cn].nombre+' made an announcement:');
  53.                    addon('--- '+lilmess);
  54.               end;
  55.           'D':begin
  56.                    getnat('Change diplomatic relations with ',f1,'W','D');
  57.                    if qut then goto ex;
  58.                    repeat
  59.                          prt('New diplomatic posture toward '+nation[f1].nombre+' [A,F,H,N,Q,W,?] ');
  60.                          onek(p1,'AFHNWQ?');
  61.                          if p1='?' then begin
  62.                             ab:=false;
  63.                             pa('[A]llied');
  64.                             pa('[F]riendly');
  65.                             pa('[H]ostile');
  66.                             pa('[N]eutral');
  67.                             pa('[Q]uit');
  68.                             pa('at [W]ar');
  69.                          end;
  70.                    until p1<>'?';
  71.                    case p1 of
  72.                         'H':begin
  73.                                  nation[cn].rel[f1]:='H';
  74.                                  if nation[f1].rel[cn] in ['A','F'] then nation[f1].rel[cn]:='N';
  75.                             end;
  76.                         'N':nation[cn].rel[f1]:='N';
  77.                         'F':nation[cn].rel[f1]:='F';
  78.                         'A':if nation[f1].rel[cn] in ['A','F'] then nation[cn].rel[f1]:='A'
  79.                                else print(nation[f1].nombre+' is not friendly towards you.');
  80.                         'W':if nation[cn].rel[f1]='W' then print('Already at war.') else begin
  81.                                nation[cn].rel[f1]:='W';
  82.                                if nation[f1].rel[cn] in ['A','F'] then nation[f1].rel[cn]:='N';
  83.                                addon('* '+nation[cn].nombre+' declared war on '+nation[f1].nombre);
  84.                                nation[cn].attacks:=1;
  85.                             end;
  86.                    end;
  87.               end;
  88.           'S':begin
  89.                    getnat('Send message to ',art.por,'W','D');
  90.                    if qut then goto ex;
  91.                    art.from:=cn;
  92.                    print('Type in message now (75 characters, RETURN to abort):');
  93.                    checkhangup;
  94.                    if hangup then goodbye;
  95.                    inputl(lm1,75);
  96.                    if hangup then goodbye;
  97.                    art.mess:=lm1;
  98.                    if art.mess='' then print('Aborted.') else sendmess;
  99.               end;
  100.           'C':begin
  101.                    prt('Enter new name for '+nation[cn].nombre+':  ');
  102.                    checkhangup;
  103.                    if hangup then goodbye;
  104.                    inputn(newname);
  105.                    if hangup then goodbye;
  106.                    if length(newname)<3 then begin
  107.                       print('Aborted.  Name must be at least 3 characters.');
  108.                       goto ex;
  109.                    end;
  110.                    print('New name will be '+newname);
  111.                    ynq('Is this what you want? ');
  112.                    yah:=yn;
  113.                    if yah then begin
  114.                       addon(nation[cn].nombre+' changed its name to '+newname+'.');
  115.                       nation[cn].nombre:=newname;
  116.                    end;
  117.               end;
  118.           'V':begin
  119.                    print('                       Nation   1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2');
  120.                    print('                       ======                     0 1 2 3 4 5 6 7 8 9 0');
  121.                    ab:=false;
  122.                    for f1:=1 to 20 do if not ab then begin
  123.                        if f1=cn then ansic(4);
  124.                        pra(nname(f1)+'   ');
  125.                        for f2:=1 to 20 do begin
  126.                            case nation[f1].rel[f2] of
  127.                                 'W': p1:='W';
  128.                                 'H': p1:='H';
  129.                                 'N': p1:='.';
  130.                                 'F': p1:='F';
  131.                                 'A': p1:='A';
  132.                                 'S': p1:=' ';
  133.                            end;
  134.                            if f2=cn then ansic(4);
  135.                            pra(p1+' ');
  136.                            if (f2=cn) and (f1<>cn) then ansic(0);
  137.                        end;
  138.                        if f1=cn then ansic(0);
  139.                        nl;
  140.                    end;
  141.                    pa('A=Allied F=Friendly .=Neutral H=Hostile W=Warring');
  142.               end;
  143.           '?':begin
  144.                    ab:=false;
  145.                    pa('    [A]bdicate');
  146.                    pa('    [C]hange country''s name');
  147.                    pa('    [D]iplomatic relations');
  148.                    pa('    [H]elp');
  149.                    pa('    [L]ist nations');
  150.                    pa('    [M]ake announcement');
  151.                    pa('    [Q]uit to main menu');
  152.                    pa('    [S]end message');
  153.                    pa('    [V]iew global relationships');
  154.               end;
  155.      end;
  156. ex:  qut:=false;
  157.    until sel='Q';
  158. end;
  159.  
  160. overlay procedure economy;
  161. label ex;
  162. var
  163.    f,g,f2,f4:integer;
  164.    f1,f3:real;
  165.    sel,sel1,p:char;
  166.    regs:string[20];
  167.    hell,ski_resort,auntiem:boolean;
  168.    hd,hd1:bigstring;
  169.    tots:array[1..6] of index;
  170. procedure getcom(b:boolean);
  171. var p:char;
  172. begin
  173.      repeat
  174.            prt('which commodity [A,E,M,N,I,T,Q,?] ');
  175.            onek(p,'AEMNIT?Q');
  176.            if p='?' then if not b then begin
  177.               ab:=false;
  178.               pa('[A]griculture');
  179.               pa('[E]nergy');
  180.               pa('[M]etals');
  181.               pa('[N]onmetals');
  182.               pa('[I]ndustry');
  183.               pa('[T]echnology');
  184.               pa('[Q]uit');
  185.            end
  186.            else with region[f2] do begin
  187.                 print('            Commodity   Current Level   Price/Point   Credits');
  188.                 print('            =========   =============   ===========   =======');
  189.                 for co:=1 to 6 do print(pad(commods[co],21)+st(comm[co].devel,16)
  190.                                         +st(commworth[co]*10,14)+st(comm[co].credit,10));
  191.            end;
  192.      until p<>'?';
  193.      case p of
  194.           'A':co:=1;
  195.           'E':co:=2;
  196.           'M':co:=3;
  197.           'N':co:=4;
  198.           'I':co:=5;
  199.           'T':co:=6;
  200.           'Q':qut:=true;
  201.      end;
  202. end;
  203. begin
  204.      cls;
  205.      hell:=true;
  206.      ski_resort:=false;
  207.      repeat
  208.            nl;
  209.            prt('Economic option [B,E,G,H,I,O,P,Q,V,?] ');
  210.            onek(sel,'BDEGHIOPQV?');
  211.            case sel of
  212.                 'H':printfile('HELPE.GEO');
  213.                 'O':with nation[cn] do repeat
  214.                           prt('Organize ');
  215.                           getcom(false);
  216.                           if qut then goto ex;
  217.                           f1:=ncomm[co]+tcomm[co];
  218.                           print('You have '+st(f1,0)+' units of '+commods[co]+' total.');
  219.                           ynq('Place how many in domestic stockpile? ');
  220.                           getreal(f3,0,f1);
  221.                           ncomm[co]:=f3;
  222.                           tcomm[co]:=f1-f3;
  223.                           print('You have '+st(tcomm[co],0)+' units left in your trade stockpile.');
  224.                     until hell=ski_resort;
  225.                 'E':with nation[cn] do repeat
  226.                          prt('Set export-import levels for ');
  227.                          getcom(false);
  228.                          if qut then goto ex;
  229.                          print('Negative numbers represent import quotas; positive numbers indicate export.');
  230.                          ynq('Import-export level for '+commods[co]+':  ');
  231.                          getreal(exim[co],-100000.0,100000.0);
  232.                     until hell=ski_resort;
  233.                 'V':begin
  234.                          for f4:=1 to 6 do begin
  235.                              tots[f4].devel:=0;
  236.                              tots[f4].credit:=0;
  237.                          end;
  238.                          ab:=false;
  239.                          pa('                                   Development/Credits');
  240.                          pa(rheader+'     AGR     ENE     MET     NON     IND     TEC');
  241.                          pa(rqual+'     ===     ===     ===     ===     ===     ===');
  242.                          for f2:=1 to 80 do with region[f2] do if controller=cn then begin
  243.                              hd:=rname(f2);
  244.                              hd1:=hd;
  245.                              for f4:=1 to 6 do hd1:=hd1+pad(st(comm[f4].devel,0)+'/'+st(comm[f4].credit,0),8);
  246.                              for f4:=1 to 6 do begin
  247.                                  tots[f4].devel:=tots[f4].devel+comm[f4].devel;
  248.                                  tots[f4].credit:=tots[f4].credit+comm[f4].credit;
  249.                              end;
  250.                              pa(hd1);
  251.                          end;
  252.                          hd:=pad('Total:',length(rname(1)));
  253.                          for f4:=1 to 6 do hd:=hd+pad(st(tots[f4].devel,0)+'/'+st(tots[f4].credit,0),8);
  254.                          pa(hd);
  255.                          nl;
  256.                          pa('                [Stockpiles]     [Monthly levels]');
  257.                          pa('  Commodity   Domestic   Trade   Export   Import   ExIm Price');
  258.                          pa('  =========   ========   =====   ======   ======   ==========');
  259.                          with nation[cn] do for co:=1 to 6 do pa(pad(commods[co],11)+st(ncomm[co],11)+st(tcomm[co],8)
  260.                                        +st((exim[co]+abs(exim[co]))/2,9)+st((-exim[co]+abs(exim[co]))/2,9)+st(price[co],13));
  261.                     end;
  262.                 'B':repeat
  263.                         if embargo then goto ex;
  264. (* MOD BEGIN *)         if (nation[cn].Dinero<-50000000.0) then begin
  265.                           Pa('You are too deeply in debt to purchase anything.');
  266.                           pa('You are '+st(abs(nation[cn].dinero),0)+' in debt');
  267.                           pa('The world bank will only lend you money if you are less than');
  268.                           pa('50 million dollars in debt');
  269.                           Goto ex;
  270. (* MOD END *)           end;
  271.                         pmoney;
  272.                         prt('Buy ');
  273.                         getcom(false);
  274.                         if qut then goto ex;
  275.                         print('(? for sellers list)');
  276.                         getnat('Buy from ',f2,'N','P');
  277.                         if qut then goto ex;
  278.                         auntiem:=false;
  279.                         for f4:=1 to 20 do with nation[f4] do auntiem:=auntiem or (embarg[f2]>0);
  280.                         if not auntiem then begin
  281.                            ynq('How many units? ');
  282.                            getreal(f3,0,nation[f2].tcomm[co]);
  283.                            if qut then goto ex;
  284.                            f1:=adprice(f2,cn,co)*f3;
  285.                            print('Cost would be $'+st(f1,0));
  286.                            ynq('Deal? ');
  287.                            yah:=yn;
  288.                            if (nation[cn].dinero-f1)<-50000000.0 then
  289.                              begin
  290.                                pa('The world bank will not lend to heavy debtors');
  291.                                pa('The world bank will not let you go higher than 50 million in debt');
  292.                                goto ex;
  293.                              end;
  294.                            if yah then begin
  295.                               with nation[cn] do dinero:=dinero-f1;
  296.                               with nation[cn] do ncomm[co]:=ncomm[co]+f3;
  297.                               with nation[f2] do dinero:=dinero+f1;
  298.                               with nation[f2] do tcomm[co]:=tcomm[co]-f3;
  299.                               print('Done.');
  300.                            end else print('No transaction, then.');
  301.                         end
  302.                         else print('Sorry, '+nation[f2].nombre+' is currently being embargoed.');
  303.                     until hell=ski_resort;
  304.                 'I':begin
  305. (* BEGIN MOD *)      if (nation[cn].dinero<-75000000.0) then begin
  306.                        pa('The World Bank doesn''t credit heavy debtors.');
  307.                        pa('The World Bank will not lend you money to go higher than 75 million');
  308.                        pa('dollars in debt when increasing Development');
  309.                        goto ex;
  310. (* END MOD *)        end;
  311.                      getreg('Increase development in ',f2,'S','D');
  312.                      if qut then goto ex;
  313.                      with region[f2] do repeat
  314.                          prt('Develop ');
  315.                          getcom(true);
  316.                          if qut then goto ex;
  317.                          pmoney;
  318.                          ynq('Buy how many credits? ');
  319.                          getreal(f1,0,100);
  320.                          f3:=commworth[co]*f1*10;
  321.                          yah:=true;
  322.                          if f1>0 then ynq('Credits will cost $'+st(f3,0)+'.  Do it? ') else yah:=false;;
  323.                          if yah then yah:=yn;
  324.                          if not yah then qut:=true;
  325.                          if not qut then begin
  326.                             if (nation[cn].dinero-f3)<-75000000.0
  327.                               then begin
  328.                                 pa('The World Bank will not let you go higher than 75 million dollars');
  329.                                 pa('in debt when increasing Development');
  330.                                 goto ex;
  331.                               end;
  332.                             nation[cn].dinero:=nation[cn].dinero-f3;
  333.                             comm[co].credit:=comm[co].credit+f1;
  334.                          end;
  335.                      until hell=ski_resort;
  336.                     end;
  337.                 'G':begin
  338.                       if embargo then goto ex;
  339.                       getnat('Send commodities to ',f2,'F','C');
  340.                       if qut then goto ex;
  341.                       art.mess:=nation[cn].nombre+' sent you ';
  342.                       for co:=1 to 6 do begin
  343.                          print('You have '+st(nation[cn].ncomm[co],0)+' units of '+commods[co]+'.');
  344.                          ynq('Send how many units? ');
  345.                          getreal(f3,0,nation[cn].ncomm[co]);
  346.                          if qut then goto ex;
  347.                          with nation[f2] do ncomm[co]:=ncomm[co]+f3;
  348.                          with nation[cn] do ncomm[co]:=ncomm[co]-f3;
  349.                          art.mess:=art.mess+st(f3,0)+copy(commods[co],1,3)+': '+st(f3,0);
  350.                          if co<>6 then art.mess:=art.mess+'/';
  351.                       end;
  352.                       art.from:=21;
  353.                       art.por:=f2;
  354.                       sendmess;
  355.                     end;
  356.                 'P':repeat
  357.                           with nation[cn] do print('Your asking price ($) AGR:'+st(price[1],0)+'   ENE:'+st(price[2],0)+
  358.                     '   MET:'+st(price[3],0)+'   NON:'+st(price[4],0));
  359.                           print('IND:'+st(nation[cn].price[5],0)+'   TEC:'+st(nation[cn].price[6],0));
  360.                           prt('Change price for ');
  361.                           getcom(false);
  362.                           if not qut then begin
  363.                              ab:=false;
  364.                              pa('Sellers list for '+commods[co]);
  365.                              pa('                       Nation     Volume     Price/unit');
  366.                              pa('                       ======     ======     ==========');
  367.                              for f2:=1 to 20 do if f2<>cn then with nation[f2] do
  368.                                  pa(nname(f2)+st(tcomm[co],11)+st(price[co],15));
  369.                              ynq('New price? ');
  370.                              getreal(f1,0,10000000000.0);
  371.                              if qut then goto ex;
  372.                              if f1>0 then nation[cn].price[co]:=f1;
  373.                           end;
  374.                     until qut;
  375.                 '?':begin
  376.                          ab:=false;
  377.                          pa('    [B]uy commodities');
  378.                          pa('    [E]xport-Import control');
  379.                          pa('    send [G]oods to friendly nation');
  380.                          pa('    [H]elp');
  381.                          pa('    [I]ncrease development levels');
  382.                          pa('    [O]rganize domestic and trade stockpiles');
  383.                          pa('    [P]rices');
  384.                          pa('    [Q]uit to main menu');
  385.                          pa('    [V]iew national economic status');
  386.                     end;
  387.            end;
  388. ex:        qut:=false;
  389.      until sel='Q';
  390. end;
  391.  
  392. overlay procedure milit;
  393. label ex;
  394. var
  395.    f1,f2,f3,f5:integer;
  396.    f4,f6,f7:real;
  397.    sel,sel1:char;
  398.    reserve,reserve2:force;
  399.    ccomm:array[1..6] of real;
  400.    q:boolean;
  401. begin
  402.      cls;
  403.      repeat
  404.            nl;
  405.            prt('Military command [A,B,D,E,H,N,Q,S,T,V,?] ');
  406.            onek(sel,'ABDHENQSTV?');
  407.            case sel of
  408.                 'H':printfile('HELPM.GEO');
  409.                 'A':if nation[cn].attacks>0 then begin
  410.                         if embargo then goto ex;
  411.                         inv:=true;
  412.                         getreg('Attack ',f1,'H','W');
  413.                         if qut then goto ex;
  414.                         f2:=region[f1].controller;
  415.                         for f3:=1 to 4 do begin
  416.                             ynq('Use how many '+weaps[f3]+' [0..'+st(nation[cn].military[f3],0)+']? ');
  417.                             getreal(reserve[f3],0,nation[cn].military[f3]);
  418.                             if qut then goto ex;
  419.                             reserve[f3]:=nation[cn].military[f3]-reserve[f3];
  420.                         end;
  421.                         for f3:=1 to 4 do with nation[cn] do military[f3]:=military[f3]-reserve[f3];
  422.                         for f3:=1 to 4 do with nation[f2] do begin
  423.                             f7:=int(military[f3]/4);
  424.                             military[f3]:=military[f3]-f7;
  425.                             reserve2[f3]:=f7;
  426.                         end;
  427.                         with nation[cn] do begin
  428.                              ccomm[1]:=int(2*military[1]/500);
  429.                              ccomm[2]:=int(military[1]/500)+military[2]+2*military[3]+3*military[4];
  430.                              ccomm[3]:=military[2]+military[3]+2*military[4];
  431.                              ccomm[4]:=int(military[1]/500)+2*military[2]+3*military[3]+5*military[4];
  432.                              ccomm[5]:=3*military[2]+3*military[3]+4*military[4];
  433.                              ccomm[6]:=military[2]+military[3]+military[4];
  434.                              for f3:=1 to 6 do ccomm[f3]:=int(ccomm[f3]/5);
  435.                         end;
  436.                         q:=false;
  437.                         with nation[cn] do for f3:=1 to 3 do q:=q or (ccomm[f3]>ncomm[f3]);
  438.                         print('The attack will consume:');
  439.                         for f3:=1 to 6 do print('   '+st(ccomm[f3],0)+' units of '+commods[f3]);
  440.                         pstock;
  441.                         ynq('Go through with the attack? ');
  442.                         yah:=false;
  443.                         if q then print('No (not enough commodities in national stockpile)') else yah:=yn;
  444.                         if not yah then for f3:=1 to 4 do begin
  445.                            with nation[cn] do military[f3]:=military[f3]+reserve[f3];
  446.                            with nation[f2] do military[f3]:=military[f3]+reserve2[f3];
  447.                         end;
  448.                         if yah then begin
  449.                          for f3:=1 to 3 do with nation[cn] do ncomm[f3]:=ncomm[f3]-ccomm[f3];
  450.                          fight(nation[cn].military,nation[f2].military,10/(cont(f2)+5));
  451.                          addon('*** Conflict in '+region[f1].nombre);
  452.                          case victor of
  453.                               0:begin
  454.                                      print('Stalemate.');
  455.                                      addon('   '+nation[f2].nombre+' and '+nation[cn].nombre+' fought to a standstill.');
  456.                                 end;
  457.                               1:begin
  458.                                      print('Victory!  '+nation[cn].nombre+' now controls '+region[f1].nombre+'.');
  459.                                      addon('   '+nation[cn].nombre+' defeated '+nation[f2].nombre+' and took the region.');
  460.                                      region[f1].controller:=cn;
  461.                                      with region[f1] do begin
  462.                                           f7:=men/10;
  463.                                           men:=men-f7;
  464.                                           rebels[1]:=rebels[1]+f7;
  465.                                      end;
  466.                                 end;
  467.                               2:begin
  468.                                      print('Miserable defeat.');
  469.                                    addon('   '+nation[f2].nombre+' decisively defeated the invader, '+nation[cn].nombre+'.');
  470.                                 end;
  471.                          end;
  472.                          census;
  473.                          for f3:=1 to 4 do begin
  474.                              with nation[f2] do military[f3]:=military[f3]+reserve2[f3];
  475.                              with nation[cn] do military[f3]:=military[f3]+reserve[f3];
  476.                          end;
  477.                          nation[cn].attacks:=0;
  478.                         end;
  479.                     end
  480.                     else print('Your army may not attack again this month.');
  481.                 'B':repeat
  482.                       if (nation[cn].dinero<-50000000.0) then
  483.                         begin
  484.                           writeln;
  485.                           print('You are too heavily in debt');
  486.                           writeln;
  487.                           goto ex;
  488.                         end;
  489.                           pmoney;
  490.                           pstock;
  491.                           repeat
  492.                                 prt('Build what [T,P,Q,S,?] ');
  493.                                 onek(sel1,'TPQS?');
  494.                                 if sel1='?' then begin
  495.                                    print('                     [cost/weapon]');
  496.                                    print('  Weapon   Owned   MET   NON   IND   TEC   Money (millions of $)');
  497.                                    print('  ======   =====   ===   ===   ===   ===   =====');
  498.                                    with nation[cn] do for f5:=2 to 4 do print(pad(pweaps[f5],8)+st(military[f5],8)
  499.                      +st(weapcost[f5,3],6)+st(weapcost[f5,4],6)+st(weapcost[f5,5],6)+st(weapcost[f5,6],6)+st(weapmon[f5],8));
  500.                                    print('or [Q]uit');
  501.                                 end;
  502.                           until sel1<>'?';
  503.                           case sel1 of
  504.                                'T':f1:=2;
  505.                                'P':f1:=3;
  506.                                'S':f1:=4;
  507.                                'Q':goto ex;
  508.                           end;
  509.                           f4:=nation[cn].ncomm[3]/weapcost[f1,3];
  510.                           with nation[cn] do for f5:=4 to 6 do f4:=minn(f4,ncomm[f5]/weapcost[f1,f5]);
  511.                           if f4>0 then with nation[cn] do begin
  512.                              ynq('How many '+weaps[f1]+' do you wish to build? ');
  513.                              getreal(f6,0,f4);
  514.                              if qut then goto ex;
  515.                              if (nation[cn].dinero-f6*weapmon[f1]*1000000.0)<-50000000.0
  516.                                then begin
  517.                                  writeln('You will be too heavily in debt to buy that much');
  518.                                  writeln;
  519.                                  goto ex;
  520.                                end;
  521.                              for f5:=3 to 6 do ncomm[f5]:=ncomm[f5]-f6*weapcost[f1,f5];
  522.                              military[f1]:=military[f1]+f6;
  523.                              dinero:=dinero-f6*weapmon[f1]*1000000.0;
  524.                           end
  525.                           else print('Not enough commodities available to build '+weaps[f1]+'.');
  526.                           ynq('Build more weapons? ');
  527.                           yah:=yn;
  528.                     until not yah;
  529.                 'D':with nation[cn] do for f1:=2 to 4 do begin
  530.                         print(nombre+' has '+st(military[f1],0)+' '+weaps[f1]);
  531.                         ynq('Destroy how many? ');
  532.                         getreal(f4,0,military[f1]);
  533.                         if qut then goto ex;
  534.                         if f4>0 then begin
  535.                          for f2:=3 to 6 do ccomm[f2]:=f4*weapcost[f1,f2]/2;
  536.                          print('Salvage value:');
  537.                          print('MET: '+st(ccomm[3],0)+' NON:'+st(ccomm[4],0)+' IND:'+st(ccomm[5],0)+' TEC:'+st(ccomm[6],0));
  538.                          ynq('Destroy the '+weaps[f1]+'?');
  539.                          yah:=yn;
  540.                          if yah then begin
  541.                             military[f1]:=military[f1]-f4;
  542.                             for f2:=3 to 6 do ncomm[f2]:=ncomm[f2]+ccomm[f2];
  543.                          end;
  544.                         end;
  545.                     end;
  546.                 'E':with nation[cn] do begin
  547.                          f6:=military[4];
  548.                          getnat('Change embargo on ',f1,'W','E');
  549.                          if qut then goto ex;
  550.                          f7:=embarg[f1];
  551.                          print('You have '+st(f6,0)+' ships available in your navy.');
  552.                          print('You have '+st(f7,0)+' ships embargoing '+nation[f1].nombre);
  553.                          ynq('How many ships do you want to embargo '+nation[f1].nombre+' with? ');
  554.                          getreal(f4,0,f6+f7);
  555.                          if qut then goto ex;
  556.                          embarg[f1]:=f4;
  557.                          military[4]:=f6+f7-f4;
  558.                          if (f7=0) and (f4>0) then addon(nation[cn].nombre+' embargoed '+nation[f1].nombre);
  559.                          if (f7>0) and (f4=0) then addon(nation[cn].nombre+' lifted its embargo on '+nation[f1].nombre);
  560.                     end;
  561.                 'N':begin
  562.                          if embargo then cn:=cn else begin
  563.                             print('No embargoes against you.');
  564.                             goto ex;
  565.                          end;
  566.                          getnat('Break embargo of ',f1,'W','E');
  567.                          if qut then goto ex;
  568.                          with nation[f1] do if embarg[cn]=0 then begin
  569.                               print(nombre+' has no ships embargoing you.');
  570.                               goto ex;
  571.                          end;
  572.                          f4:=nation[cn].military[3]/(nation[f1].military[3]+1);
  573.                          repeat
  574.                                fleetbattle(nation[cn].military[4],nation[f1].embarg[cn],f4);
  575.                          until not yah or (nation[cn].military[4]=0) or (nation[f1].embarg[cn]=0);
  576.                          if yah and (nation[cn].military[4]>0) then begin
  577.                             print('Embargo broken!');
  578.                             art.mess:=nation[cn].nombre+' broke your embargo.';
  579.                             art.from:=21;
  580.                             art.por:=f1;
  581.                             sendmess;
  582.                          end;
  583.                          addon(nation[cn].nombre+' attacked the embargo of '+nation[f1].nombre);
  584.                     end;
  585.                 'T':begin
  586.                          getreg('Transfer soldiers to/from ',f1,'S','T');
  587.                          if qut then goto ex;
  588.                          print('Army has '+st(nation[cn].military[1],0)+' men in it.');
  589.                          with region[f1] do print(nombre+' has '+st(men,0)+' eligible men.');
  590.                          print('(Positive for draft, negative for discharge)');
  591.                          ynq('How many soldiers do you wish to transfer? ');
  592.                          getreal(f4,-nation[cn].military[1],region[f1].men);
  593.                          if qut then goto ex;
  594.                          with nation[cn] do military[1]:=military[1]+f4;
  595.                          with region[f1] do men:=men-f4;
  596.                          print('Army now has '+st(nation[cn].military[1],0)+' men in it.');
  597.                          with region[f1] do print(nombre+' now has '+st(men,0)+' eligible men left in it.');
  598.                     end;
  599.                 'V':begin
  600.                          with nation[cn] do for f1:=1 to 4 do print(weaps[f1]+':  '+st(military[f1],0));
  601.                          print('Total strength:  '+st(strength(nation[cn].military),0));
  602.                          with nation[cn] do for f1:=1 to 20 do if embarg[f1]>0 then
  603.                           print('You have '+st(embarg[f1],0)+' ships embargoing '+nation[f1].nombre);
  604.                     end;
  605.                 'S':begin
  606.                          inv:=true;
  607.                          getreg('Bomb ',f1,'H','W');
  608.                          if qut then goto ex;
  609.                          f2:=region[f1].controller;
  610.                          ynq('Use how many planes, up to '+st(nation[cn].military[3],0)+'? ');
  611.                          getreal(f4,0,nation[cn].military[3]);
  612.                          if qut or (f4=0) then goto ex;
  613.                          prt('[P]opulation centers or [F]actories? ');
  614.                          onek(sel1,'PFQ');
  615.                          if sel1='Q' then goto ex;
  616.                          print('Encountering enemy air defenses...');
  617.                          f6:=int(random*f4);
  618.                          if nation[f2].military[3]<nation[cn].military[3] then f6:=f6/2;
  619.                          if nation[f2].military[3]<3 then f6:=f6/2;
  620.                          f6:=minn(f6,f4)+1;
  621.                          prompt('You lost '+st(f6,0)+' plane(s) in the raid...');
  622.                          with nation[cn] do military[3]:=military[3]-f6;
  623.                          f4:=f4-f6;
  624.                          if f4=0 then begin
  625.                             print('No planes left to bomb with.');
  626.                             goto ex;
  627.                          end;
  628.                          case sel1 of
  629.                               'P':begin
  630.                                        f7:=int(random(round(region[f1].wandc+region[f1].men))*minn(100,f4)/100);
  631.                                        print('but killed '+st(f7,0)+' people!');
  632.                                        with region[f1] do begin
  633.                                             wandc:=wandc-round(2*f7/3);
  634.                                             men:=men-round(f7/3);
  635.                                        end;
  636.                                   end;
  637.                               'F':begin
  638.                                        f3:=random(6)+1;
  639.                                        f5:=round(minn(f4/3,random(10)+1))+1;
  640.                                        f5:=round(minn(f5,region[f1].comm[f3].devel));
  641.                                        print('but reduced production of '+commods[f3]+' by '+st(f5,0)+' units!');
  642.                                        with region[f1].comm[f3] do devel:=devel-f5;
  643.                                   end;
  644.                          end;
  645.                     end;
  646.                 '?':begin
  647.                          ab:=false;
  648.                          pa('    [A]ttack enemy region');
  649.                          pa('    [B]uild weapons');
  650.                          pa('    [D]estroy weapons');
  651.                          pa('    [E]mbargo levels');
  652.                          pa('    [H]elp');
  653.                          pa('    attack embargoing [N]avies');
  654.                          pa('    [Q]uit to main menu');
  655.                          pa('    air[S]trike enemy region');
  656.                          pa('    change [T]roop size');
  657.                          pa('    [V]iew military');
  658.                     end;
  659.            end;
  660. ex:        qut:=false;
  661.      until sel='Q';
  662. end;
  663.