Implements BattleRandom class with support for Effect Chance, and script hooks to modify this.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-02-16 15:08:22 +01:00
parent 579ee82f02
commit 54e366fc1b
5 changed files with 45 additions and 4 deletions

View File

@@ -0,0 +1,10 @@
#include "BattleRandom.hpp"
#include "Creature.hpp"
#include "ExecutingAttack.hpp"
bool CreatureLib::Battling::BattleRandom::EffectChance(float chance, ExecutingAttack* attack, Creature* target) {
HOOK(ModifyEffectChance, attack, attack, target, &chance);
HOOK(ModifyIncomingEffectChance, target, attack, target, &chance);
chance /= 100;
return _random.GetFloat() < chance;
}