#include <global_actors.h>
Collaboration diagram for hoa_global::GlobalCharacterGrowth:

Public Member Functions | |
| void | AcknowledgeGrowth () |
| Processes any growth that has occured by modifier the character's stats If an experience level is gained, this function will open up the script file that contains the character's definition and get new growth stats for the next experience level. | |
| GlobalCharacterGrowth (GlobalCharacter *owner) | |
| ~GlobalCharacterGrowth () | |
Class member access functions | |
| float | GetEvadeGrowth () const |
| uint32 | GetFortitudeGrowth () const |
| uint32 | GetHitPointsGrowth () const |
| uint32 | GetProtectionGrowth () const |
| uint32 | GetSkillPointsGrowth () const |
| std::list< GlobalSkill * > * | GetSkillsLearned () |
| uint32 | GetStrengthGrowth () const |
| uint32 | GetVigorGrowth () const |
| bool | IsExperienceLevelGained () const |
| bool | IsGrowthDetected () const |
Private Member Functions | |
| void | _AddSkill (uint32 skill_id) |
| Adds a new skill for the character to learn at the next experience level gained. | |
| void | _CheckForGrowth () |
| Examines if any growth has occured as a result of the character's experience points This is called by GlobalCharacter whenever the character's experience points change. If any growth is detected, the _growth_detected member is set and the various growth members of the class are incremented by the growth amount. | |
| void | _ConstructPeriodicGrowth () |
| Constructs the numerous periodic growth deques when growth stats for a new level are loaded in After new growth stats have been loaded in for a level, this function takes those values, breaks them apart, and spreads out their growth periodically. 50% of the growth is saved for when the character reaches a new level, while the other 50% are rewarded as the character's experience grows to values in between the previous experience level marker and the next. | |
| void | _DetermineNextLevelExperience () |
| An algorithm that computes how many experience points are needed to reach the next level This algorithm is a function of the current experience level and the experience points that were required to reach the current level. This function modifies the _experience_for_next_level and _experience_for_last_level members. | |
Private Attributes | |
| GlobalCharacter * | _character_owner |
| A pointer to the character which this growth belongs to. | |
| uint32 | _experience_for_last_level |
| The experience points that were required to reach the previous experience level. | |
| uint32 | _experience_for_next_level |
| The experience points required to reach the next experience level. | |
| bool | _experience_level_gained |
| Set to true when it is detected that a new experience level has been reached. | |
| bool | _growth_detected |
| Set to true when it is detected that sufficient experience for at least one stat to grow has been reached. | |
| std::list< GlobalSkill * > | _skills_learned |
| Contains any and all skills that are to be learned when the next experience level is reached These are automatically added to the character by this class after the new experience level growth has been acknowledged. | |
| uint32 | _agility_growth |
| float | _evade_growth |
| uint32 | _fortitude_growth |
| uint32 | _hit_points_growth |
| The amount of growth that should be added to each of the character's stats These members are incremented by the _UpdateGrowth() function, which detects when a character has enough experience points to meet a growth requirement. They are all cleared to zero after a call to AcknowledgeGrowth(). | |
| uint32 | _protection_growth |
| uint32 | _skill_points_growth |
| uint32 | _strength_growth |
| uint32 | _vigor_growth |
| std::deque< std::pair< uint32, uint32 > > | _agility_periodic_growth |
| std::deque< std::pair< uint32, float > > | _evade_periodic_growth |
| std::deque< std::pair< uint32, uint32 > > | _fortitude_periodic_growth |
| std::deque< std::pair< uint32, uint32 > > | _hit_points_periodic_growth |
| The periodic growth of the stats as a function of experience points The purpose of these containers is to support the gradual growth of characters. The first member in each pair is the experience points required for that growth to occur, while the second member is the value of the growth. Each entry in the deques are ordered from lowest (front) to highest (back) XP requirements. The final entry in each deque should be the growth for when the next experience level is reached. Note that these structures do not need to contain any entries (ie, a stat does not need to grow on every level). | |
| std::deque< std::pair< uint32, uint32 > > | _protection_periodic_growth |
| std::deque< std::pair< uint32, uint32 > > | _skill_points_periodic_growth |
| std::deque< std::pair< uint32, uint32 > > | _strength_periodic_growth |
| std::deque< std::pair< uint32, uint32 > > | _vigor_periodic_growth |
Friends | |
| void | BindEngineToLua () |
| Contains the binding code which makes the C++ engine available to Lua This method should only be called once. It must be called after the ScriptEngine is initialized, otherwise the application will crash. | |
| class | GlobalCharacter |
****************************************************************************
This class is essentially an extension of the GlobalCharacter class that manages and updates the character's growth. The primary reason that this class exists is to provide an interface for external code to determine when character growth occurs, inform the player of the growth, and acknoleged the growth.
The recommended proceedure for processing character growth is as follows:
Definition at line 647 of file global_actors.h.
| hoa_global::GlobalCharacterGrowth::GlobalCharacterGrowth | ( | GlobalCharacter * | owner | ) | [inline] |
Definition at line 652 of file global_actors.h.
| hoa_global::GlobalCharacterGrowth::~GlobalCharacterGrowth | ( | ) |
| void hoa_global::GlobalCharacterGrowth::_AddSkill | ( | uint32 | skill_id | ) | [private] |
Adds a new skill for the character to learn at the next experience level gained.
| skill_id | The ID number of the skill to add |
Definition at line 318 of file global_actors.cpp.
References _skills_learned, hoa_global::GlobalSkill::GetID(), and hoa_global::GLOBAL_DEBUG.
Here is the call graph for this function:

| void hoa_global::GlobalCharacterGrowth::_CheckForGrowth | ( | ) | [private] |
Examines if any growth has occured as a result of the character's experience points This is called by GlobalCharacter whenever the character's experience points change. If any growth is detected, the _growth_detected member is set and the various growth members of the class are incremented by the growth amount.
Definition at line 348 of file global_actors.cpp.
References _agility_growth, _agility_periodic_growth, _character_owner, _evade_growth, _evade_periodic_growth, _experience_for_next_level, _experience_level_gained, _fortitude_growth, _fortitude_periodic_growth, _growth_detected, _hit_points_growth, _hit_points_periodic_growth, _protection_growth, _protection_periodic_growth, _skill_points_growth, _skill_points_periodic_growth, _skills_learned, _strength_growth, _strength_periodic_growth, _vigor_growth, _vigor_periodic_growth, hoa_global::GlobalActor::GetExperiencePoints(), hoa_global::GlobalActor::GetSkill(), and hoa_global::GLOBAL_DEBUG.
Referenced by AcknowledgeGrowth(), and hoa_global::GlobalCharacter::AddExperiencePoints().
Here is the call graph for this function:

| void hoa_global::GlobalCharacterGrowth::_ConstructPeriodicGrowth | ( | ) | [private] |
Constructs the numerous periodic growth deques when growth stats for a new level are loaded in After new growth stats have been loaded in for a level, this function takes those values, breaks them apart, and spreads out their growth periodically. 50% of the growth is saved for when the character reaches a new level, while the other 50% are rewarded as the character's experience grows to values in between the previous experience level marker and the next.
Definition at line 552 of file global_actors.cpp.
References _agility_growth, _agility_periodic_growth, _evade_growth, _evade_periodic_growth, _experience_for_next_level, _fortitude_growth, _fortitude_periodic_growth, _hit_points_growth, _hit_points_periodic_growth, _protection_growth, _protection_periodic_growth, _skill_points_growth, _skill_points_periodic_growth, _strength_growth, _strength_periodic_growth, _vigor_growth, and _vigor_periodic_growth.
Referenced by AcknowledgeGrowth(), and hoa_global::GlobalCharacter::GlobalCharacter().
| void hoa_global::GlobalCharacterGrowth::_DetermineNextLevelExperience | ( | ) | [private] |
An algorithm that computes how many experience points are needed to reach the next level This algorithm is a function of the current experience level and the experience points that were required to reach the current level. This function modifies the _experience_for_next_level and _experience_for_last_level members.
Definition at line 577 of file global_actors.cpp.
References _experience_for_last_level, and _experience_for_next_level.
Referenced by AcknowledgeGrowth(), and hoa_global::GlobalCharacter::GlobalCharacter().
| void hoa_global::GlobalCharacterGrowth::AcknowledgeGrowth | ( | ) |
Processes any growth that has occured by modifier the character's stats If an experience level is gained, this function will open up the script file that contains the character's definition and get new growth stats for the next experience level.
Definition at line 270 of file global_actors.cpp.
References _agility_growth, _character_owner, _CheckForGrowth(), _ConstructPeriodicGrowth(), _DetermineNextLevelExperience(), _evade_growth, hoa_global::GlobalActor::_experience_level, _experience_level_gained, _fortitude_growth, _growth_detected, _hit_points_growth, _protection_growth, _skill_points_growth, _strength_growth, _vigor_growth, hoa_script::ReadScriptDescriptor::GetLuaState(), hoa_global::GLOBAL_DEBUG, hoa_script::GameScript::HandleCastError(), hoa_script::GameScript::HandleLuaError(), hoa_script::ReadScriptDescriptor::OpenFile(), and hoa_script::ScriptManager.
Here is the call graph for this function:

