You are not logged in.
I'm trying to fix the glitch in RBY described here: http://bulbapedia.bulbagarden.net/wiki/ … s_stacking
I've found the code with comments noting the error here (lines 7872-7884) but I don't know how I should edit the code to fix the glitch. Has anyone already fixed this or have any ideas on how to change the existing routine?
I'd remove them altogether and adjust the damage calculation routine (CalculateDamage) so that it halves the attack value if mon is burned and move is physical, and then adjust the compare speed (.compareSpeed) code so that if one mon is paralyzed only 1/4 of its speed stat is considered for the comparison.
Another option is to edit the stat up / down routines so that the burn/prz penalties are only applied if the recalculated stats are burn/speed respectively. But then you have the issue that the penalties are always applied considering the pokemon whose turn is not, so you'd have to fix that for moves that raise your own stat rather than lower the enemy's.
What I did to fix this was recalculate ALL of a pokemon's stats when 'StatModifierUpEffect' or StatModifierDownEffect' happen. and then always apply 'ApplyBurnAndParalysisPenaltiesToPlayer' or 'ApplyBurnAndParalysisPenaltiesToEnemy' depending on whose turn it is.
Example codes for recalculating stats;
.recalculateStat ;Replacement for StatModifierUpEffect's recalculateStat push bc ld a, [H_WHOSETURN] ld [wd11e], a callab CalculateModifiedStats pop bc pop hl UpdateStatDone: ; regular function continues below... <snip> .recalculateStat ;Replacement for StatModifierDownEffect's recalculateStat push bc ld a, [H_WHOSETURN] xor a,1 ;if it is my turn, we need to recalc my opponent. and visversa ld [wd11e], a callab CalculateModifiedStats pop bc pop de pop hl UpdateLoweredStatDone: ; regular function continues below