Load the palette #9 in the position 24 (color count=64)
Wait 4 frame
Label 1
If Var[5][11] < 62 (else goto label 2)
Var[5][11] = Var[5][11] + 1 (8 bit)
Multiply RGB(Var[5][11], Var[5][11], Var[5][11]) on the colors in a palette (sourcePal=24, targetPal=28, color count=64)
Copy palette (sourcePal=24, targetPal=28, color count=1)
Load the position 28 in the palette #9 (color count=64)
Goto label 1
Label 2
If Var[5][11] > 48 (else goto label 3)
Var[5][11] = Var[5][11] - 1 (8 bit)
Var[5][11] = Var[5][11] + 1 (8 bit)
Multiply RGB(Var[5][11], Var[5][11], Var[5][11]) on the colors in a palette (sourcePal=24, targetPal=28, color count=64)
Copy palette (sourcePal=24, targetPal=28, color count=1)
Load the position 28 in the palette #9 (color count=64)
Goto label 2
Label 3
Goto label 1
it seams fairly logical to to me .. allow me to explain. (at least how it should work , does not be cause they set [5][11] to 66 )
1. Goto used as loop controls (oh my HS comp sci teacher would be pissed he hated when we used goto)
[5][11] starts at lest say 0. if we look at the logic flow heres whats going on ..
for the first 62 loops the top condition will be true [5][11] will be less then 62
on the 63rd loop [5][11]=62 so the first condition will fail
from loop 63 onward the second condition is true. [5][11] is indeed greater then 48.
since the second condition never changes the value of [5][11] it just become the came color over and over..
yeah its bad logic but its not the first time we have seen it and we don't know maybe after 62 loops we no longer want the change any more .. this script is of course completely broken due to the value they set [5][11] to in s0-Init.
change in the scripts Init the value to 0 and see what happens in game...