TABLE OF CONTENTS


Missions/Missions [ Packages ]

[ Top ] [ Packages ]

FUNCTION

 Provides code for manipulate missions data

SOURCE

package Missions is

Missions/Missions.Mission_Container [ Types ]

[ Top ] [ Missions ] [ Types ]

FUNCTION

 Used to store data for missions

SOURCE

   package Mission_Container is new Vectors
     (Index_Type => Positive, Element_Type => Mission_Data);

Missions/Missions.Missions_Types [ Types ]

[ Top ] [ Missions ] [ Types ]

FUNCTION

 Types of missions

SOURCE

   type Missions_Types is (DELIVER, DESTROY, PATROL, EXPLORE, PASSENGER) with
      Default_Value => DELIVER;

Missions/Missions.Reward_Multiplier [ Types ]

[ Top ] [ Missions ] [ Types ]

FUNCTION

 Used for count reward for finished missions

SOURCE

   type Reward_Multiplier is digits 2 range 0.0 .. 2.0 with
      Default_Value => 1.0;

Missions/Missions.Mission_Data: [ Records ]

[ Top ] [ Missions ] [ Records ]

FUNCTION

 Data structure for missions

SOURCE

   type Mission_Data(M_Type: Missions_Types := DELIVER) is record
      Time: Positive := 1;
      Target_X: Natural range 0 .. Map_X_Range'Last;
      Target_Y: Natural range 0 .. Map_Y_Range'Last;
      Reward: Positive := 1;
      Start_Base: Bases_Range := 1;
      Finished: Boolean;
      Multiplier: Reward_Multiplier := 1.0;
      case M_Type is
         when DELIVER =>
            Item_Index: Positive;
         when PASSENGER =>
            Data: Positive := 1;
         when DESTROY =>
            Ship_Index: Natural := 0;
         when others =>
            Target: Natural := 0;
      end case;
   end record;

PARAMETERS

 Time        - Amount of minutes to finish the mission
 Target_X    - Skymap X-axis for the mission target
 Target_Y    - Skymap Y-axis for the mission target
 Reward      - Amount of money reward for the mission
 Start_Base  - Index of sky base where the mission starts
 Finished    - Did the mission is finished
 Multiplier  - Bonus to amount of money or reputation rewards for the
               mission
 Item_Index  - Index of proto item to deliver to base
 Data        - Minimum quality of cabin needed by passenger (in bases)
               or passenger index (in player ship)
 Ship_Index  - Index of proto ship which must be destroyed
 Target      - Target for mission (ship, item)

Missions/Missions.Default_Mission_Type [ Constants ]

[ Top ] [ Missions ] [ Constants ]

FUNCTION

 Default type of missions

SOURCE

   Default_Mission_Type: constant Missions_Types := DELIVER;

Missions/Missions.Default_Multiplier [ Constants ]

[ Top ] [ Missions ] [ Constants ]

FUNCTION

 Default multiplier for missions reward

SOURCE

   Default_Multiplier: constant Reward_Multiplier := 1.0;

Missions/Missions.Empty_Mission [ Constants ]

[ Top ] [ Missions ] [ Constants ]

FUNCTION

 Default, empty mission data

SOURCE

   Empty_Mission: constant Mission_Data :=
     (M_Type => Default_Mission_Type, others => <>);

Missions/Missions.Missions_Accepting_Error [ Exceptions ]

[ Top ] [ Missions ] [ Exceptions ]

FUNCTION

 Raised when mission can't be accepted

SOURCE

   Missions_Accepting_Error: exception;

Missions/Missions.Accept_Mission [ Subprograms ]

[ Top ] [ Missions ] [ Subprograms ]

FUNCTION

 Accept selected mission from base

SOURCE

   procedure Accept_Mission(Mission_Index: Positive);

PARAMETERS

 Mission_Index - Base list of available missions index of mission to
                 accept

Missions/Missions.Auto_Finish_Missions [ Subprograms ]

[ Top ] [ Missions ] [ Subprograms ]

FUNCTION

 Finish all possible missions.

SOURCE

   function Auto_Finish_Missions return String;

RESULT

 Empty string if everything is ok, otherwise message with information
 what goes wrong

Missions/Missions.Delete_Mission [ Subprograms ]

[ Top ] [ Missions ] [ Subprograms ]

FUNCTION

 Delete selected mission

SOURCE

   procedure Delete_Mission(Mission_Index: Positive; Failed: Boolean := True);

PARAMETERS

 Mission_Index - Player ship list of accepted missions index of mission
                 to delete
 Failed        - If true, it is failed mission. Default is true.

Missions/Missions.Get_Mission_Type [ Subprograms ]

[ Top ] [ Missions ] [ Subprograms ]

FUNCTION

 Get the name of the type of the selected mission

SOURCE

   function Get_Mission_Type(M_Type: Missions_Types) return String with
      Post => Get_Mission_Type'Result'Length > 0;

PARAMETERS

 M_Type - The type of mission which name will be get

RESULT

 Name (as words) of the selected mission's type