Optimalization for Assurance, use tester 0.0.7
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-10-24 11:36:43 +02:00
parent e9658cef1a
commit af6d582f88
3 changed files with 4 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
type BattleHistory {
const HistoryElement@ TopElement { get const; };
const AttackUseHistory@ GetLastUsedAttack() const;
const DamageHistory@ GetLastDamageOnTarget(Pokemon@ target) const;
const AttackUseHistory@ GetLastUsedAttack(uint maxTurns = 0) const;
const DamageHistory@ GetLastDamageOnTarget(Pokemon@ target, uint maxTurns = 0) const;
}

View File

@@ -2,7 +2,7 @@ namespace Gen7{
[Move effect=Assurance]
class Assurance : PkmnScript {
void OverrideDamage(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint &inout damage) override {
auto damageEvent = target.Battle.History.GetLastDamageOnTarget(target);
auto damageEvent = target.Battle.History.GetLastDamageOnTarget(target, 1);
if (damageEvent is null){
return;
}