Implements clamped statistics for stat boost.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -50,12 +50,14 @@ void Battling::Creature::SetBattleData(Battling::Battle* battle, Battling::Battl
|
||||
|
||||
// region Stat APIs
|
||||
|
||||
void Battling::Creature::ChangeStatBoost(Library::Statistic stat, int8_t diffAmount) {
|
||||
bool Battling::Creature::ChangeStatBoost(Library::Statistic stat, int8_t diffAmount) {
|
||||
bool changed = false;
|
||||
if (diffAmount > 0)
|
||||
this->_statBoost.IncreaseStatBy(stat, diffAmount);
|
||||
changed = this->_statBoost.IncreaseStatBy(stat, diffAmount);
|
||||
else
|
||||
this->_statBoost.DecreaseStatBy(stat, -diffAmount);
|
||||
changed = this->_statBoost.DecreaseStatBy(stat, -diffAmount);
|
||||
this->RecalculateBoostedStat(stat);
|
||||
return changed;
|
||||
}
|
||||
|
||||
uint32_t Battling::Creature::GetFlatStat(Library::Statistic stat) const noexcept { return _flatStats.GetStat(stat); }
|
||||
|
||||
Reference in New Issue
Block a user