TABLE OF CONTENTS
- 1. Combat/Combat
- 1.1. Combat/CUI
- 1.1.1. CUI/CUI.Show_Combat_Ui
- 1.2. Combat/Combat.Guns_Container
- 1.3. Combat/Combat.Guns_Info_Array
- 1.4. Combat/Combat.Enemy_Record
- 1.5. Combat/Combat.Empty_Enemy
- 1.6. Combat/Combat.Empty_Guns
- 1.7. Combat/Combat.Enemy
- 1.8. Combat/Combat.Enemy_Ship_Index
- 1.9. Combat/Combat.Harpoon_Duration
- 1.10. Combat/Combat.Messages_Starts
- 1.11. Combat/Combat.Old_Speed
- 1.12. Combat/Combat.Combat_Turn
- 1.13. Combat/Combat.Start_Combat
Combat/Combat [ Packages ]
FUNCTION
Provide code for ship to ship combat
SOURCE
package Combat is
Combat/Combat.Guns_Container [ 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 ]
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