GetDamageStatsCritical -> CheckDamageStatsCritical

Clarified its usage, as the comments surrounding it were factually
wrong.
This commit is contained in:
mid-kid
2018-08-16 16:11:28 +02:00
parent f5cd6341ff
commit 2e147d1128

View File

@@ -2594,7 +2594,7 @@ PlayerAttackDamage:
.physicalcrit .physicalcrit
ld hl, wBattleMonAttack ld hl, wBattleMonAttack
call GetDamageStatsCritical call CheckDamageStatsCritical
jr c, .thickclub jr c, .thickclub
ld hl, wEnemyDefense ld hl, wEnemyDefense
@@ -2618,7 +2618,7 @@ PlayerAttackDamage:
.specialcrit .specialcrit
ld hl, wBattleMonSpclAtk ld hl, wBattleMonSpclAtk
call GetDamageStatsCritical call CheckDamageStatsCritical
jr c, .lightball jr c, .lightball
ld hl, wEnemySpDef ld hl, wEnemySpDef
@@ -2692,20 +2692,16 @@ TruncateHL_BC:
ld b, l ld b, l
ret ret
GetDamageStatsCritical: CheckDamageStatsCritical:
; Return carry if non-critical. ; 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] ld a, [wCriticalHit]
and a and a
scf scf
ret z 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 hl
push bc push bc
ld a, [hBattleTurn] ld a, [hBattleTurn]
@@ -2840,7 +2836,7 @@ EnemyAttackDamage:
.physicalcrit .physicalcrit
ld hl, wEnemyMonAttack ld hl, wEnemyMonAttack
call GetDamageStatsCritical call CheckDamageStatsCritical
jr c, .thickclub jr c, .thickclub
ld hl, wPlayerDefense ld hl, wPlayerDefense
@@ -2864,7 +2860,7 @@ EnemyAttackDamage:
.specialcrit .specialcrit
ld hl, wEnemyMonSpclAtk ld hl, wEnemyMonSpclAtk
call GetDamageStatsCritical call CheckDamageStatsCritical
jr c, .lightball jr c, .lightball
ld hl, wPlayerSpDef ld hl, wPlayerSpDef
ld a, [hli] ld a, [hli]