TABLE OF CONTENTS
- 1. Ships/Ships
- 1.1. Ships/SCargo
- 1.1.1. SCargo/SCargo.Free_Cargo
- 1.1.2. SCargo/SCargo.Update_Cargo
- 1.2. Ships/SCrew
- 1.2.1. SCrew/SCrew.Death
- 1.2.2. SCrew/SCrew.Delete_Member
- 1.2.3. SCrew/SCrew.Find_Member
- 1.2.4. SCrew/SCrew.Give_Orders
- 1.2.5. SCrew/SCrew.Update_Morale
- 1.3. Ships/SMovement
- 1.4. Ships/SRepairs
- 1.5. Ships/SUI2
- 1.5.1. SUI2/SUCargo
- 1.5.1.1. SUCargo/SUCargo.Cargo_Sort_Orders
- 1.5.1.2. SUCargo/SUCargo.Default_Cargo_Sort_Order
- 1.5.1.3. SUCargo/SUCargo.Cargo_Indexes
- 1.5.1.4. SUCargo/SUCargo.Cargo_Sort_Order
- 1.5.1.5. SUCargo/SUCargo.Cargo_Table
- 1.5.1.6. SUCargo/SUCargo.Add_Cargo_Commands
- 1.5.1.7. SUCargo/SUCargo.Drop_Item_Command
- 1.5.1.8. SUCargo/SUCargo.Give_Item_Command
- 1.5.1.9. SUCargo/SUCargo.Show_Cargo_Command
- 1.5.1.10. SUCargo/SUCargo.Show_Cargo_Item_Info_Command
- 1.5.1.11. SUCargo/SUCargo.Show_Drop_Item_Command
- 1.5.1.12. SUCargo/SUCargo.Show_Give_Item_Command
- 1.5.1.13. SUCargo/SUCargo.Sort_Cargo_Command
- 1.5.1.14. SUCargo/SUCargo.Update_Max_Give_Amount_Command
- 1.5.2. SUI2/SUCrew
- 1.5.2.1. SUCrew/SUCI
- 1.5.2.1.1. SUCI/SUCI.Inventory_Sort_Orders
- 1.5.2.1.2. SUCI/SUCI.Default_Inventory_Sort_Order
- 1.5.2.1.3. SUCI/SUCI.Inventory_Indexes
- 1.5.2.1.4. SUCI/SUCI.Inventory_Sort_Order
- 1.5.2.1.5. SUCI/SUCI.Inventory_Table
- 1.5.2.1.6. SUCI/SUCI.Member_Index
- 1.5.2.1.7. SUCI/SUCI.Add_Inventory_Commands
- 1.5.2.1.8. SUCI/SUCI.Move_Item
- 1.5.2.1.9. SUCI/SUCI.Reset_Selection
- 1.5.2.1.10. SUCI/SUCI.Move_Item_Command
- 1.5.2.1.11. SUCI/SUCI.Move_Items_Command
- 1.5.2.1.12. SUCI/SUCI.Set_Use_Item_Command
- 1.5.2.1.13. SUCI/SUCI.Show_Inventory_Item_Info_Command
- 1.5.2.1.14. SUCI/SUCI.Show_Member_Inventory_Command
- 1.5.2.1.15. SUCI/SUCI.Show_Move_Item_Command
- 1.5.2.1.16. SUCI/SUCI.Sort_Crew_Inventory_Command
- 1.5.2.1.17. SUCI/SUCI.Toggle_All_Inventory_Command
- 1.5.2.1.18. SUCI/SUCI.Toggle_Inventory_Item
- 1.5.2.1.19. SUCI/SUCI.Toggle_Inventory_Items_Command
- 1.5.2.1.20. SUCI/SUCI.Update_Inventory_Command
- 1.5.2.1.21. SUCI/SUCI.Validate_Move_Amount_Command
- 1.5.2.2. SUCrew/SUCrew.Add_Commands
- 1.5.2.3. SUCrew/SUCrew.Update_Crew_Info
- 1.5.3. SUI2/SUI2.Add_Commands
- 1.6. Ships/SUpgrade
- 1.7. Ships/Ships.Crew_Container
- 1.8. Ships/Ships.Data_Array
- 1.9. Ships/Ships.Module_Type_2
- 1.10. Ships/Ships.Modules_Container
- 1.11. Ships/Ships.Proto_Crew_Container
- 1.12. Ships/Ships.Ship_Combat_Ai
- 1.13. Ships/Ships.Ship_Speed
- 1.14. Ships/Ships.Ship_Upgrade
- 1.15. Ships/Ships.Module_Data
- 1.16. Ships/Ships.Proto_Member_Data
- 1.17. Ships/Ships.Proto_Ship_Data
- 1.18. Ships/Ships.Ship_Bonus_Data
- 1.19. Ships/Ships.Ship_Record
- 1.20. Ships/Ships.Default_Combat_Ai
- 1.21. Ships/Ships.Default_Module
- 1.22. Ships/Ships.Default_Module_Type
- 1.23. Ships/Ships.Default_Ship_Speed
- 1.24. Ships/Ships.Default_Ship_Upgrade
- 1.25. Ships/Ships.Empty_Data_Array
- 1.26. Ships/Ships.Empty_Proto_Member
- 1.27. Ships/Ships.Empty_Proto_Ship
- 1.28. Ships/Ships.Empty_Ship
- 1.29. Ships/Ships.No_Ship_Bonus
- 1.30. Ships/Ships.Player_Ship
- 1.31. Ships/Ships.Generate_Ship_Name
- 1.32. Ships/Ships.Get_Cabin_Quality
Ships/Ships [ Packages ]
FUNCTION
Provides code for manipulate ships
SOURCE
package Ships is
Ships/Ships.Crew_Container [ Types ]
FUNCTION
Used to store crew data in ships
SOURCE
package Crew_Container is new Indefinite_Vectors (Index_Type => Positive, Element_Type => Member_Data);
Ships/Ships.Data_Array [ Types ]
FUNCTION
Used to store ship modules data
SOURCE
type Data_Array is array(1 .. 3) of Integer with Default_Component_Value => 0;
Ships/Ships.Module_Type_2 [ Types ]
FUNCTION
Types of ships modules
SOURCE
type Module_Type_2 is (WORKSHOP, ANY, MEDICAL_ROOM, TRAINING_ROOM, ENGINE, CABIN, COCKPIT, TURRET, GUN, CARGO_ROOM, HULL, ARMOR, BATTERING_RAM, HARPOON_GUN) with Default_Value => ANY;
Ships/Ships.Modules_Container [ Types ]
FUNCTION
Used to store modules data in ships
SOURCE
package Modules_Container is new Vectors (Index_Type => Positive, Element_Type => Module_Data);
Ships/Ships.Proto_Crew_Container [ Types ]
FUNCTION
Used to store crew info in ships prototypes
SOURCE
package Proto_Crew_Container is new Vectors (Index_Type => Positive, Element_Type => Proto_Member_Data);
Ships/Ships.Ship_Combat_Ai [ Types ]
FUNCTION
NPC ships combat AI types
SOURCE
type Ship_Combat_Ai is (NONE, BERSERKER, ATTACKER, COWARD, DISARMER) with Default_Value => NONE;
Ships/Ships.Ship_Speed [ Types ]
FUNCTION
Ship speed states
SOURCE
type Ship_Speed is (DOCKED, FULL_STOP, QUARTER_SPEED, HALF_SPEED, FULL_SPEED) with Default_Value => FULL_SPEED;
Ships/Ships.Ship_Upgrade [ Types ]
FUNCTION
Player ship types of module upgrades
SOURCE
type Ship_Upgrade is (NONE, DURABILITY, MAX_VALUE, VALUE) with Default_Value => NONE;
Ships/Ships.Module_Data [ Records ]
FUNCTION
Data structure for ship modules, medical room, cockpit, armor and cargo bays don't have any special fields
SOURCE
type Module_Data(M_Type: Module_Type_2 := Default_Module_Type) is record Name: Tiny_String.Bounded_String; Proto_Index: Positive; Weight: Natural := 0; Durability: Integer := 0; Max_Durability: Natural := 0; Owner: Natural_Container.Vector; Upgrade_Progress: Integer := 0; Upgrade_Action: Ship_Upgrade; case M_Type is when ENGINE => Fuel_Usage: Positive := 1; Power: Positive := 1; Disabled: Boolean; when CABIN => Cleanliness: Natural := 0; Quality: Natural := 0; when TURRET => Gun_Index: Natural := 0; when GUN => Damage: Positive := 1; Ammo_Index: Inventory_Container.Extended_Index; when HULL => Installed_Modules: Natural := 0; Max_Modules: Positive := 1; when WORKSHOP => Crafting_Index: Tiny_String.Bounded_String; Crafting_Time: Natural := 0; Crafting_Amount: Natural := 0; when MEDICAL_ROOM | COCKPIT | ARMOR | CARGO_ROOM => null; when TRAINING_ROOM => Trained_Skill: SkillsData_Container.Extended_Index; when BATTERING_RAM => Damage2: Positive := 1; Cooling_Down: Boolean; when HARPOON_GUN => Duration: Positive := 1; Harpoon_Index: Inventory_Container.Extended_Index; when ANY => Data: Data_Array; end case; end record;
PARAMETERS
M_Type - The type of the module Name - Name of module Proto_Index - Index of module prototype Weight - Weight of module Durability - 0 = destroyed Max_Durability - Base durability Owner - Crew member indexes for owners of module Upgrade_Progress - Progress of module upgrade Upgrade_Action - Type of module upgrade Fuel_Usage - Amount of fuel used for each move on map Power - Power of engine used for counting ship speed Disabled - Did engine is disabled or not Cleanliness - Cleanliness of selected cabin Quality - Quality of selected cabin Gun_Index - Index of installed gun Damage - Damage bonus for selected gun Ammo_Index - Cargo index of ammunition used by selected gun Installed_Modules - Amount of installed modules on ship Max_Modules - Amount of maximum installed modules for this hull Crafting_Index - Index of crafting recipe or item which is deconstructed or studies Crafting_Time - Time needed to finish crating order Crafting_Amount - How many times repeat crafting order Trained_Skill - Index of skill set to training Damage2 - Damage done by battering ram Cooling_Down - If true, battering ram can't attack Duration - Duration bonus for selected harpoon gun Harpoon_Index - Cargo index of ammunition used by selected harpoon gun Data - Various data for module (depends on module)
Ships/Ships.Proto_Member_Data [ Records ]
FUNCTION
Data structure for proto crew info
SOURCE
type Proto_Member_Data is record Proto_Index: Proto_Mobs_Amount_Range; Min_Amount: Positive := 1; Max_Amount: Natural := 0; end record;
PARAMETERS
Proto_Index - Index of proto mob which will be used as crew member Min_Amount - Mininum amount of that mob in crew Max_Amount - Maximum amount of that mob in crew. If 0 then MinAmount will be amount
Ships/Ships.Proto_Ship_Data [ Records ]
FUNCTION
Data structure for ship prototypes
SOURCE
type Proto_Ship_Data is record Name: Tiny_String.Bounded_String; Modules: Positive_Container.Vector; Accuracy: Ship_Bonus_Data; Combat_Ai: Ship_Combat_Ai; Evasion: Ship_Bonus_Data; Loot: Ship_Bonus_Data; Perception: Ship_Bonus_Data; Cargo: MobInventory_Container.Vector (Capacity => 32); Combat_Value: Positive := 1; Crew: Proto_Crew_Container.Vector; Description: Short_String.Bounded_String; Owner: Tiny_String.Bounded_String; Known_Recipes: TinyString_Formal_Container.Vector (Capacity => 16); end record;
PARAMETERS
Name - Prototype name Modules - List of ship modules Accuracy - Bonus to hit for ship Combat_Ai - Behaviour of ship in combat Evasion - Bonus to evade attacks Loot - Amount of loot(moneys) gained for destroying ship Perception - Bonus to spot player ship first Cargo - List of ship cargo Combat_Value - Combat value of ship (used to generate enemies) Crew - List of mobs used as ship crew Description - Description of ship Owner - Index of faction to which ship belong Known_Recipes - List of known recipes
Ships/Ships.Ship_Bonus_Data [ Records ]
FUNCTION
Data structure for proto ships bonuses, like accuracy, evasion, etc
SOURCE
type Ship_Bonus_Data is record Min_Value: Natural := 0; Max_Value: Natural := 0; end record;
PARAMETERS
Min_Value - Minimum value of bonus Max_Value - Maxiumum value of bonus
HISTORY
7.4 - Added
Ships/Ships.Ship_Record [ Records ]
FUNCTION
Data structure for ships
SOURCE
type Ship_Record is record Name: Tiny_String.Bounded_String; Sky_X: Map_X_Range; Sky_Y: Map_Y_Range; Speed: Ship_Speed; Modules: Modules_Container.Vector; Cargo: Inventory_Container.Vector (Capacity => 128); Crew: Crew_Container.Vector; Upgrade_Module: Modules_Container.Extended_Index; Destination_X: Natural range 0 .. Map_X_Range'Last; Destination_Y: Natural range 0 .. Map_Y_Range'Last; Repair_Module: Modules_Container.Extended_Index; Description: Short_String.Bounded_String; Home_Base: Extended_Base_Range; end record;
PARAMETERS
Name - Ship name Sky_X - X coordinate on sky map SKy_Y - Y coordinate on sky map Speed - Speed of ship Modules - List of ship modules Cargo - List of ship cargo Crew - List of ship crew Upgrade_Module - Number of module to upgrade Destination_X - Destination X coordinate Destination_Y - Destination Y coordinate Repair_Module - Number of module to repair as first Description - Description of ship Home_Base - Index of home base of ship
Ships/Ships.Default_Combat_Ai [ Constants ]
[ Top ] [ Ships ] [ Constants ]
FUNCTION
Default value for NPC's ships combat behavior
SOURCE
Default_Combat_Ai: constant Ship_Combat_Ai := NONE;
Ships/Ships.Default_Module [ Constants ]
[ Top ] [ Ships ] [ Constants ]
FUNCTION
Default empty module without type
SOURCE
Default_Module: constant Module_Data := (others => <>);
Ships/Ships.Default_Module_Type [ Constants ]
[ Top ] [ Ships ] [ Constants ]
FUNCTION
Default type of ships modules
SOURCE
Default_Module_Type: constant Module_Type_2 := ANY;
Ships/Ships.Default_Ship_Speed [ Constants ]
[ Top ] [ Ships ] [ Constants ]
FUNCTION
Default speed setting for ships
SOURCE
Default_Ship_Speed: constant Ship_Speed := FULL_SPEED;
Ships/Ships.Default_Ship_Upgrade [ Constants ]
[ Top ] [ Ships ] [ Constants ]
FUNCTION
Default ship upgrade (no upgrade)
SOURCE
Default_Ship_Upgrade: constant Ship_Upgrade := NONE;
Ships/Ships.Empty_Data_Array [ Constants ]
[ Top ] [ Ships ] [ Constants ]
FUNCTION
Empty modules data
SOURCE
Empty_Data_Array: constant Data_Array := (others => 0);
Ships/Ships.Empty_Proto_Member [ Constants ]
[ Top ] [ Ships ] [ Constants ]
FUNCTION
Empty record for proto crew info
SOURCE
Empty_Proto_Member: constant Proto_Member_Data := (others => <>);
Ships/Ships.Empty_Proto_Ship [ Constants ]
[ Top ] [ Ships ] [ Constants ]
FUNCTION
Empty record for ships prototypes
SOURCE
Empty_Proto_Ship: constant Proto_Ship_Data := (others => <>);
Ships/Ships.Empty_Ship [ Constants ]
[ Top ] [ Ships ] [ Constants ]
FUNCTION
Empty record for ship data
SOURCE
Empty_Ship: constant Ship_Record := (others => <>);
Ships/Ships.No_Ship_Bonus [ Constants ]
[ Top ] [ Ships ] [ Constants ]
FUNCTION
Default value for ship bonus data without any bonus
SOURCE
No_Ship_Bonus: constant Ship_Bonus_Data := (others => <>);
Ships/Ships.Player_Ship [ Variables ]
[ Top ] [ Ships ] [ Variables ]
FUNCTION
The player ship
SOURCE
Player_Ship: Ship_Record;
Ships/Ships.Generate_Ship_Name [ Subprograms ]
[ Top ] [ Ships ] [ Subprograms ]
FUNCTION
Generate random name for ship
SOURCE
function Generate_Ship_Name (Owner: Tiny_String.Bounded_String) return Tiny_String.Bounded_String with Pre => Tiny_String.Length(Source => Owner) > 0;
PARAMETERS
Owner - Index of faction to which ship belongs
RESULT
Random name for a ship
Ships/Ships.Get_Cabin_Quality [ Subprograms ]
[ Top ] [ Ships ] [ Subprograms ]
FUNCTION
Get description of quality of selected cabin in player ship
SOURCE
function Get_Cabin_Quality(Quality: Natural) return String with Post => Get_Cabin_Quality'Result'Length > 0;
PARAMETERS
Quality - Numeric value of cabin quality
RESULT
Description of cabin quality