TABLE OF CONTENTS


Crew/Crew [ Packages ]

[ Top ] [ Packages ]

FUNCTION

 Provide code for manipulate player ship crew

SOURCE

package Crew is

Crew/Crew.Crew_Orders [ Types ]

[ Top ] [ Crew ] [ Types ]

FUNCTION

 Available orders for ships crews

SOURCE

   type Crew_Orders is
     (PILOT, ENGINEER, GUNNER, REPAIR, CRAFT, UPGRADING, TALK, HEAL, CLEAN,
      REST, DEFEND, BOARDING, TRAIN) with
      Default_Value => REST;

Crew/Crew.Equipment_Array [ Types ]

[ Top ] [ Crew ] [ Types ]

FUNCTION

 Data structure for currently equipped items for crew members.

SOURCE

   type Equipment_Array is array(Equipment_Locations) of Natural with
      Default_Component_Value => 0;

Crew/Crew.Equipment_Locations [ Types ]

[ Top ] [ Crew ] [ Types ]

FUNCTION

 The list of equipment locations

SOURCE

   type Equipment_Locations is
     (WEAPON, SHIELD, HELMET, TORSO, ARMS, LEGS, TOOL) with
      Default_Value => WEAPON;

Crew/Crew.Mob_Attributes [ Types ]

[ Top ] [ Crew ] [ Types ]

FUNCTION

 Array used to store attributes of the mobs (crew, other mobs, recruits,
 etc).

SOURCE

   type Mob_Attributes is
     array(Attributes_Amount_Range range <>) of Mob_Attribute_Record;

HISTORY

 6.5 - Added
 6.6 - Changed from array of array to array of record

Crew/Crew.Skills_Container [ Types ]

[ Top ] [ Crew ] [ Types ]

FUNCTION

 Used to store skills data

SOURCE

   package Skills_Container is new Formal_Vectors
     (Index_Type => Skills_Amount_Range, Element_Type => Skill_Info);

Crew/Crew.Member_Data [ Records ]

[ Top ] [ Crew ] [ Records ]

FUNCTION

 Data structure for ship crew member

SOURCE

   type Member_Data is new Mob_Record with record
      Name: Tiny_String.Bounded_String;
      Gender: Character;
      Health: Skill_Range;
      Tired: Natural range 0 .. 150 := 0;
      Hunger: Skill_Range;
      Thirst: Skill_Range;
      Order: Crew_Orders;
      Previous_Order: Crew_Orders;
      Order_Time: Integer := 15;
      Orders: Natural_Array(1 .. 12);
      Inventory: Inventory_Container.Vector (Capacity => 32);
      Equipment: Equipment_Array;
      Payment: Attributes_Array;
      Contract_Length: Integer := 0;
      Morale: Attributes_Array;
      Loyalty: Skill_Range;
      Home_Base: Bases_Range;
      Faction: Tiny_String.Bounded_String;
   end record;

PARAMETERS

 Name            - Name of member
 Gender          - Gender of member
 Health          - Level of health of member
 Tired           - Tiredness of member
 Skills          - Names indexes, levels and experience in skills of
                   member
 Hunger          - Hunger level of member
 Thirst          - Thirst level of member
 Order           - Current order for member
 Previous_Order  - Previous order for member
 Order_Time      - Minutes to next check for order result
 Orders          - Priority of orders of member
 Attributes      - Levels and experience in attributes of member
 Inventory       - Owned items by member
 Equipment       - Items indexes from inventory used by character:
                   1 - weapon, 2 - shield, 3 - helmet, 4 - torso,
                   5 - arms, 6 - legs, 7 - tool
 Payment         - How much money member takes as payment.
                   1 - daily payment, 2 - percent from each trade
 Contract_Length - How many days crew member will be in crew. -1 mean
                   pernament contract
 Morale          - Morale of crew member, between 0 and 100, 1 - level,
                   2 - points to next level
 Loyality        - Loyalty of crew member, between 0 and 100
 Home_Base       - Index of base from which crew member is
 Faction         - Index of faction to which crew member belongs

Crew/Crew.Mob_Attribute_Record [ Records ]

[ Top ] [ Crew ] [ Records ]

FUNCTION

 Used to store the attributes of mobs

SOURCE

   type Mob_Attribute_Record is record
      Level: Positive range 1 .. 50 := 1;
      Experience: Natural := 0;
   end record;

PARAMETERS

 Level      - The level of the attribute
 Experience - The experience amount in the attribute

HISTORY

 6.6 - Added

Crew/Crew.Mob_Record [ Records ]

[ Top ] [ Crew ] [ Records ]

FUNCTION

 Abstract record to store all common settings for mobs (crew, other mobs,
 recruits, etc)

SOURCE

   type Mob_Record
     (Amount_Of_Attributes: Attributes_Amount_Range;
      Amount_Of_Skills: Skills_Amount_Range)
   is abstract tagged record
      Attributes: Mob_Attributes(1 .. Amount_Of_Attributes);
      Skills: Skills_Container.Vector (Capacity => Amount_Of_Skills);
   end record;

