Use GetUseAttack for executingmove
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-05-13 13:25:08 +02:00
parent d8eac290cf
commit 59a092a06e
2 changed files with 6 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ uint8_t PkmnLib::Battling::DamageLibrary::GetBasePower(CreatureLib::Battling::Ex
[[maybe_unused]] CreatureLib::Battling::Creature* target,
[[maybe_unused]] uint8_t hitIndex,
[[maybe_unused]] const HitData& hitData) const {
auto bp = attack->GetAttack()->GetAttack()->GetBasePower();
auto bp = attack->GetUseAttack()->GetBasePower();
// HOOK: modify base power.
return bp;
}
@@ -41,8 +41,7 @@ float PkmnLib::Battling::DamageLibrary::GetStatModifier(CreatureLib::Battling::E
// HOOK: allow overriding for which users stat we use.
CreatureLib::Library::Statistic offensiveStat;
CreatureLib::Library::Statistic defensiveStat;
auto learnedMove = attack->GetAttack().ForceAs<LearnedMove>();
auto moveData = learnedMove->GetMoveData();
auto moveData = attack->GetUseAttack().ForceAs<const Library::MoveData>();
if (moveData->GetCategory() == Library::MoveCategory::Physical) {
offensiveStat = Library::Statistic::PhysicalAttack;
defensiveStat = Library::Statistic::PhysicalDefense;