summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormid-kid <esteve.varela@gmail.com>2018-08-16 16:11:28 +0200
committermid-kid <esteve.varela@gmail.com>2018-08-16 16:11:28 +0200
commit2e147d1128b024e970e81b1cb1e188fdd1fe6712 (patch)
tree3f5dc7c90c79d7ae9636d576dbed6eb1e6bb396f
parentf5cd6341fffddc4d244ea60df4b2c23e70d6041e (diff)
GetDamageStatsCritical -> CheckDamageStatsCritical
Clarified its usage, as the comments surrounding it were factually wrong.
-rw-r--r--engine/battle/effect_commands.asm20
1 files 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]