Formula Definition
================================================


Operators:
  +    - Add                        - Returns A + B. 
  -    - Subtract                   - Returns A - B. 
  /    - Divide                     - Returns A / B. 
  *    - Multiply                   - Returns A * B. 
  ^    - Power                      - Returns A raised to the power of B. 
  AND  - And                        - Returns TRUE if A and B are both TRUE, otherwise returns FALSE. 
  OR   - Or                         - Returns TRUE if A or B are TRUE, otherwise returns FALSE. 
  NOT  - Not                        - Returns TRUE if A is FALSE, and returns FALSE if A is TRUE. 
  <>   - Not Equal To               - Returns FALSE if A = B, otherwise returns TRUE. 
  =    - Equal To                   - Returns TRUE if A = B, otherwise returns FALSE. 
  >    - Greater Than               - Returns TRUE if A is greater than B, otherwise returns FALSE. 
  >=   - Greater Than Or Equal To   - Returns TRUE if A is greater than B or equal to B, otherwise returns FALSE. 
  <    - Less Than                  - Returns TRUE if A is less than B, otherwise returns FALSE. 
  <=   - Less Than Or Equal To      - Returns TRUE if A is less than B or equal to B, otherwise returns FALSE. 

Variables:
  [%  %] - Variable Name (defined by data file used) 
           Common Variables: [%Level%] - Level of this item. 

Constants:
  ####### - Integer Number
  ####.## - Real Number
  -###### - Negative Number
  "     " - String
  TRUE    - True
  FALSE   - False 

Math Functions:
  Max(A, B): real                   - Returns the maximum of A and B. 
    A: real
    B: real
  Min(A, B): real                   - Returns the minimum of A and B. 
    A: real
    B: real
  Int(A): real                      - Returns the whole number portion of A rounded twoards zero. 
    A: real
  Frac(A): real                     - Returns the factional part of A. 
    A: real
  Trunc(A): real                    - Returns the whole number portion of A. 
    A: real
  Round(A): real                    - Rounds A to the nearest whole number. 
    A: real
  Exp(A): real                      - Returns e raised to the power of A, where e is the base of the natural logarithms. 
    A: real
  Ln(A): real                       - Returns the natural logarithm (Ln(e) = 1) of A.
    A: real
  Pi(): real                        - Returns the value of Pi (3.1415926535897932385).
  Power(A, B): real                 - Returns A raised to the power of B. 
    A: real
  Sqr(A): real                      - Returns the value A*A. 
    A: real
  Sqrt(A): real                     - Returns the square root of A. 
    A: real
  Random(A, B): real                - Returns a random number between A and B. 
    A: real
    b: real

Expression Functions
  IIF(A, B, C): real                - If A is true, then B is returned otherwise C is returned. 
    A: boolean
    B: real
    C: real

String Functions
  StringCompare(A, B): boolean      - Returns TRUE if A = B. This is the same as the expression A = B. 
    A: string
    B: string




Game Functions
  Get_Component_Weapon_Type(): string                       - Returns the Weapon Type of this component.         
                                                              Return Values: Direct Fire, Seeking, Point Defense, Warhead, None
  Get_Vehicle_Size_Tonnage(): real                          - Returns the vehicle size tonnage of this vehicle. 
                                                              Return Values: Tonnage size number. 
  Get_Vehicle_Type(): string                                - Returns the vehicle type of this vehicle. 
                                                              Return Values: Ship, Base, [Unit Type from VehicleUnitTypes.txt]
  Get_Empire_Tech_Level(A): real                            - Returns the tech level for this empire in tech area A.  
    A: string                                                 Return Values: Tech level number. 
  Get_Game_Date(): real                                     - Returns the current game date. 
                                                              Return Values: Game date number in the form ##### = ####.#
  Empire_Has_Racial_Trait(A): boolean                       - Returns TRUE if this empire has Racial Trait A. 
    A: string                                                 Return Values: TRUE or FALSE
  Empire_Has_Found_Unique_Discovery(A): boolean             - Returns TRUE if this empire has found unique discovery A. 
    A: real                                                   Return Values: TRUE or FALSE 
  Evaluate_Requirement(A): boolean                          - Returns TRUE if Requirement A evaluates to TRUE, otherwise return FALSE. 
    A: real                                                   Return Values: TRUE or FALSE  
  Design_Has_Component_Type(A): boolean                     - Returns TRUE if this design has a component of type A on it.
    A: string                                                 Return Values: TRUE or FALSE  
  Get_Design_Ability_Component_Count(A): real               - Returns the number of components on the design that have this ability. 
    A: string                                                 Return Values: number of components. 
  Get_Design_Ability_Total(A, B): real                      - Returns the total value of this slot(B) in this ability(A).  
    A: string                                                 Return Values: total value of the ability
    B: long                                                 
  Get_Design_Ability_Percentage_Of_Hull_Space(A, B): real   - Returns the percentage of tonnage space used for this ability A, sub type B. 
    A: string                                               - Return Values: percentage amount. 
    B: string
  Get_Design_Specific_Component_Count(A): real              - Returns the number of components with a name of A. 
    A: string                                                 Return Values: TRUE or FALSE  
  Get_Number_Of_Full_Empires(): real                        - 

  Get_Empire_Score(A): real                                 -
    A: real - player number
  Empire_Is_Human_Controlled(A): boolean                    -
    A: real - player number
  Get_Player_Percent_Score_Of_Next_Highest_Player(A): real  -
    A: real - player number
  Get_Empire_Percent_Of_Entire_Tech_Tree_Researched(A): real - 
    A: real - player number
  Get_Number_Of_Years_Of_Peace(): real                      -

  Get_Empire_Colonized_Percent_Of_Map(A): real              -
    A: real - player number
  Get_Number_Of_Empires_Homeworlds(A): real                 - 
    A: real - player number
  Get_Number_Of_Other_Empires_Homeworlds(A): real           -
    A: real - player number