nightmareci / HeborisCE

Cross-platform Expansion (C.E.) and continuation of Heboris U.E. using modern technology and development approach
36 stars 5 forks source link

BUG: leveling up for OLD-STYLE is off by 1. #8

Closed zaphod77 closed 2 years ago

zaphod77 commented 2 years ago

In gamestart.c in the section for leveling up in old-style, it uses level-1 instead of level in the levelup routine, this should be fixed, but breaks replay compat to fix..

therefore, repversp needs to be increased, and checked in this section.

When it was fixed to start at zero instead of 1 like the other ace modes, this wasn't changed back.

it's currently 65. increase to 66, and use if (repversp>65)

to implement these backward incompatible changes.

I have code that does this, as well as add a dedicated level table for old school sega that is more accurate (but not fuully accurate, as it's not possible with 60 based gravity).

interested?

} else if( (lc[player] > 100) && (!ending[player]) && ( anothermode[player] == 3)) {
            lc[player] = 0;
            // アナザー3
            lv[player]++;
            int uppedlevel = lv[player]; // correct level speed, but not for past replays
            if (repversw > 65) // new version
                uppedlevel++; // one higher, cuz we are subtracting later.
            if(heboGB[player] == 2){
                if(lv[player]<19){
                                        /*  // uncomment if you add the new table
                    if (repversw > 65) // new version
                        sp[player] = lvTablesegahebo[uppedlevel-1];  // use better table
                    else */
                        sp[player] = lvTabletomoyohebo[uppedlevel-1];
                }
            }else{
                if(lv[player]<=15){
                    sp[player] = lvTableHeboGB[uppedlevel-1];
                    wait3[player] = wait3_HeboGB_tbl[uppedlevel-1];
                    waitt[player] = waitt_HeboGB_tbl[uppedlevel-1];
                }
            }

the level table i made is put in speed.c

int32_t lvTablesegahebo[20] =
{
       1,   2,   3,   4,   5,  6,  8,  10,  15,  30,
      6,   8,  10,  15,  30,  60,  60,  60,  60,  60
};

and in speed.h

extern int32_t lvTablesegahebo[20];