Add missing highest damage stat tracking

pull/16/head
Flashfyre 2024-02-19 10:16:38 -05:00
parent a2fec36874
commit 07fcfcccaf
1 changed files with 4 additions and 1 deletions

View File

@ -1112,8 +1112,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
this.scene.queueMessage('A critical hit!'); this.scene.queueMessage('A critical hit!');
this.scene.setPhaseQueueSplice(); this.scene.setPhaseQueueSplice();
damage.value = this.damage(damage.value); damage.value = this.damage(damage.value);
if (source.isPlayer()) if (source.isPlayer()) {
this.scene.validateAchvs(DamageAchv, damage); this.scene.validateAchvs(DamageAchv, damage);
if (damage.value > this.scene.gameData.gameStats.highestDamage)
this.scene.gameData.gameStats.highestDamage = damage.value;
}
source.turnData.damageDealt += damage.value; source.turnData.damageDealt += damage.value;
this.battleData.hitCount++; this.battleData.hitCount++;
this.turnData.attacksReceived.unshift({ move: move.id, result: result as DamageResult, damage: damage.value, critical: isCritical, sourceId: source.id }); this.turnData.attacksReceived.unshift({ move: move.id, result: result as DamageResult, damage: damage.value, critical: isCritical, sourceId: source.id });