TABLE OF CONTENTS
- 1. Stories/Stories
- 1.1. Stories/Stories.Start_Condition_Type
- 1.2. Stories/Stories.Step_Condition_Type
- 1.3. Stories/Stories.StepData_Container
- 1.4. Stories/Stories.Steps_Container
- 1.5. Stories/Stories.StepTexts_Container
- 1.6. Stories/Stories.Current_Story_Data
- 1.7. Stories/Stories.Finished_Story_Data
- 1.8. Stories/Stories.Step_Data
- 1.9. Stories/Stories.Step_Finish_Data
- 1.10. Stories/Stories.Step_Text_Data
- 1.11. Stories/Stories.Story_Data
- 1.12. Stories/Stories.Default_Start_Condition
- 1.13. Stories/Stories.Default_Step_Condition
- 1.14. Stories/Stories.Empty_Current_Story
- 1.15. Stories/Stories.Empty_Finish_Condition
- 1.16. Stories/Stories.Empty_Finished_Story
- 1.17. Stories/Stories.Empty_Step
- 1.18. Stories/Stories.Empty_Step_Text
- 1.19. Stories/Stories.Empty_Story
- 1.20. Stories/Set_Current_Story
- 1.21. Stories/Stories.Clear_Current_Story
- 1.22. Stories/Stories.Get_Current_Story_Text
- 1.23. Stories/Stories.Get_Step_Data
- 1.24. Stories/Stories.Get_Story_Location
Stories/Stories [ Packages ]
FUNCTION
Provide code for manipulate the game stories
SOURCE
package Stories is
Stories/Stories.Start_Condition_Type [ Types ]
FUNCTION
Types of conditions to start stories
SOURCE
type Start_Condition_Type is (DROPITEM) with Default_Value => DROPITEM;
Stories/Stories.Step_Condition_Type [ Types ]
FUNCTION
Types of conditions to finish story step
SOURCE
type Step_Condition_Type is (ASKINBASE, DESTROYSHIP, EXPLORE, ANY, LOOT) with Default_Value => ANY;
Stories/Stories.StepData_Container [ Types ]
FUNCTION
Used to store stories steps data
SOURCE
package StepData_Container is new Vectors (Index_Type => Positive, Element_Type => Step_Finish_Data);
Stories/Stories.Steps_Container [ Types ]
FUNCTION
Used to store stories steps
SOURCE
package Steps_Container is new Vectors (Index_Type => Positive, Element_Type => Step_Data);
Stories/Stories.StepTexts_Container [ Types ]
FUNCTION
Used to store stories steps text data
SOURCE
package StepTexts_Container is new Vectors (Index_Type => Positive, Element_Type => Step_Text_Data);
Stories/Stories.Current_Story_Data [ Records ]
[ Top ] [ Stories ] [ Records ]
FUNCTION
Data structure for current active story
SOURCE
type Current_Story_Data is record Index: Unbounded_String; Step: Positive := 1; Current_Step: Integer range -3 .. Integer'Last; Max_Steps: Positive := 1; Show_Text: Boolean; Data: Unbounded_String; Finished_Step: Step_Condition_Type; end record;
PARAMETERS
Index - Index of story or empty string if no story currently active Step - Number of current step in story Current_Step - Index of current step, 0 for starting step, -1 for finish step Max_Steps - Number of maxium amounts of steps in story Show_Text - If true, show text of current step to player Data - Various data for current step, depends on step Finished_Step - Finish condition for previous step
Stories/Stories.Finished_Story_Data [ Records ]
[ Top ] [ Stories ] [ Records ]
FUNCTION
Data structure for finished story/steps
SOURCE
type Finished_Story_Data is record Index: Unbounded_String; Steps_Amount: Positive := 1; Steps_Texts: UnboundedString_Container.Vector; end record;
PARAMETERS
Index - Index of story Steps_Amount - Amount of steps in this story Steps_Texts - Texts of steps done in this story. If less than Steps_Amount then it is current story.
Stories/Stories.Step_Data [ Records ]
[ Top ] [ Stories ] [ Records ]
FUNCTION
Data structure for stories steps
SOURCE
type Step_Data is record Index: Unbounded_String; Finish_Condition: Step_Condition_Type; Finish_Data: StepData_Container.Vector; Texts: StepTexts_Container.Vector; Fail_Text: Unbounded_String; end record;
PARAMETERS
Index - Index of step Finish_Condition - Condition which must be met to finish selected step and process to next Finish_Data - Data for finish condition Texts - Texts which will be show to player when step starts, depends on finish condition of previous step. Fail_Text - Text which will be show to player when step fails to progress.
Stories/Stories.Step_Finish_Data [ Records ]
[ Top ] [ Stories ] [ Records ]
FUNCTION
Structure for finish condition data
SOURCE
type Step_Finish_Data is record Name: Unbounded_String; Value: Unbounded_String; end record;
PARAMETERS
Name - Name of data Value - Value of data
Stories/Stories.Step_Text_Data [ Records ]
[ Top ] [ Stories ] [ Records ]
FUNCTION
Data structure for stories steps texts
SOURCE
type Step_Text_Data is record Condition: Step_Condition_Type; Text: Unbounded_String; end record;
PARAMETERS
Condition - Finish condition of previous step Text - Text which will be show to player when step starts.
Stories/Stories.Story_Data [ Records ]
[ Top ] [ Stories ] [ Records ]
FUNCTION
Data structure for stories
SOURCE
type Story_Data is record Start_Condition: Start_Condition_Type; Start_Data: UnboundedString_Container.Vector; Min_Steps: Positive := 1; Max_Steps: Positive := 1; Starting_Step: Step_Data; Steps: Steps_Container.Vector; Final_Step: Step_Data; End_Text: Unbounded_String; Name: Unbounded_String; Forbidden_Factions: UnboundedString_Container.Vector; end record;
PARAMETERS
Start_Condition - Condition which must be met to start story Start_Data - Data for starting condition Min_Steps - Minimal amount of steps in story Max_Steps - Maxium amount of steps in story Starting_Step - Starting step of story Steps - Contains all steps in story Final_Step - Final step of story End_Text - Text which will be show to player when story ends. Name - Name of story, show in game Forbidden_Factions - If player is in one of this factions, he/she can't start this story.
Stories/Stories.Default_Start_Condition [ Constants ]
[ Top ] [ Stories ] [ Constants ]
FUNCTION
The default type of condition to start stories
SOURCE
Default_Start_Condition: constant Start_Condition_Type := DROPITEM;
Stories/Stories.Default_Step_Condition [ Constants ]
[ Top ] [ Stories ] [ Constants ]
FUNCTION
The default type of the condition to finish the story
SOURCE
Default_Step_Condition: constant Step_Condition_Type := ANY;
Stories/Stories.Empty_Current_Story [ Constants ]
[ Top ] [ Stories ] [ Constants ]
FUNCTION
Empty current story data
SOURCE
Empty_Current_Story: constant Current_Story_Data := (others => <>);
Stories/Stories.Empty_Finish_Condition [ Constants ]
[ Top ] [ Stories ] [ Constants ]
FUNCTION
Empty finish condition for a story's step
SOURCE
Empty_Finish_Condition: constant Step_Finish_Data := (others => <>);
Stories/Stories.Empty_Finished_Story [ Constants ]
[ Top ] [ Stories ] [ Constants ]
FUNCTION
Empty finished story data
SOURCE
Empty_Finished_Story: constant Finished_Story_Data := (others => <>);
Stories/Stories.Empty_Step [ Constants ]
[ Top ] [ Stories ] [ Constants ]
FUNCTION
Empty story step information
SOURCE
Empty_Step: constant Step_Data := (others => <>);
Stories/Stories.Empty_Step_Text [ Constants ]
[ Top ] [ Stories ] [ Constants ]
FUNCTION
Empty data for stories steps texts
SOURCE
Empty_Step_Text: constant Step_Text_Data := (others => <>);
Stories/Stories.Empty_Story [ Constants ]
[ Top ] [ Stories ] [ Constants ]
FUNCTION
Empty story inforation
SOURCE
Empty_Story: constant Story_Data := (others => <>);
Stories/Stories.Clear_Current_Story [ Subprograms ]
[ Top ] [ Stories ] [ Subprograms ]
FUNCTION
Resets current story
SOURCE
procedure Clear_Current_Story with Import => True, Convention => C, External_Name => "clearAdaCurrentStory";
Stories/Stories.Get_Current_Story_Text [ Subprograms ]
[ Top ] [ Stories ] [ Subprograms ]
FUNCTION
Get text of current step in story
SOURCE
function Get_Current_Story_Text return Unbounded_String;
RESULT
Text of current step in current story
Stories/Stories.Get_Step_Data [ Subprograms ]
[ Top ] [ Stories ] [ Subprograms ]
FUNCTION
Get step finish data with selected name
SOURCE
function Get_Step_Data (Finish_Data: StepData_Container.Vector; Name: String) return Unbounded_String with Pre => Name'Length > 0;
PARAMETERS
Finish_Data - List of step data Name - Name of data to get
RESULT
Selected data from FinishData parameter
Stories/Stories.Get_Story_Location [ Subprograms ]
[ Top ] [ Stories ] [ Subprograms ]
FUNCTION
Get target location of current story
SOURCE
procedure Get_Story_Location (Story_X: out Map_X_Range; Story_Y: out Map_Y_Range) with Import => True, Convention => C, External_Name => "getAdaStoryLocation";
PARAMETERS
Story_X - X coordination of current story target Story_Y - Y coordination of current story target
RESULT
Parameters X and Y