Use GetUseAttack for executingmove
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user