From 2e147d1128b024e970e81b1cb1e188fdd1fe6712 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Thu, 16 Aug 2018 16:11:28 +0200 Subject: [PATCH] GetDamageStatsCritical -> CheckDamageStatsCritical Clarified its usage, as the comments surrounding it were factually wrong. --- engine/battle/effect_commands.asm | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 32cc65e35..12021bc55 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -2594,7 +2594,7 @@ PlayerAttackDamage: .physicalcrit ld hl, wBattleMonAttack - call GetDamageStatsCritical + call CheckDamageStatsCritical jr c, .thickclub ld hl, wEnemyDefense @@ -2618,7 +2618,7 @@ PlayerAttackDamage: .specialcrit ld hl, wBattleMonSpclAtk - call GetDamageStatsCritical + call CheckDamageStatsCritical jr c, .lightball ld hl, wEnemySpDef @@ -2692,20 +2692,16 @@ TruncateHL_BC: ld b, l ret -GetDamageStatsCritical: -; Return carry if non-critical. +CheckDamageStatsCritical: +; Return carry if boosted stats should be used in damage calculations. +; Unboosted stats should be used if the attack is a critical hit, +; and the stage of the opponent's defense is higher than the user's attack. ld a, [wCriticalHit] and a scf ret z - ; fallthrough - -GetDamageStats: -; Return the attacker's offensive stat and the defender's defensive -; stat based on whether the attacking type is physical or special. - push hl push bc ld a, [hBattleTurn] @@ -2840,7 +2836,7 @@ EnemyAttackDamage: .physicalcrit ld hl, wEnemyMonAttack - call GetDamageStatsCritical + call CheckDamageStatsCritical jr c, .thickclub ld hl, wPlayerDefense @@ -2864,7 +2860,7 @@ EnemyAttackDamage: .specialcrit ld hl, wEnemyMonSpclAtk - call GetDamageStatsCritical + call CheckDamageStatsCritical jr c, .lightball ld hl, wPlayerSpDef ld a, [hli]