home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / uswar.zip / WIND.PAS < prev   
Pascal/Delphi Source File  |  1986-02-07  |  3KB  |  125 lines

  1.  
  2. Procedure TheaWind(t:integer);     {Display Theater data}
  3.  
  4. Var i,j:integer;
  5.  
  6. begin
  7. NormVideo;
  8. Window(1,1,80,25);
  9. With Theater[t] do
  10.   begin
  11.     Windx:=x;                       {Save restore values}
  12.     Windy:=y;
  13.     Winddx:=25;
  14.     Winddy:=max+3;
  15.     Border(x,y,winddx,max+3,2,15,0);
  16.     Window(x+1,y+1,x+winddx-2,y+winddy-2);
  17.     ClrScr;
  18.     Gotoxy(5,1);
  19.     FastWrite(Name,15,0,1);
  20.     for i:=1 to max do
  21.       begin
  22.         Gotoxy(2,1+i);                {Display ships in theater}
  23.         j:=Allied_Fleet[t,i];
  24.         if j<>0 then
  25.             with Allied_Navy[j] do
  26.             Fastwrite(id,15,0,3);
  27.         Gotoxy(13,1+i);
  28.         j:=Axis_Fleet[t,i];
  29.         if j<>0 then
  30.             with Axis_Navy[j] do
  31.             Fastwrite(id,15,0,3);
  32.       end;
  33.  
  34.   end;
  35. Window(1,1,80,25);
  36. end;
  37.  
  38. Procedure KbdRd;
  39. begin
  40.   read(kbd,c);
  41.   if (c='Q') or (c='q') then quitsw:=1;
  42. end;
  43.  
  44. Procedure Restore;                  {Restore window to pic values}
  45. begin
  46. Window(1,1,80,25);
  47. For i:=Windy to (Windy+Winddy) do
  48.   begin
  49.     Gotoxy(Windx,i);
  50.     Fastwrite(copy(screen[i],Windx,Winddx),7,0,1);
  51.   end;
  52. end;
  53.  
  54. procedure Dispstatus(n:integer);        {Display status on ship n}
  55.  
  56. begin
  57.  
  58. Window(1,1,80,25);
  59. Restore;
  60. Windx:=21;                          {Setup window}
  61. Windy:=8;
  62. Winddx:=28;
  63. Winddy:=12;
  64. Border(Windx,windy,winddx,winddy,1,15,0);
  65. Window(Windx+1,Windy+1,Windx+Winddx-2,Windy+winddy-2);
  66. ClrScr;
  67. Gotoxy(1,10);                                   {Display static data}
  68. FastWrite('PRESS ANY KEY TO CONTINUE',7,0,1);
  69. Gotoxy(1,1);
  70. FastWrite(' ID:',7,0,1);
  71. Gotoxy(1,2);
  72. Fastwrite(' Model:',7,0,1);
  73. Gotoxy(1,3);
  74. FastWrite(' Attack:',7,0,1);
  75. Gotoxy(1,4);
  76. FastWrite(' Defense:',7,0,1);
  77. Gotoxy(1,5);
  78. FastWrite(' Damage',7,0,1);
  79. Gotoxy(1,6);
  80. FastWrite(' Theater:',7,0,1);
  81. Gotoxy(1,7);
  82. FastWrite(' Location:',7,0,1);
  83. with Allied_Navy[n] do
  84. begin
  85.   Gotoxy(12,1);
  86.   FastWrite(ID,7,0,1);
  87.   Gotoxy(12,2);
  88.   If Model='A' then Fastwrite('Carrier',7,0,1);
  89.   If Model='S' then Fastwrite('Submarine',7,0,1);
  90.   If Model='C' then Fastwrite('Crusier',7,0,1);
  91.   If Model='V' then Fastwrite('Convoy',7,0,1);
  92.   If Model='B' then Fastwrite('Battleship',7,0,1);
  93.   If Model='D' then Fastwrite('Destroyer',7,0,1);
  94.   If Model='K' then Fastwrite('Kamikazi',7,0,1);
  95.   If Model='M' then Fastwrite('Mtr.Ptl.Bt.',7,0,1);
  96.   If Model='P' then Fastwrite('Planes',7,0,1);
  97.   LowVideo;
  98.   Gotoxy(12,3);
  99.   write(Attack);
  100.   Gotoxy(12,4);
  101.   write(Defense);
  102.   gotoxy(12,5);
  103.   write(damage);
  104.   i:=0;j:=0;
  105.   if Theater<>0 then i:=theater;
  106.   if Fleet<>0 then j:=fleet;
  107. end;
  108. gotoxy(12,6);
  109. if i=0 then
  110.    Fastwrite('Unlimited',7,0,1)
  111. else with Theater[i] do
  112.    Fastwrite(Name,7,0,1);
  113. gotoxy(12,7);
  114. if j=0 then
  115.    Fastwrite('In port',7,0,1)
  116. else with Theater[j] do
  117.    Fastwrite(Name,7,0,1);
  118. Uncursor;
  119. KbdRd;
  120. Window(1,1,80,25);
  121. Restore;
  122. TheaWind(theano);
  123. end;
  124.  
  125.