Removed OnStatusMove hook, now just uses OnSecondaryEffect hook.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
5ac2b7b3c9
commit
04bf061115
|
@ -69,10 +69,6 @@ export uint8_t CreatureLib_Script_OverrideDamage(Script* p, ExecutingAttack* att
|
|||
uint8_t hitNumber, uint32_t* damage) {
|
||||
Try(p->OverrideDamage(attack, target, hitNumber, damage));
|
||||
}
|
||||
export uint8_t CreatureLib_Script_OnStatusMove(Script* p, ExecutingAttack* attack, Creature* target,
|
||||
uint8_t hitNumber) {
|
||||
Try(p->OnStatusMove(attack, target, hitNumber));
|
||||
}
|
||||
export uint8_t CreatureLib_Script_PreventSecondaryEffects(Script* p, ExecutingAttack* attack, Creature* target,
|
||||
uint8_t hitNumber, bool* outResult) {
|
||||
Try(p->PreventSecondaryEffects(attack, target, hitNumber, outResult));
|
||||
|
|
|
@ -155,7 +155,17 @@ void TurnHandler::HandleAttackForTarget(ExecutingAttack* attack, Creature* targe
|
|||
|
||||
if (attackData->GetCategory() == Library::AttackCategory::Status) {
|
||||
if (attackData->HasSecondaryEffect()) {
|
||||
HOOK(OnStatusMove, userSource, attack, target, hitIndex);
|
||||
auto effect = attackData->GetSecondaryEffect();
|
||||
bool hasSecondaryEffect;
|
||||
if (effect->GetChance() == -1) {
|
||||
hasSecondaryEffect = true;
|
||||
} else {
|
||||
hasSecondaryEffect =
|
||||
user->GetBattle()->GetRandom()->EffectChance(effect->GetChance(), attack, target);
|
||||
}
|
||||
if (hasSecondaryEffect) {
|
||||
HOOK(OnSecondaryEffect, userSource, attack, target, hitIndex);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
auto damage = hit->GetDamage();
|
||||
|
|
|
@ -50,7 +50,6 @@ namespace CreatureLib::Battling {
|
|||
float* modifier){};
|
||||
virtual void OverrideDamage(ExecutingAttack* attack, Creature* target, uint8_t hitIndex, uint32_t* damage){};
|
||||
|
||||
virtual void OnStatusMove(const ExecutingAttack* attack, Creature* target, uint8_t hitNumber){};
|
||||
virtual void PreventSecondaryEffects(const ExecutingAttack* attack, Creature* target, uint8_t hitNumber,
|
||||
bool* outResult){};
|
||||
virtual void OnSecondaryEffect(const ExecutingAttack* attack, Creature* target, uint8_t hitNumber){};
|
||||
|
|
Loading…
Reference in New Issue