Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2015-08-04 22:38:23

delpo
Member
Registered: 2012-11-26
Post 39/40

fixing paralysis/burn stat stacking in red/blue

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?

Offline

#2 2015-08-11 11:34:01

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 308/432
Website

Re: fixing paralysis/burn stat stacking in red/blue

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.

Offline

#3 2016-09-11 20:03:41

MechanicalPen
Member
Registered: 2016-06-22
Post 9/29

Re: fixing paralysis/burn stat stacking in red/blue

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

Offline

Board footer

Powered by FluxBB