mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-07 07:22:54 +00:00
Chao Key changes
- Chao Keys are now UINT16 instead of UINT8 - The maximum number of Chao Keys is now 9999, which is the largest number of 9s that can fit in a UINT16 - Used keys no longer count towards your total Will mildly corrupt gamedatas made with previous conditions-cascading builds, but only in a way that gives you extra keys than you've earned.
This commit is contained in:
parent
2ec3cf498d
commit
7f3836f916
5 changed files with 12 additions and 17 deletions
|
|
@ -4581,8 +4581,7 @@ void G_LoadGameData(void)
|
|||
gamedata->pendingkeyrounds = READUINT32(save.p);
|
||||
gamedata->pendingkeyroundoffset = READUINT8(save.p);
|
||||
gamedata->keyspending = READUINT8(save.p);
|
||||
gamedata->chaokeys = READUINT8(save.p);
|
||||
gamedata->usedkeys = READUINT8(save.p);
|
||||
gamedata->chaokeys = READUINT16(save.p);
|
||||
|
||||
gamedata->crashflags = READUINT8(save.p);
|
||||
if (gamedata->crashflags & GDCRASH_LAST)
|
||||
|
|
@ -4803,7 +4802,7 @@ void G_SaveGameData(boolean dirty)
|
|||
|
||||
length = (4+1+4+4+
|
||||
(4*GDGT_MAX)+
|
||||
4+1+1+1+1+
|
||||
4+1+1+2+
|
||||
1+1+1+1+
|
||||
4+
|
||||
(MAXEMBLEMS+(MAXUNLOCKABLES*2)+MAXCONDITIONSETS)+
|
||||
|
|
@ -4843,8 +4842,7 @@ void G_SaveGameData(boolean dirty)
|
|||
WRITEUINT32(save.p, gamedata->pendingkeyrounds); // 4
|
||||
WRITEUINT8(save.p, gamedata->pendingkeyroundoffset); // 1
|
||||
WRITEUINT8(save.p, gamedata->keyspending); // 1
|
||||
WRITEUINT8(save.p, gamedata->chaokeys); // 1
|
||||
WRITEUINT8(save.p, gamedata->usedkeys); // 1
|
||||
WRITEUINT16(save.p, gamedata->chaokeys); // 2
|
||||
|
||||
{
|
||||
UINT8 crashflags = (gamedata->crashflags & GDCRASH_ANY);
|
||||
|
|
|
|||
|
|
@ -5543,7 +5543,7 @@ challengedesc:
|
|||
V_DrawKartString((27+offs), 9-challengesmenu.unlockcount[CC_CHAOANIM], 0, va("%u", gamedata->chaokeys));
|
||||
|
||||
offs = challengekeybarwidth;
|
||||
if ((gamedata->chaokeys + gamedata->usedkeys) < GDMAX_CHAOKEYS)
|
||||
if (gamedata->chaokeys < GDMAX_CHAOKEYS)
|
||||
offs = ((gamedata->pendingkeyroundoffset * challengekeybarwidth)/GDCONVERT_ROUNDSTOKEY);
|
||||
|
||||
if (offs > 0)
|
||||
|
|
|
|||
|
|
@ -556,7 +556,6 @@ void M_ClearSecrets(void)
|
|||
gamedata->pendingkeyroundoffset = 0;
|
||||
gamedata->keyspending = 0;
|
||||
gamedata->chaokeys = 3; // Start with 3 !!
|
||||
gamedata->usedkeys = 0;
|
||||
}
|
||||
|
||||
// ----------------------
|
||||
|
|
@ -1566,11 +1565,11 @@ boolean M_UpdateUnlockablesAndExtraEmblems(boolean loud, boolean doall)
|
|||
response = M_CheckUnlockConditions(NULL);
|
||||
|
||||
if (gamedata->pendingkeyrounds == 0
|
||||
|| ((gamedata->chaokeys + gamedata->usedkeys) >= GDMAX_CHAOKEYS))
|
||||
|| (gamedata->chaokeys >= GDMAX_CHAOKEYS))
|
||||
{
|
||||
gamedata->keyspending = 0;
|
||||
}
|
||||
else while ((gamedata->keyspending + gamedata->chaokeys + gamedata->usedkeys) < GDMAX_CHAOKEYS
|
||||
else while ((gamedata->keyspending + gamedata->chaokeys) < GDMAX_CHAOKEYS
|
||||
&& ((gamedata->pendingkeyrounds + gamedata->pendingkeyroundoffset)/GDCONVERT_ROUNDSTOKEY) > gamedata->keyspending)
|
||||
{
|
||||
gamedata->keyspending++;
|
||||
|
|
|
|||
|
|
@ -221,9 +221,9 @@ typedef enum
|
|||
#define GDCRASH_ANY 0x02
|
||||
#define GDCRASH_LOSERCLUB 0x04
|
||||
|
||||
// This is the largest number of 9s that will fit in UINT32.
|
||||
// This is the largest number of 9s that will fit in UINT32 and UINT16 respectively.
|
||||
#define GDMAX_RINGS 999999999
|
||||
#define GDMAX_CHAOKEYS MAXUNLOCKABLES
|
||||
#define GDMAX_CHAOKEYS 9999
|
||||
|
||||
#ifdef DEVELOP
|
||||
#define GDCONVERT_ROUNDSTOKEY 20
|
||||
|
|
@ -275,8 +275,7 @@ struct gamedata_t
|
|||
UINT32 pendingkeyrounds;
|
||||
UINT8 pendingkeyroundoffset;
|
||||
UINT8 keyspending;
|
||||
UINT8 chaokeys;
|
||||
UINT8 usedkeys;
|
||||
UINT16 chaokeys;
|
||||
|
||||
// SPECIFIC SPECIAL EVENTS
|
||||
boolean everloadedaddon;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ static void M_ChallengesAutoFocus(UINT16 unlockid, boolean fresh)
|
|||
SINT8 work;
|
||||
|
||||
if (unlockid >= MAXUNLOCKABLES && gamedata->pendingkeyrounds > 0
|
||||
&& ((gamedata->chaokeys + gamedata->usedkeys) < GDMAX_CHAOKEYS))
|
||||
&& (gamedata->chaokeys < GDMAX_CHAOKEYS))
|
||||
challengesmenu.chaokeyadd = true;
|
||||
|
||||
if (fresh && unlockid >= MAXUNLOCKABLES)
|
||||
|
|
@ -258,7 +258,7 @@ menu_t *M_InterruptMenuWithChallenges(menu_t *desiredmenu)
|
|||
if (challengesmenu.pending)
|
||||
M_ChallengesAutoFocus(newunlock, true);
|
||||
else if (newunlock >= MAXUNLOCKABLES && gamedata->pendingkeyrounds > 0
|
||||
&& ((gamedata->chaokeys + gamedata->usedkeys) < GDMAX_CHAOKEYS))
|
||||
&& (gamedata->chaokeys < GDMAX_CHAOKEYS))
|
||||
challengesmenu.chaokeyadd = true;
|
||||
|
||||
return &MISC_ChallengesDef;
|
||||
|
|
@ -343,7 +343,7 @@ void M_ChallengesTick(void)
|
|||
challengesmenu.chaokeyadd = false;
|
||||
challengesmenu.requestnew = true;
|
||||
}
|
||||
else if ((gamedata->chaokeys + gamedata->usedkeys) >= GDMAX_CHAOKEYS)
|
||||
else if (gamedata->chaokeys >= GDMAX_CHAOKEYS)
|
||||
{
|
||||
// The above condition will run on the next tic because of this set
|
||||
gamedata->pendingkeyrounds = 0;
|
||||
|
|
@ -526,7 +526,6 @@ boolean M_ChallengesInputs(INT32 ch)
|
|||
&& gamedata->chaokeys > 0)
|
||||
{
|
||||
gamedata->chaokeys--;
|
||||
gamedata->usedkeys++;
|
||||
challengesmenu.unlockcount[CC_CHAOANIM]++;
|
||||
|
||||
S_StartSound(NULL, sfx_chchng);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue