From 2e147d1128b024e970e81b1cb1e188fdd1fe6712 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Thu, 16 Aug 2018 16:11:28 +0200 Subject: 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(-) (limited to 'engine/battle/effect_commands.asm') 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] -- cgit v1.2.3 From 79cf90ab5ec6069d2d27281e6602e85ba5310c87 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Fri, 17 Aug 2018 17:48:41 +0200 Subject: Fix some StatUp-related labels --- engine/battle/effect_commands.asm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'engine/battle/effect_commands.asm') diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 12021bc55..4f34b5be6 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -4181,13 +4181,13 @@ BattleCommand_EvasionUp2: BattleCommand_StatUp: ; statup - call CheckIfStatCanBeRaised + call RaiseStat ld a, [wFailedMessage] and a ret nz - jp StatUpAnimation + jp MinimizeDropSub -CheckIfStatCanBeRaised: +RaiseStat: ld a, b ld [wLoweredStat], a ld hl, wPlayerStatLevels @@ -4283,7 +4283,9 @@ CheckIfStatCanBeRaised: ld [wFailedMessage], a ret -StatUpAnimation: +MinimizeDropSub: +; Lower the substitute if we're minimizing + ld bc, wPlayerMinimized ld hl, DropPlayerSub ld a, [hBattleTurn] -- cgit v1.2.3 From 50da83cb23bd9b6f374a781acabdec0aa22bb598 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Fri, 17 Aug 2018 20:16:37 +0200 Subject: CheckDestinyBond -> CheckFaint Its main function is fainting the opponent and ending the move effect. Updated the comment accordingly. --- engine/battle/effect_commands.asm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'engine/battle/effect_commands.asm') diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 4f34b5be6..91c021a72 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -2363,10 +2363,12 @@ BattleCommand_SuperEffectiveText: .print jp StdBattleTextBox -BattleCommand_CheckDestinyBond: -; checkdestinybond +BattleCommand_CheckFaint: +; checkfaint -; Faint the user if it fainted an opponent using Destiny Bond. +; Faint the opponent if its HP reached zero +; and faint the user along with it if it used Destiny Bond. +; Ends the move effect if the opponent faints. ld hl, wEnemyMonHP ld a, [hBattleTurn] -- cgit v1.2.3