shithub: pokecrystal

Download patch

ref: 9978126309d41e55c70a86fef08127c817f48bf9
parent: 3550a87360308167d2751f17daa88c8ccd545e73
parent: 49458edf94af31a3bf87c227c7f20870c6c38206
author: Rangi <[email protected]>
date: Fri Dec 18 04:26:31 EST 2020

Merge pull request #792 from nbasu02/document-stat-up-hit-fix

Document fix for StatUpHit effects when opponent is KO'd

--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -37,6 +37,7 @@
   - [Dragon Scale, not Dragon Fang, boosts Dragon-type moves](#dragon-scale-not-dragon-fang-boosts-dragon-type-moves)
   - [HP bar animation is slow for high HP](#hp-bar-animation-is-slow-for-high-hp)
   - [HP bar animation off-by-one error for low HP](#hp-bar-animation-off-by-one-error-for-low-hp)
+  - [Moves that do damage and increase your stats do not increase stats after a KO](#moves-that-do-damage-and-increase-your-stats-do-not-increase-stats-after-a-ko)
 - [Single-player battle engine](#single-player-battle-engine)
   - [A Transformed Pokémon can use Sketch and learn otherwise unobtainable moves](#a-transformed-pokémon-can-use-sketch-and-learn-otherwise-unobtainable-moves)
   - [Catching a Transformed Pokémon always catches a Ditto](#catching-a-transformed-pokémon-always-catches-a-ditto)
@@ -762,6 +763,46 @@
  	jr c, .done
  	inc b
  	jr .loop
+```
+
+### Moves that do damage and increase your stats do not increase stats after a KO
+
+`BattleCommand_CheckFaint` "ends the move effect if the opponent faints", and these moves attempt to raise the user's stats *after* `checkfaint`. Note that fixing this can lead to stats being increased at the end of battle, but will not have any negative effects.
+
+**Fix:** Edit [data/moves/effects.asm](https://github.com/pret/pokecrystal/blob/master/data/moves/effects.asm):
+
+```diff
+ DefenseUpHit:
+ 	...
+ 	criticaltext
+ 	supereffectivetext
++	defenseup
+ 	checkfaint
+ 	buildopponentrage
+-	defenseup
+ 	statupmessage
+ 	endmove
+
+ AttackUpHit:
+ 	...
+ 	criticaltext
+ 	supereffectivetext
++	attackup
+ 	checkfaint
+ 	buildopponentrage
+-	attackup
+ 	statupmessage
+ 	endmove
+
+ AllUpHit:
+ 	...
+ 	criticaltext
+ 	supereffectivetext
++	allstatsup
+ 	checkfaint
+ 	buildopponentrage
+-	allstatsup
+ 	endmove
 ```