| float hoa_global::GlobalCharacterGrowth::GetEvadeGrowth | ( | ) | const [inline] |
| uint32 hoa_global::GlobalCharacterGrowth::GetFortitudeGrowth | ( | ) | const [inline] |
| uint32 hoa_global::GlobalCharacterGrowth::GetHitPointsGrowth | ( | ) | const [inline] |
| uint32 hoa_global::GlobalCharacterGrowth::GetProtectionGrowth | ( | ) | const [inline] |
| uint32 hoa_global::GlobalCharacterGrowth::GetSkillPointsGrowth | ( | ) | const [inline] |
| std::list<GlobalSkill*>* hoa_global::GlobalCharacterGrowth::GetSkillsLearned | ( | ) | [inline] |
| uint32 hoa_global::GlobalCharacterGrowth::GetStrengthGrowth | ( | ) | const [inline] |
| uint32 hoa_global::GlobalCharacterGrowth::GetVigorGrowth | ( | ) | const [inline] |
| bool hoa_global::GlobalCharacterGrowth::IsExperienceLevelGained | ( | ) | const [inline] |
| bool hoa_global::GlobalCharacterGrowth::IsGrowthDetected | ( | ) | const [inline] |
Definition at line 668 of file global_actors.h.
References _growth_detected.
Referenced by hoa_global::GlobalCharacter::AddExperiencePoints().
| void BindEngineToLua | ( | ) | [friend] |
friend class GlobalCharacter [friend] |
Definition at line 648 of file global_actors.h.
Definition at line 727 of file global_actors.h.
Referenced by _CheckForGrowth(), _ConstructPeriodicGrowth(), and AcknowledgeGrowth().
std::deque<std::pair<uint32, uint32> > hoa_global::GlobalCharacterGrowth::_agility_periodic_growth [private] |
Definition at line 750 of file global_actors.h.
Referenced by _CheckForGrowth(), and _ConstructPeriodicGrowth().
A pointer to the character which this growth belongs to.
Definition at line 698 of file global_actors.h.
Referenced by _CheckForGrowth(), and AcknowledgeGrowth().
float hoa_global::GlobalCharacterGrowth::_evade_growth [private] |
Definition at line 728 of file global_actors.h.
Referenced by _CheckForGrowth(), _ConstructPeriodicGrowth(), AcknowledgeGrowth(), and GetEvadeGrowth().
std::deque<std::pair<uint32, float> > hoa_global::GlobalCharacterGrowth::_evade_periodic_growth [private] |
Definition at line 751 of file global_actors.h.
Referenced by _CheckForGrowth(), and _ConstructPeriodicGrowth().
The experience points that were required to reach the previous experience level.
Definition at line 710 of file global_actors.h.
Referenced by _DetermineNextLevelExperience(), and hoa_global::GlobalCharacter::GlobalCharacter().
The experience points required to reach the next experience level.
Definition at line 707 of file global_actors.h.
Referenced by _CheckForGrowth(), _ConstructPeriodicGrowth(), _DetermineNextLevelExperience(), hoa_global::GlobalCharacter::GetExperienceForNextLevel(), and hoa_global::GlobalCharacter::GlobalCharacter().
bool hoa_global::GlobalCharacterGrowth::_experience_level_gained [private] |
Set to true when it is detected that a new experience level has been reached.
Definition at line 701 of file global_actors.h.
Referenced by _CheckForGrowth(), AcknowledgeGrowth(), and IsExperienceLevelGained().
Definition at line 725 of file global_actors.h.
Referenced by _CheckForGrowth(), _ConstructPeriodicGrowth(), AcknowledgeGrowth(), and GetFortitudeGrowth().
std::deque<std::pair<uint32, uint32> > hoa_global::GlobalCharacterGrowth::_fortitude_periodic_growth [private] |
Definition at line 748 of file global_actors.h.
Referenced by _CheckForGrowth(), and _ConstructPeriodicGrowth().
bool hoa_global::GlobalCharacterGrowth::_growth_detected [private] |
Set to true when it is detected that sufficient experience for at least one stat to grow has been reached.
Definition at line 704 of file global_actors.h.
Referenced by _CheckForGrowth(), AcknowledgeGrowth(), and IsGrowthDetected().
The amount of growth that should be added to each of the character's stats These members are incremented by the _UpdateGrowth() function, which detects when a character has enough experience points to meet a growth requirement. They are all cleared to zero after a call to AcknowledgeGrowth().
Definition at line 721 of file global_actors.h.
Referenced by _CheckForGrowth(), _ConstructPeriodicGrowth(), AcknowledgeGrowth(), and GetHitPointsGrowth().
std::deque<std::pair<uint32, uint32> > hoa_global::GlobalCharacterGrowth::_hit_points_periodic_growth [private] |
The periodic growth of the stats as a function of experience points The purpose of these containers is to support the gradual growth of characters. The first member in each pair is the experience points required for that growth to occur, while the second member is the value of the growth. Each entry in the deques are ordered from lowest (front) to highest (back) XP requirements. The final entry in each deque should be the growth for when the next experience level is reached. Note that these structures do not need to contain any entries (ie, a stat does not need to grow on every level).
These containers are emptied when a new experience level occurs, and are also re-constructed after the experience level gain has been acknowledged.
Definition at line 744 of file global_actors.h.
Referenced by _CheckForGrowth(), and _ConstructPeriodicGrowth().
Definition at line 726 of file global_actors.h.
Referenced by _CheckForGrowth(), _ConstructPeriodicGrowth(), AcknowledgeGrowth(), and GetProtectionGrowth().
std::deque<std::pair<uint32, uint32> > hoa_global::GlobalCharacterGrowth::_protection_periodic_growth [private] |
Definition at line 749 of file global_actors.h.
Referenced by _CheckForGrowth(), and _ConstructPeriodicGrowth().
Definition at line 722 of file global_actors.h.
Referenced by _CheckForGrowth(), _ConstructPeriodicGrowth(), AcknowledgeGrowth(), and GetSkillPointsGrowth().
std::deque<std::pair<uint32, uint32> > hoa_global::GlobalCharacterGrowth::_skill_points_periodic_growth [private] |
Definition at line 745 of file global_actors.h.
Referenced by _CheckForGrowth(), and _ConstructPeriodicGrowth().
std::list<GlobalSkill*> hoa_global::GlobalCharacterGrowth::_skills_learned [private] |
Contains any and all skills that are to be learned when the next experience level is reached These are automatically added to the character by this class after the new experience level growth has been acknowledged.
Definition at line 758 of file global_actors.h.
Referenced by _AddSkill(), _CheckForGrowth(), GetSkillsLearned(), and ~GlobalCharacterGrowth().
Definition at line 723 of file global_actors.h.
Referenced by _CheckForGrowth(), _ConstructPeriodicGrowth(), AcknowledgeGrowth(), and GetStrengthGrowth().
std::deque<std::pair<uint32, uint32> > hoa_global::GlobalCharacterGrowth::_strength_periodic_growth [private] |
Definition at line 746 of file global_actors.h.
Referenced by _CheckForGrowth(), and _ConstructPeriodicGrowth().
Definition at line 724 of file global_actors.h.
Referenced by _CheckForGrowth(), _ConstructPeriodicGrowth(), AcknowledgeGrowth(), and GetVigorGrowth().
std::deque<std::pair<uint32, uint32> > hoa_global::GlobalCharacterGrowth::_vigor_periodic_growth [private] |
Definition at line 747 of file global_actors.h.
Referenced by _CheckForGrowth(), and _ConstructPeriodicGrowth().
1.5.1