Adds parameter to change stat boost to determine whether its selfinflicted
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
a99e3e2d6c
commit
a015a3fc62
|
@ -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;
|
bool preventStatChange = false;
|
||||||
HOOK(PreventStatBoostChange, this, this, stat, diffAmount, &preventStatChange);
|
HOOK(PreventStatBoostChange, this, this, stat, diffAmount, selfInflicted, &preventStatChange);
|
||||||
if (preventStatChange) {
|
if (preventStatChange) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,7 +219,7 @@ namespace CreatureLib::Battling {
|
||||||
|
|
||||||
// region Stat APIs
|
// 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 GetFlatStat(Library::Statistic stat) const { return _flatStats.GetStat(stat); }
|
||||||
[[nodiscard]] inline uint32_t GetBoostedStat(Library::Statistic stat) const {
|
[[nodiscard]] inline uint32_t GetBoostedStat(Library::Statistic stat) const {
|
||||||
return _boostedStats.GetStat(stat);
|
return _boostedStats.GetStat(stat);
|
||||||
|
|
|
@ -91,7 +91,7 @@ namespace CreatureLib::Battling {
|
||||||
_par_ u8 hitNumber){};
|
_par_ u8 hitNumber){};
|
||||||
|
|
||||||
virtual void PreventStatBoostChange(_par_ Creature* target, _par_ Library::Statistic stat,
|
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,
|
virtual void ModifyStatBoostChange(_par_ Creature* target, _par_ Library::Statistic stat,
|
||||||
_par_ int8_t* diffAmount){};
|
_par_ int8_t* diffAmount){};
|
||||||
virtual void PreventSecondaryEffects(_par_ const ExecutingAttack* attack, _par_ Creature* target,
|
virtual void PreventSecondaryEffects(_par_ const ExecutingAttack* attack, _par_ Creature* target,
|
||||||
|
|
Loading…
Reference in New Issue