summaryrefslogtreecommitdiff
path: root/engine/battle/move_effects
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2018-04-04 21:18:15 -0400
committerGitHub <noreply@github.com>2018-04-04 21:18:15 -0400
commitf750d4f4185529cfb440ac7825d202ebcf160766 (patch)
tree7bccc72ff98e0b6d221f46865780050c471c3b75 /engine/battle/move_effects
parentfe4377ce532d1fea1b28d2c52e4f62f0ca702a30 (diff)
parentd4025863cf56466b79827bace6d6b3e48ffd05e9 (diff)
Merge pull request #505 from mid-kid/battlecommands
Battle command fixes
Diffstat (limited to 'engine/battle/move_effects')
-rw-r--r--engine/battle/move_effects/beat_up.asm26
-rw-r--r--engine/battle/move_effects/false_swipe.asm6
2 files changed, 26 insertions, 6 deletions
diff --git a/engine/battle/move_effects/beat_up.asm b/engine/battle/move_effects/beat_up.asm
index 18e350504..8ea308d90 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
@@ -191,7 +203,9 @@ BattleCommand_BeatUp: ; 35461
; 355b5
-BattleCommanda8: ; 355b5
+BattleCommand_BeatUpFailText: ; 355b5
+; beatupfailtext
+
ld a, [wBeatUpHitAtLeastOnce]
and a
ret nz
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