Adds parameter to change stat boost to determine whether its selfinflicted
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2022-03-12 11:34:00 +01:00
parent a99e3e2d6c
commit a015a3fc62
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
3 changed files with 4 additions and 4 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -91,7 +91,7 @@ namespace CreatureLib::Battling {
_par_ u8 hitNumber){};
virtual void PreventStatBoostChange(_par_ Creature* target, _par_ Library::Statistic stat,
_par_ int8_t diffAmount, _par_ bool* prevent){};
_par_ int8_t diffAmount, _par_ bool selfInflicted, _par_ bool* prevent){};
virtual void ModifyStatBoostChange(_par_ Creature* target, _par_ Library::Statistic stat,
_par_ int8_t* diffAmount){};
virtual void PreventSecondaryEffects(_par_ const ExecutingAttack* attack, _par_ Creature* target,