Implements critical calculation, fixes some library pointers being unset, causing segfaults.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2019-11-05 17:42:45 +01:00
parent b290f16a15
commit 2ecc5cfccd
6 changed files with 41 additions and 6 deletions

View File

@@ -103,8 +103,7 @@ void CreatureLib::Battling::TurnHandler::HandleAttackForTarget(CreatureLib::Batt
//HOOK: Change move type
hit.SetEffectiveness(library->GetTypeLibrary()->GetEffectiveness(hit.GetType(), target->GetTypes()));
//TODO: Critical calculation
hit.SetCritical(false);
hit.SetCritical(library->GetCriticalLibrary()->IsCritical(&attack, target, hitIndex));
hit.SetBasePower(dmgLibrary->GetBasePower(&attack, target, hitIndex));
hit.SetDamage(dmgLibrary->GetDamage(&attack, target, hitIndex));