Split off battle creature stats into boosted and non-boosted
This commit is contained in:
@@ -21,17 +21,27 @@ void Battling::BattleCreature::ApplyPostBattleEffects() {
|
||||
|
||||
}
|
||||
|
||||
uint32_t Battling::BattleCreature::GetStat(Core::Statistic stat) {
|
||||
return _fullStats.GetStat(stat);
|
||||
uint32_t Battling::BattleCreature::GetFlatStat(Core::Statistic stat) {
|
||||
return _flatStats.GetStat(stat);
|
||||
}
|
||||
|
||||
void Battling::BattleCreature::RecalculateStats() {
|
||||
this->_fullStats = this->__Battle->GetLibrary()->GetStatCalculator()->CalculateStats(this);
|
||||
uint32_t Battling::BattleCreature::GetBoostedStat(Core::Statistic stat) {
|
||||
return _boostedStats.GetStat(stat);
|
||||
}
|
||||
|
||||
void Battling::BattleCreature::RecalculateStat(Core::Statistic stat) {
|
||||
auto s = this->__Battle->GetLibrary()->GetStatCalculator()->CalculateStat(this, stat);
|
||||
this->_fullStats.SetStat(stat, s);
|
||||
void Battling::BattleCreature::RecalculateFlatStats() {
|
||||
this->_flatStats = this->__Battle->GetLibrary()->GetStatCalculator()->CalculateFlatStats(this);
|
||||
}
|
||||
void Battling::BattleCreature::RecalculateBoostedStats() {
|
||||
this->_boostedStats = this->__Battle->GetLibrary()->GetStatCalculator()->CalculateFlatStats(this);
|
||||
}
|
||||
|
||||
void Battling::BattleCreature::RecalculateFlatStat(Core::Statistic stat) {
|
||||
auto s = this->__Battle->GetLibrary()->GetStatCalculator()->CalculateFlatStat(this, stat);
|
||||
this->_flatStats.SetStat(stat, s);
|
||||
}
|
||||
|
||||
void Battling::BattleCreature::RecalculateBoostedStat(Core::Statistic stat) {
|
||||
auto s = this->__Battle->GetLibrary()->GetStatCalculator()->CalculateBoostedStat(this, stat);
|
||||
this->_boostedStats.SetStat(stat, s);
|
||||
}
|
||||
@@ -15,7 +15,8 @@ namespace CreatureLib::Battling{
|
||||
private:
|
||||
Library::Creature* _creature;
|
||||
Core::StatisticSet<int8_t > _statBoost;
|
||||
Core::StatisticSet<uint32_t > _fullStats;
|
||||
Core::StatisticSet<uint32_t > _flatStats;
|
||||
Core::StatisticSet<uint32_t > _boostedStats;
|
||||
|
||||
public:
|
||||
BattleCreature(Battle* battle, Library::Creature* creature);
|
||||
@@ -23,10 +24,13 @@ namespace CreatureLib::Battling{
|
||||
const Library::Creature* GetBackingCreature();
|
||||
void ApplyPostBattleEffects();
|
||||
|
||||
uint32_t GetStat(Core::Statistic stat);
|
||||
void RecalculateStats();
|
||||
uint32_t GetFlatStat(Core::Statistic stat);
|
||||
uint32_t GetBoostedStat(Core::Statistic stat);
|
||||
void RecalculateFlatStats();
|
||||
void RecalculateBoostedStats();
|
||||
|
||||
void RecalculateStat(Core::Statistic);
|
||||
void RecalculateFlatStat(Core::Statistic);
|
||||
void RecalculateBoostedStat(Core::Statistic);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user