PARAMETERS

 Attributes           - Levels and experience in attributes of the mob
 Amount_Of_Attributes - The amount of attributes declared in the game
 Amount_Of_Skills     - The amount of skills declared in the game

HISTORY

 6.5 - Added

Crew/Crew.Skill_Info [ Records ]

[ Top ] [ Crew ] [ Records ]

FUNCTION

 Data structure for skills

SOURCE

   type Skill_Info is record
      Index: Skills_Amount_Range := 1;
      Level: Skill_Range := 0;
      Experience: Natural := 0;
   end record;

PARAMETERS

 Index      - The index of the skill in the skills list
 Level      - The current level of the skill
 Experience - The amount of experience in the skill

HISTORY

 6.6 - Added

Crew/Crew.Default_Crew_Order [ Constants ]

[ Top ] [ Crew ] [ Constants ]

FUNCTION

 The default order for the crew members

SOURCE

   Default_Crew_Order: constant Crew_Orders := REST;

Crew/Crew.Default_Equipment_Location [ Constants ]

[ Top ] [ Crew ] [ Constants ]

FUNCTION

 The default location for an equipment

SOURCE

   Default_Equipment_Location: constant Equipment_Locations := WEAPON;

Crew/Crew.Empty_Attributes [ Constants ]

[ Top ] [ Crew ] [ Constants ]

FUNCTION

 Empty values for mob attributes

SOURCE

   Empty_Attributes: constant Mob_Attribute_Record :=
     Mob_Attribute_Record'(others => <>);

HISTORY

 6.6 - Added

Crew/Crew.Empty_Equipment_Array [ Constants ]

[ Top ] [ Crew ] [ Constants ]

FUNCTION

 The default empty equipment array

SOURCE

   Empty_Equipment_Array: constant Equipment_Array :=
     Equipment_Array'(others => <>);

Crew/Crew.Empty_Skill_Info [ Constants ]

[ Top ] [ Crew ] [ Constants ]

FUNCTION

 Default empty skill

SOURCE

   Empty_Skill_Info: constant Skill_Info := Skill_Info'(others => <>);

HISTORY

 6.6 - Added

Crew/Crew.Crew_No_Space_Error [ Exceptions ]

[ Top ] [ Crew ] [ Exceptions ]

FUNCTION

 Raised when no space for new item in crew member inventory

SOURCE

   Crew_No_Space_Error: exception;

Crew/Crew.Crew_Order_Error [ Exceptions ]

[ Top ] [ Crew ] [ Exceptions ]

FUNCTION

 Raised when new order can't be set for selected crew member

SOURCE

   Crew_Order_Error: exception;

Crew/Crew.Gain_Exp [ Subprograms ]

[ Top ] [ Crew ] [ Subprograms ]

FUNCTION

 Gain experience in selected skill.

SOURCE

   procedure Gain_Exp
     (Amount: Natural; Skill_Number: Skills_Amount_Range;
      Crew_Index: Positive) with
      Pre => Skill_Number <= Skills_Amount;

PARAMETERS

 Amoun t      - Amount of gained experience
 Skill_Number - Index of skill in skills list
 Crew_Index   - Crew index of member

Crew/Crew.Generate_Member_Name [ Subprograms ]

[ Top ] [ Crew ] [ Subprograms ]

FUNCTION

 Generate random name for crew member

SOURCE

   function Generate_Member_Name
     (Gender: Character; Faction_Index: Tiny_String.Bounded_String)
      return Tiny_String.Bounded_String with
      Pre => Gender in 'M' | 'F' and
      Tiny_String.Length(Source => Faction_Index) > 0;

PARAMETERS

 Gender        - Gender of crew member which name will be generated
 Faction_Index - Faction to which crew member belongs

RESULT

 Random name for crew member

Crew/Crew.Get_Attribute_Level_Name [ Subprograms ]

[ Top ] [ Crew ] [ Subprograms ]

FUNCTION

 Get member attribute level name

SOURCE

   function Get_Attribute_Level_Name
     (Attribute_Level: Positive) return String with
      Pre => Attribute_Level <= 50;

PARAMETERS

 Attribute_Level - Numeric value of attribute level

RESULT

 Name (as words) of attribute level

Crew/Crew.Get_Skill_Level_Name [ Subprograms ]

[ Top ] [ Crew ] [ Subprograms ]

FUNCTION

 Get member skill level name

SOURCE

   function Get_Skill_Level_Name(Skill_Level: Skill_Range) return String;

PARAMETERS

 Skill_Level - Numeric value of skill level

RESULT

 Name (as words) of skill level

Crew/Crew.Wait_For_Rest [ Subprograms ]

[ Top ] [ Crew ] [ Subprograms ]

FUNCTION

 Wait until whole crew is rested

SOURCE

   procedure Wait_For_Rest;