Adds parameter to change stat boost to determine whether its selfinflicted
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:
@@ -145,9 +145,9 @@ namespace CreatureLib::Battling {
|
||||
}
|
||||
}
|
||||
|
||||
bool Creature::ChangeStatBoost(Library::Statistic stat, int8_t diffAmount) {
|
||||
bool Creature::ChangeStatBoost(Library::Statistic stat, int8_t diffAmount, bool selfInflicted) {
|
||||
bool preventStatChange = false;
|
||||
HOOK(PreventStatBoostChange, this, this, stat, diffAmount, &preventStatChange);
|
||||
HOOK(PreventStatBoostChange, this, this, stat, diffAmount, selfInflicted, &preventStatChange);
|
||||
if (preventStatChange) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace CreatureLib::Battling {
|
||||
|
||||
// region Stat APIs
|
||||
|
||||
bool ChangeStatBoost(Library::Statistic stat, int8_t diffAmount);
|
||||
bool ChangeStatBoost(Library::Statistic stat, int8_t diffAmount, bool selfInflicted = false);
|
||||
[[nodiscard]] inline uint32_t GetFlatStat(Library::Statistic stat) const { return _flatStats.GetStat(stat); }
|
||||
[[nodiscard]] inline uint32_t GetBoostedStat(Library::Statistic stat) const {
|
||||
return _boostedStats.GetStat(stat);
|
||||
|
||||
Reference in New Issue
Block a user