Add ChangeEffectiveness script hook.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-19 13:07:28 +02:00
parent 88d55998d0
commit 3dcefebee7
2 changed files with 5 additions and 1 deletions

View File

@@ -148,7 +148,9 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
auto hitType = hit->GetType();
HOOK(ChangeAttackType, targetSource, attack, target, hitIndex, &hitType);
hit->SetEffectiveness(library->GetTypeLibrary()->GetEffectiveness(hitType, target->GetTypes()));
auto effectiveness = library->GetTypeLibrary()->GetEffectiveness(hitType, target->GetTypes());
HOOK(ChangeEffectiveness, attack, attack, target, hitIndex, &effectiveness)
hit->SetEffectiveness(effectiveness);
hit->SetCritical(library->GetMiscLibrary()->IsCritical(attack, target, hitIndex));
hit->SetBasePower(dmgLibrary->GetBasePower(attack, target, hitIndex));
hit->SetDamage(dmgLibrary->GetDamage(attack, target, hitIndex));