TABLE OF CONTENTS


Combat/Combat [ Packages ]

[ Top ] [ Packages ]

FUNCTION

 Provide code for ship to ship combat

SOURCE

package Combat is

Combat/Combat.Guns_Container [ Types ]

[ Top ] [ Combat ] [ Types ]

FUNCTION

 Used to store data for player ship guns

SOURCE

   package Guns_Container is new Vectors
     (Index_Type => Positive, Element_Type => Guns_Info_Array);

Combat/Combat.Guns_Info_Array [ Types ]

[ Top ] [ Combat ] [ Types ]

FUNCTION

 Data structure for gun information: 1 - Gun index in ship modules
 list, 2 - Gunner order, 3 - Amount of shoots from the gun, value below
 zero means that gun shoot once per that amount of rounds

SOURCE

   type Guns_Info_Array is array(1 .. 3) of Integer with
      Default_Component_Value => 0;

Combat/Combat.Enemy_Record [ Records ]

[ Top ] [ Combat ] [ Records ]

FUNCTION

 Data structure for enemies

SOURCE

   type Enemy_Record is record
      Ship: Ship_Record;
      Distance: Integer := 0;
      Loot: Natural := 0;
      Harpoon_Duration: Natural := 0;
      Guns: Guns_Container.Vector;
   end record;

PARAMETERS

 Ship             - Ship data for enemy
 Distance         - Current distance to enemy
 Loot             - Amount of loot(money) looted from ship
 Harpoon_Duration - How long (amount of rounds) ship will be stopped by
                    player harpoon
 Guns             - List of guns installed on the enemy ship

Combat/Combat.Empty_Enemy [ Constants ]

[ Top ] [ Combat ] [ Constants ]

FUNCTION

 Empty enemy info data

SOURCE

   Empty_Enemy: constant Enemy_Record := (others => <>);

Combat/Combat.Empty_Guns [ Constants ]

[ Top ] [ Combat ] [ Constants ]

FUNCTION

 An empty gun info

SOURCE

   Empty_Guns: constant Guns_Info_Array := (others => <>);

Combat/Combat.Enemy [ Variables ]

[ Top ] [ Combat ] [ Variables ]

FUNCTION

 Enemy information

SOURCE

   Enemy: Enemy_Record;

Combat/Combat.Enemy_Ship_Index [ Variables ]

[ Top ] [ Combat ] [ Variables ]

FUNCTION

 Prototype index of enemy ship

SOURCE

   Enemy_Ship_Index: Natural;

Combat/Combat.Harpoon_Duration [ Variables ]

[ Top ] [ Combat ] [ Variables ]

FUNCTION

 How long (amount of rounds) player ship will be stopped by enemy harpoon

SOURCE

   Harpoon_Duration: Natural;

Combat/Combat.Messages_Starts [ Variables ]

[ Top ] [ Combat ] [ Variables ]

FUNCTION

 Start index for showing messages

SOURCE

   Messages_Starts: Natural;

Combat/Combat.Old_Speed [ Variables ]

[ Top ] [ Combat ] [ Variables ]

FUNCTION

 Speed of player ship before combat

SOURCE

   Old_Speed: Ship_Speed := FULL_SPEED;

Combat/Combat.Combat_Turn [ Subprograms ]

[ Top ] [ Combat ] [ Subprograms ]

FUNCTION

 Count damage/ships actions, etc

SOURCE

   procedure Combat_Turn;

Combat/Combat.Start_Combat [ Subprograms ]

[ Top ] [ Combat ] [ Subprograms ]

FUNCTION

 Generate enemy and start battle

SOURCE

   function Start_Combat
     (Enemy_Index: Positive; New_Combat: Boolean := True) return Boolean;

PARAMETERS

 Enemy_Index - Index of prototype ship of enemy which will be created
 New_Combat  - If true, it is a new combat. Default is true.

RESULT

 True if combat starts, otherwise false