mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Add Counter and Mirror Coat bugfix
This commit is contained in:
parent
53bcd8f46c
commit
57fc81d44e
@ -246,7 +246,35 @@ DefenseDownHit:
|
||||
|
||||
([Video](https://www.youtube.com/watch?v=uRYyzKRatFk))
|
||||
|
||||
*To do:* Identify specific code causing this bug and fix it.
|
||||
This is a bug with `BattleCommand_Counter` in [engine/battle/move_effects/counter.asm](/engine/battle/move_effects/counter.asm) and `BattleCommand_MirrorCoat` in [engine/battle/move_effects/mirror_coat.asm](/engine/battle/move_effects/mirror_coat.asm):
|
||||
|
||||
```asm
|
||||
; BUG: Move should fail with all non-damaging battle actions
|
||||
ld hl, wCurDamage
|
||||
ld a, [hli]
|
||||
or [hl]
|
||||
ret z
|
||||
```
|
||||
|
||||
**Fix:**
|
||||
|
||||
```diff
|
||||
ld hl, wCurDamage
|
||||
ld a, [hli]
|
||||
or [hl]
|
||||
- ret z
|
||||
+ jp z, .failed
|
||||
```
|
||||
|
||||
Add this to the end of each file:
|
||||
|
||||
```diff
|
||||
+.failed
|
||||
+ ld a, 1
|
||||
+ ld [wEffectFailed], a
|
||||
+ and a
|
||||
+ ret
|
||||
```
|
||||
|
||||
|
||||
## A Disabled but PP Up–enhanced move may not trigger Struggle
|
||||
|
@ -36,6 +36,7 @@ BattleCommand_Counter: ; 35813
|
||||
cp SPECIAL
|
||||
ret nc
|
||||
|
||||
; BUG: Move should fail with all non-damaging battle actions
|
||||
ld hl, wCurDamage
|
||||
ld a, [hli]
|
||||
or [hl]
|
||||
|
@ -37,6 +37,7 @@ BattleCommand_MirrorCoat: ; 37c95
|
||||
cp SPECIAL
|
||||
ret c
|
||||
|
||||
; BUG: Move should fail with all non-damaging battle actions
|
||||
ld hl, wCurDamage
|
||||
ld a, [hli]
|
||||
or [hl]
|
||||
|
Loading…
Reference in New Issue
Block a user