Add ChangeEffectiveness script hook.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
88d55998d0
commit
3dcefebee7
|
@ -148,7 +148,9 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
|
||||||
|
|
||||||
auto hitType = hit->GetType();
|
auto hitType = hit->GetType();
|
||||||
HOOK(ChangeAttackType, targetSource, attack, target, hitIndex, &hitType);
|
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->SetCritical(library->GetMiscLibrary()->IsCritical(attack, target, hitIndex));
|
||||||
hit->SetBasePower(dmgLibrary->GetBasePower(attack, target, hitIndex));
|
hit->SetBasePower(dmgLibrary->GetBasePower(attack, target, hitIndex));
|
||||||
hit->SetDamage(dmgLibrary->GetDamage(attack, target, hitIndex));
|
hit->SetDamage(dmgLibrary->GetDamage(attack, target, hitIndex));
|
||||||
|
|
|
@ -37,6 +37,8 @@ namespace CreatureLib::Battling {
|
||||||
virtual void IsInvulnerable(ExecutingAttack* attack, Creature* target, bool* outResult){};
|
virtual void IsInvulnerable(ExecutingAttack* attack, Creature* target, bool* outResult){};
|
||||||
virtual void OnAttackMiss(ExecutingAttack* attack, Creature* target){};
|
virtual void OnAttackMiss(ExecutingAttack* attack, Creature* target){};
|
||||||
virtual void ChangeAttackType(ExecutingAttack* attack, Creature* target, uint8_t hitNumber, uint8_t* outType){};
|
virtual void ChangeAttackType(ExecutingAttack* attack, Creature* target, uint8_t hitNumber, uint8_t* outType){};
|
||||||
|
virtual void ChangeEffectiveness(ExecutingAttack* attack, Creature* target, uint8_t hitNumber,
|
||||||
|
float* effectiveness){};
|
||||||
|
|
||||||
virtual void OverrideBasePower(ExecutingAttack* attack, Creature* target, uint8_t hitIndex,
|
virtual void OverrideBasePower(ExecutingAttack* attack, Creature* target, uint8_t hitIndex,
|
||||||
uint8_t* basePower){};
|
uint8_t* basePower){};
|
||||||
|
|
Loading…
Reference in New Issue