home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / BBSONLIN / SUPDOM1.ZIP / OVERLAY3.DOM < prev    next >
Text File  |  1991-02-24  |  8KB  |  234 lines

  1. { for Dominions! version 2.00TC - October 1989 }
  2. { for Super Dominions v 1.00, August 1990 }
  3.  
  4. { *!*!*!*!* The following procedures are called from more than one procedure.
  5.   The procedures from which they are called are listed after the procedure's
  6.   name is declared. *!*!*!*!*!* }
  7.  
  8.    function Check_Planets : Boolean;
  9.  
  10.       Begin
  11.          Check_Planets := true;
  12.          if Empire[Player_Number].Planets <= 0 then
  13.             Begin
  14.                print ('You have no planets!');
  15.                Check_Planets := false;
  16.             End;
  17.       End;
  18.  
  19. function RoundOff (RON : Real) : Real;
  20.  
  21.   Var
  22.    P : Real;
  23.  
  24.   Begin
  25.     p:=frac(ron);
  26.     if P < 0.5 then RoundOff := RON - P;
  27.     if P >= 0.5 then RoundOff := RON + 1 - P;
  28.   End;
  29.  
  30. function Distance_Between (Planet1,Planet2 : Planetrecord) : Real;
  31.       { -AtA: Creates "Real-Space" Galaxy }
  32.       { Called from Compute_Distance and Move_Ships }
  33.  
  34.   Var
  35.     dX, dY : Integer;
  36.   Begin
  37.      dX := abs( Planet1.X - Planet2.X);
  38.      if dX > 50 then dX := abs(dX - 100);
  39.      dY := abs( Planet1.Y - Planet2.Y);
  40.      if dY > 50 then dY := abs(dY - 100);
  41.  
  42.      Distance_Between:= sqrt (sqr (dX) + sqr(dY));
  43.  
  44.   end;
  45.  
  46. function Score (Which_Empire : Integer) : Real;
  47.  
  48.    { = Called from Maintenence & Scores & Save_All = }
  49.  
  50.    Var
  51.       LoopSC : Byte;
  52.       Temp_Score : Real;
  53.  
  54.    Begin
  55.       with Empire[Which_Empire] do
  56.          Begin
  57.             Temp_Score := Total_Population + Ships[1] * 100 +
  58.                Ships[2] * 200 + Ships[3] * 400 + Ships[4] * 800 +
  59.                   Ships[5] * 1600 + Ships[6] * 3200 + Ships[7] * 800 +
  60.                   Defense_Bases * 750 + Radars[1] * 200 + Radars[2] * 400 +
  61.                   Radars[3] * 800;
  62.             for LoopSC := 1 to Planets do
  63.                Temp_Score := Temp_Score + 30000;
  64.          End;
  65.       Score := Temp_Score;
  66.    End;
  67.  
  68.    procedure Print_Empire (Which_Empire : Byte);
  69.  
  70.       { -= Called from Spy_Empire & Empire_Menu =- }
  71.  
  72.       Var
  73.          LoopPE : Byte;
  74.  
  75.       Begin
  76.          cls;
  77.          writeln;
  78.          print ('Empire Number : ' + St(Which_Empire));
  79.          print ('Name : ' + Empire[Which_Empire].Empire_Name);
  80.          print ('Planets : ' + St(Empire[Which_Empire].Planets));
  81.          print ('Technology Level : ' + StReal(Empire[Which_Empire].Technology_Level,1));
  82.          print ('Total Population : ' + St(Empire[Which_Empire].Total_Population));
  83.          print ('Industry Units : ' + St(Empire[Which_Empire].Industry_Units));
  84.          print ('Technology Units : ' + St(Empire[Which_Empire].Technology_Units));
  85.          if Player_Number = Which_Empire then
  86.             print ('Intelligence Actions Left : ' + St(Empire[Which_Empire].Intel_Reports));
  87.          print ('Ships :');
  88.          for LoopPE := 1 to Number_of_Ships do
  89.             print ('   ' + Ship_Name[LoopPE] + ' : ' + St(Empire[Which_Empire].Ships[LoopPe]));
  90.          print (St(Empire[Which_Empire].Defense_Bases) + ' PDBs deployed.');
  91.          writeln;
  92.          if Empire[Which_Empire].Radars[1] > 0 then        {------SKA------}
  93.            print ( St(Empire[Which_Empire].Radars[1])
  94.                   + ' short range radar(s) installed.' );
  95.          if Empire[Which_Empire].Radars[2] > 0 then
  96.            print ( St(Empire[Which_Empire].Radars[2])
  97.                   + ' mid range radar(s) installed.' );
  98.          if Empire[Which_Empire].Radars[3] > 0 then
  99.            print ( St(Empire[Which_Empire].Radars[3])
  100.                   + ' long range radar(s) installed.' );
  101.          writeln;
  102.          PauseScr;
  103.       End;
  104.  
  105.    procedure Print_Planet (Which_Planet : Integer);
  106.  
  107.       { -= Called from Spy_Planet & Planet_Menu =- }
  108.  
  109.       Var
  110.          LoopPP : Integer;
  111.          Technology_Percent : Byte;
  112.  
  113.       Begin
  114.          cls;
  115.          writeln;
  116.          print ('Planet Number : ' + St(Which_Planet));
  117.          print ('Name : ' + Planet[Which_Planet].Planet_Name);
  118.          if Planet[Which_Planet].Owner <> Player_Number then
  119.             print ('Owner : ' + St(Planet[Which_Planet].Owner));
  120.          print ('Location [X,Y] : ' + St(Planet[Which_Planet].X) + ',' +
  121.             St(Planet[Which_Planet].Y));
  122.          print ('Population : ' + St(Planet[Which_Planet].Population));
  123.          print ('Habitability : ' + St(Planet[Which_Planet].Habitability) + ' %');
  124.          print ('Industrial Level : ' + StReal(Planet[Which_Planet].Industrial_Level,2));
  125.          if Planet[Which_Planet].Owner = Player_Number then
  126.             Begin
  127.                print ('Work Allocation :');
  128.                print ('   Industry : ' + St(Planet[Which_Planet].Industry_Percent) + ' %');
  129.                Technology_Percent := 100 - Planet[Which_Planet].Industry_Percent;
  130.                print ('   Technology : ' + St(Technology_Percent) + ' %');
  131.             End;
  132.          print ('Defenses :');
  133.          print ('   PDBs : ' + St(Planet[Which_Planet].Defense_Bases));
  134.          for LoopPP := 1 to Number_of_Ships do
  135.             print ('   ' + Ship_Name[LoopPP] + 's : ' + St(Planet[Which_Planet].Ships[LoopPP]));
  136.  
  137.          if Planet[Which_Planet].Radar = 1 then           {----SKA----}
  138.             print ( 'A short range radar installed' );
  139.          if Planet[Which_Planet].Radar = 2 then
  140.             print ( 'A mid range radar installed' );
  141.          if Planet[Which_Planet].Radar = 3 then
  142.             print ( 'A long range radar installed' );
  143.  
  144.          writeln;
  145.          PauseScr;
  146.       End;
  147.  
  148.    procedure List_Empires;
  149.  
  150.       { -= Called from Spy_Empire =- }
  151.  
  152.       Var
  153.          LoopLE : Byte;
  154.  
  155.       Begin
  156.          for LoopLE := 1 to Number_of_Players do
  157.             Begin
  158.                prompt (addfront(St(LoopLE),2) + '  ');
  159.                if Empire[LoopLE].User_Number = 0 then
  160.                  print ('Unowned')
  161.                else
  162.                  print (Empire[LoopLE].Empire_Name);
  163.             End;
  164.          PauseScr;
  165.       End;
  166.  
  167.    procedure List_Planets;
  168.  
  169.       { -= Called from Spy_Planet & Planet Menu =- }
  170.       {  Changed to 2 columns for "Super Dominions"  }
  171.  
  172.       Var
  173.          LoopLP     : Integer;
  174.          planetname : string[28];
  175.          abort      : boolean;
  176.          next       : boolean;
  177.          col1       : boolean;
  178.  
  179.       Begin
  180.          nl;
  181.          abort := false;
  182.          col1 := true;
  183.          loopLP := 0;
  184.          repeat
  185.            loopLP := loopLP + 1;
  186.            planetname := addfront(st(looplp),3)+'     ';
  187.            if Planet[LoopLP].Owner > 0 then
  188.             begin
  189.               planetname := planetname + addrear(Planet[LoopLP].Planet_Name,20);
  190.               Ansic (1);
  191.               if col1 then       { -AtA. }
  192.                 printa(' ' + planetname + addfront(St(Planet[LoopLP].Owner),5) + '  ',abort,next)
  193.               else
  194.                 printacr(planetname + addfront(St(Planet[LoopLP].Owner),5),abort,next);
  195.               col1 := not col1;
  196.             end;
  197.          until (loopLP = number_of_planets) or abort;
  198.       End;
  199.  
  200.    procedure Add_On (Article : String160);
  201.  
  202.       Var
  203.          Recent_Happenings : Text;
  204.  
  205.       Begin
  206.          Assign (Recent_Happenings, 'Today.Dom');
  207.          Append (Recent_Happenings);
  208.          writeln (Recent_Happenings, Article);
  209.          close (Recent_Happenings);
  210.       End;
  211.  
  212.    procedure Send_Message (From, To_Whom : Integer; Msg : String160; Var Messages : Messagerecs);
  213.  
  214.       Var
  215.          LoopSM : Byte;
  216.  
  217.       Begin
  218.          LoopSM := 0;
  219.          Repeat
  220.             LoopSM := LoopSM + 1;
  221.             if LoopSM > Number_of_Messages then
  222.                Begin
  223.                   print ('>All Message Records are Filled<');
  224.                   Exit;
  225.                End;
  226.          Until (Messages[LoopSM].Sent_To = 0);
  227.          with Messages[LoopSM] do
  228.             Begin
  229.                Sent_By := From;
  230.                Sent_To := To_Whom;
  231.                Message := Msg;
  232.             End;
  233.       End;
  234.