From e1da37e03303b1a6dd6531d8a044339f337731a1 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Wed, 4 Apr 2018 22:35:47 +0200 Subject: Comment SapHealth Also fixed some Beat Up inconsistencies to make it more readable. --- engine/battle/move_effects/beat_up.asm | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'engine/battle/move_effects') diff --git a/engine/battle/move_effects/beat_up.asm b/engine/battle/move_effects/beat_up.asm index 18e350504..2f326e362 100644 --- a/engine/battle/move_effects/beat_up.asm +++ b/engine/battle/move_effects/beat_up.asm @@ -5,9 +5,11 @@ BattleCommand_BeatUp: ; 35461 ld a, [hBattleTurn] and a jp nz, .enemy_beats_up + ld a, [wPlayerSubStatus3] bit SUBSTATUS_IN_LOOP, a jr nz, .next_mon + ld c, 20 call DelayFrames xor a @@ -51,11 +53,13 @@ BattleCommand_BeatUp: ; 35461 ld [wBeatUpHitAtLeastOnce], a ld hl, BeatUpAttackText call StdBattleTextBox + ld a, [wEnemyMonSpecies] ld [wCurSpecies], a call GetBaseData ld a, [wBaseDefense] ld c, a + push bc ld a, MON_SPECIES call GetBeatupMonLocation @@ -65,12 +69,14 @@ BattleCommand_BeatUp: ; 35461 ld a, [wBaseAttack] pop bc ld b, a + push bc ld a, MON_LEVEL call GetBeatupMonLocation ld a, [hl] ld e, a pop bc + ld a, [wPlayerMoveStructPower] ld d, a ret @@ -78,21 +84,22 @@ BattleCommand_BeatUp: ; 35461 .enemy_beats_up ld a, [wEnemySubStatus3] bit SUBSTATUS_IN_LOOP, a - jr nz, .not_first_enemy_beatup + jr nz, .enemy_next_mon xor a ld [wEnemyRolloutCount], a ld [wd002], a ld [wBeatUpHitAtLeastOnce], a - jr .enemy_continue + jr .enemy_got_mon -.not_first_enemy_beatup +.enemy_next_mon ld a, [wEnemyRolloutCount] ld b, a ld a, [wOTPartyCount] sub b ld [wd002], a -.enemy_continue + +.enemy_got_mon ld a, [wBattleMode] dec a jr z, .wild @@ -122,19 +129,20 @@ BattleCommand_BeatUp: ; 35461 call AddNTimes ld de, wStringBuffer1 call CopyBytes + .got_enemy_nick ld a, MON_HP call GetBeatupMonLocation ld a, [hli] or [hl] jp z, .beatup_fail + ld a, [wd002] ld b, a ld a, [wCurOTMon] cp b ld hl, wEnemyMonStatus jr z, .active_enemy - ld a, MON_STATUS call GetBeatupMonLocation .active_enemy @@ -157,11 +165,13 @@ BattleCommand_BeatUp: ; 35461 .finish_beatup ld hl, BeatUpAttackText call StdBattleTextBox + ld a, [wBattleMonSpecies] ld [wCurSpecies], a call GetBaseData ld a, [wBaseDefense] ld c, a + push bc ld a, MON_SPECIES call GetBeatupMonLocation @@ -171,12 +181,14 @@ BattleCommand_BeatUp: ; 35461 ld a, [wBaseAttack] pop bc ld b, a + push bc ld a, MON_LEVEL call GetBeatupMonLocation ld a, [hl] ld e, a pop bc + ld a, [wEnemyMoveStructPower] ld d, a ret -- cgit v1.2.3 From 800f9489145dc7c82edb3fa86fc24a5ff7411533 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Tue, 3 Apr 2018 12:00:24 +0200 Subject: Label BattleCommand_BeatUpFailText --- engine/battle/move_effects/beat_up.asm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engine/battle/move_effects') diff --git a/engine/battle/move_effects/beat_up.asm b/engine/battle/move_effects/beat_up.asm index 2f326e362..8ea308d90 100644 --- a/engine/battle/move_effects/beat_up.asm +++ b/engine/battle/move_effects/beat_up.asm @@ -203,7 +203,9 @@ BattleCommand_BeatUp: ; 35461 ; 355b5 -BattleCommanda8: ; 355b5 +BattleCommand_BeatUpFailText: ; 355b5 +; beatupfailtext + ld a, [wBeatUpHitAtLeastOnce] and a ret nz -- cgit v1.2.3 From d4025863cf56466b79827bace6d6b3e48ffd05e9 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Wed, 4 Apr 2018 23:27:40 +0200 Subject: Rename some battle commands `hittarget` was misleading, as it doesn't actually "hit" the target, it only plays the animation. As such, I've renamed it to `moveanim`. `checkfaint` has nothing to do with checking if the user or target has fainted, instead, it applies wCurDamage onto the target's HP, hitting the substitute if applicable. I've renamed the command to `applydamage` and all of its subfunctions accordingly. --- engine/battle/move_effects/false_swipe.asm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engine/battle/move_effects') diff --git a/engine/battle/move_effects/false_swipe.asm b/engine/battle/move_effects/false_swipe.asm index e93b627ec..f00de91e7 100644 --- a/engine/battle/move_effects/false_swipe.asm +++ b/engine/battle/move_effects/false_swipe.asm @@ -1,6 +1,8 @@ BattleCommand_FalseSwipe: ; 35c94 ; falseswipe +; Makes sure wCurDamage < MonHP + ld hl, wEnemyMonHP ld a, [hBattleTurn] and a @@ -15,12 +17,14 @@ BattleCommand_FalseSwipe: ; 35c94 pop de pop hl jr c, .done + ld a, [hli] ld [de], a inc de ld a, [hl] dec a ld [de], a + inc a jr nz, .okay dec de @@ -28,11 +32,13 @@ BattleCommand_FalseSwipe: ; 35c94 dec a ld [de], a .okay + ld a, [wCriticalHit] cp 2 jr nz, .carry xor a ld [wCriticalHit], a + .carry scf ret -- cgit v1.2.3