summaryrefslogtreecommitdiff
path: root/docs/bugs_and_glitches.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/bugs_and_glitches.md')
-rw-r--r--docs/bugs_and_glitches.md78
1 files changed, 64 insertions, 14 deletions
diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md
index 078a86d9b..d95c85100 100644
--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -182,23 +182,33 @@ Fixes in the [multi-player battle engine](#multi-player-battle-engine) category
([Video](https://www.youtube.com/watch?v=rGqu3d3pdok&t=450))
-**Fix:** Edit `DittoMetalPowder` in [engine/battle/effect_commands.asm](https://github.com/pret/pokecrystal/blob/master/engine/battle/effect_commands.asm):
+**Fix:** Edit [engine/battle/effect_commands.asm](https://github.com/pret/pokecrystal/blob/master/engine/battle/effect_commands.asm):
```diff
- ld a, c
- srl a
- add c
- ld c, a
- ret nc
+ DittoMetalPowder:
+ ...
- srl b
- ld a, b
- and a
- jr nz, .done
- inc b
- .done
- scf
- rr c
+- ld a, c
+- srl a
+- add c
+- ld c, a
+- ret nc
+-
+- srl b
+- ld a, b
+- and a
+- jr nz, .done
+- inc b
+-.done
+- scf
+- rr c
++ ld h, b
++ ld l, c
++ srl b
++ rr c
++ add hl, bc
++ ld b, h
++ ld c, l
+
+ ld a, HIGH(MAX_STAT_VALUE)
+ cp b
@@ -213,6 +223,46 @@ Fixes in the [multi-player battle engine](#multi-player-battle-engine) category
ret
```
+```diff
+ PlayerAttackDamage:
+ ...
+
+ .done
++ push hl
++ call DittoMetalPowder
++ pop hl
+
+ call TruncateHL_BC
+
+ ld a, [wBattleMonLevel]
+ ld e, a
+- call DittoMetalPowder
+
+ ld a, 1
+ and a
+ ret
+```
+
+```diff
+ EnemyAttackDamage:
+ ...
+
+ .done
++ push hl
++ call DittoMetalPowder
++ pop hl
+
+ call TruncateHL_BC
+
+ ld a, [wBattleMonLevel]
+ ld e, a
+- call DittoMetalPowder
+
+ ld a, 1
+ and a
+ ret
+```
+
### Reflect and Light Screen can make (Special) Defense wrap around above 1024