Adds hook to prevent critical hits.
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:
@@ -224,7 +224,13 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, const ArbUt::Bo
|
||||
auto effectiveness = typeLibrary->GetEffectiveness(hitType, target->GetTypes());
|
||||
HOOK(ChangeEffectiveness, attack, attack, target.GetRaw(), hitIndex, &effectiveness)
|
||||
hit.SetEffectiveness(effectiveness);
|
||||
hit.SetCritical(miscLibrary->IsCritical(attack, target.GetRaw(), hitIndex));
|
||||
bool canBeCritical = true;
|
||||
HOOK(BlockCritical, attack, attack, target.GetRaw(), hitIndex, &canBeCritical);
|
||||
if (canBeCritical) {
|
||||
hit.SetCritical(miscLibrary->IsCritical(attack, target.GetRaw(), hitIndex));
|
||||
} else {
|
||||
hit.SetCritical(false);
|
||||
}
|
||||
hit.SetBasePower(dmgLibrary->GetBasePower(attack, target.GetRaw(), hitIndex, hit));
|
||||
hit.SetDamage(dmgLibrary->GetDamage(attack, target.GetRaw(), hitIndex, hit));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user