mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
UC_REPLAY
Save a replay after finishing a round. Basically another tutorial unlock condition like UC_ADDON
This commit is contained in:
parent
dfe75726df
commit
fea235d8a7
5 changed files with 25 additions and 1 deletions
|
|
@ -2520,6 +2520,7 @@ static void readcondition(UINT8 set, UINT32 id, char *word2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((offset=0) || fastcmp(params[0], "ADDON")
|
else if ((offset=0) || fastcmp(params[0], "ADDON")
|
||||||
|
|| (++offset && fastcmp(params[0], "REPLAY"))
|
||||||
|| (++offset && fastcmp(params[0], "CRASH")))
|
|| (++offset && fastcmp(params[0], "CRASH")))
|
||||||
{
|
{
|
||||||
//PARAMCHECK(1);
|
//PARAMCHECK(1);
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
#include "g_game.h"
|
#include "g_game.h"
|
||||||
#include "g_demo.h"
|
#include "g_demo.h"
|
||||||
#include "m_misc.h"
|
#include "m_misc.h"
|
||||||
|
#include "m_cond.h"
|
||||||
#include "k_menu.h"
|
#include "k_menu.h"
|
||||||
#include "m_argv.h"
|
#include "m_argv.h"
|
||||||
#include "hu_stuff.h"
|
#include "hu_stuff.h"
|
||||||
|
|
@ -4188,7 +4189,15 @@ void G_SaveDemo(void)
|
||||||
if (!modeattacking)
|
if (!modeattacking)
|
||||||
{
|
{
|
||||||
if (demo.savemode == DSM_SAVED)
|
if (demo.savemode == DSM_SAVED)
|
||||||
|
{
|
||||||
CONS_Printf(M_GetText("Demo %s recorded\n"), demoname);
|
CONS_Printf(M_GetText("Demo %s recorded\n"), demoname);
|
||||||
|
if (gamedata->eversavedreplay == false)
|
||||||
|
{
|
||||||
|
gamedata->eversavedreplay = true;
|
||||||
|
M_UpdateUnlockablesAndExtraEmblems(true);
|
||||||
|
G_SaveGameData(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Demo %s not saved\n"), demoname);
|
CONS_Alert(CONS_WARNING, M_GetText("Demo %s not saved\n"), demoname);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4582,6 +4582,7 @@ void G_LoadGameData(void)
|
||||||
gamedata->crashflags |= GDCRASH_ANY;
|
gamedata->crashflags |= GDCRASH_ANY;
|
||||||
|
|
||||||
gamedata->everloadedaddon = (boolean)READUINT8(save.p);
|
gamedata->everloadedaddon = (boolean)READUINT8(save.p);
|
||||||
|
gamedata->eversavedreplay = (boolean)READUINT8(save.p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -4795,7 +4796,7 @@ void G_SaveGameData(boolean dirty)
|
||||||
length = (4+1+4+4+
|
length = (4+1+4+4+
|
||||||
(4*GDGT_MAX)+
|
(4*GDGT_MAX)+
|
||||||
4+1+1+1+1+
|
4+1+1+1+1+
|
||||||
1+1+4+
|
1+1+1+4+
|
||||||
(MAXEMBLEMS+(MAXUNLOCKABLES*2)+MAXCONDITIONSETS)+
|
(MAXEMBLEMS+(MAXUNLOCKABLES*2)+MAXCONDITIONSETS)+
|
||||||
4+2);
|
4+2);
|
||||||
|
|
||||||
|
|
@ -4844,6 +4845,7 @@ void G_SaveGameData(boolean dirty)
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITEUINT8(save.p, gamedata->everloadedaddon); // 1
|
WRITEUINT8(save.p, gamedata->everloadedaddon); // 1
|
||||||
|
WRITEUINT8(save.p, gamedata->eversavedreplay); // 1
|
||||||
|
|
||||||
WRITEUINT32(save.p, quickncasehash(timeattackfolder, 64));
|
WRITEUINT32(save.p, quickncasehash(timeattackfolder, 64));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -526,6 +526,7 @@ void M_ClearStats(void)
|
||||||
gamedata->timesBeaten = 0;
|
gamedata->timesBeaten = 0;
|
||||||
|
|
||||||
gamedata->everloadedaddon = false;
|
gamedata->everloadedaddon = false;
|
||||||
|
gamedata->eversavedreplay = false;
|
||||||
gamedata->crashflags = 0;
|
gamedata->crashflags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -721,6 +722,8 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
|
||||||
M_SecretUnlocked(SECRET_ADDONS, true) &&
|
M_SecretUnlocked(SECRET_ADDONS, true) &&
|
||||||
#endif
|
#endif
|
||||||
(gamedata->everloadedaddon == true));
|
(gamedata->everloadedaddon == true));
|
||||||
|
case UC_REPLAY:
|
||||||
|
return (gamedata->eversavedreplay == true);
|
||||||
case UC_CRASH:
|
case UC_CRASH:
|
||||||
if (gamedata->crashflags & (GDCRASH_LAST|GDCRASH_ANY))
|
if (gamedata->crashflags & (GDCRASH_LAST|GDCRASH_ANY))
|
||||||
{
|
{
|
||||||
|
|
@ -1109,6 +1112,8 @@ static const char *M_GetConditionString(condition_t *cn)
|
||||||
if (!M_SecretUnlocked(SECRET_ADDONS, true) && !gamedata->everloadedaddon)
|
if (!M_SecretUnlocked(SECRET_ADDONS, true) && !gamedata->everloadedaddon)
|
||||||
return NULL;
|
return NULL;
|
||||||
return "load a custom addon into \"Dr. Robotnik's Ring Racers\"";
|
return "load a custom addon into \"Dr. Robotnik's Ring Racers\"";
|
||||||
|
case UC_REPLAY:
|
||||||
|
return "save a replay after finishing a round";
|
||||||
case UC_CRASH:
|
case UC_CRASH:
|
||||||
if (gamedata->crashflags & (GDCRASH_LAST|GDCRASH_ANY))
|
if (gamedata->crashflags & (GDCRASH_LAST|GDCRASH_ANY))
|
||||||
return "launch \"Dr. Robotnik's Ring Racers\" again after a game crash";
|
return "launch \"Dr. Robotnik's Ring Racers\" again after a game crash";
|
||||||
|
|
|
||||||
|
|
@ -31,20 +31,26 @@ typedef enum
|
||||||
UC_PLAYTIME, // PLAYTIME [tics]
|
UC_PLAYTIME, // PLAYTIME [tics]
|
||||||
UC_ROUNDSPLAYED, // ROUNDSPLAYED [x played]
|
UC_ROUNDSPLAYED, // ROUNDSPLAYED [x played]
|
||||||
UC_TOTALRINGS, // TOTALRINGS [x collected]
|
UC_TOTALRINGS, // TOTALRINGS [x collected]
|
||||||
|
|
||||||
UC_POWERLEVEL, // SRB2Kart: POWERLEVEL [power level to reach] [gametype, "0" for race, "1" for battle]
|
UC_POWERLEVEL, // SRB2Kart: POWERLEVEL [power level to reach] [gametype, "0" for race, "1" for battle]
|
||||||
|
|
||||||
UC_GAMECLEAR, // GAMECLEAR <x times>
|
UC_GAMECLEAR, // GAMECLEAR <x times>
|
||||||
UC_OVERALLTIME, // OVERALLTIME [time to beat, tics]
|
UC_OVERALLTIME, // OVERALLTIME [time to beat, tics]
|
||||||
|
|
||||||
UC_MAPVISITED, // MAPVISITED [map]
|
UC_MAPVISITED, // MAPVISITED [map]
|
||||||
UC_MAPBEATEN, // MAPBEATEN [map]
|
UC_MAPBEATEN, // MAPBEATEN [map]
|
||||||
UC_MAPENCORE, // MAPENCORE [map]
|
UC_MAPENCORE, // MAPENCORE [map]
|
||||||
UC_MAPSPBATTACK, // MAPSPBATTACK [map]
|
UC_MAPSPBATTACK, // MAPSPBATTACK [map]
|
||||||
UC_MAPTIME, // MAPTIME [map] [time to beat, tics]
|
UC_MAPTIME, // MAPTIME [map] [time to beat, tics]
|
||||||
|
|
||||||
UC_TOTALMEDALS, // TOTALMEDALS [number of emblems]
|
UC_TOTALMEDALS, // TOTALMEDALS [number of emblems]
|
||||||
UC_EMBLEM, // EMBLEM [emblem number]
|
UC_EMBLEM, // EMBLEM [emblem number]
|
||||||
|
|
||||||
UC_UNLOCKABLE, // UNLOCKABLE [unlockable number]
|
UC_UNLOCKABLE, // UNLOCKABLE [unlockable number]
|
||||||
UC_CONDITIONSET, // CONDITIONSET [condition set number]
|
UC_CONDITIONSET, // CONDITIONSET [condition set number]
|
||||||
|
|
||||||
UC_ADDON, // Ever loaded a custom file?
|
UC_ADDON, // Ever loaded a custom file?
|
||||||
|
UC_REPLAY, // Save a replay
|
||||||
UC_CRASH, // Hee ho !
|
UC_CRASH, // Hee ho !
|
||||||
|
|
||||||
// Just for string building
|
// Just for string building
|
||||||
|
|
@ -263,6 +269,7 @@ struct gamedata_t
|
||||||
|
|
||||||
// SPECIFIC SPECIAL EVENTS
|
// SPECIFIC SPECIAL EVENTS
|
||||||
boolean everloadedaddon;
|
boolean everloadedaddon;
|
||||||
|
boolean eversavedreplay;
|
||||||
UINT8 crashflags;
|
UINT8 crashflags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue