Ringslinger tweaks
This commit is contained in:
parent
eadb3dec9e
commit
396106829a
|
@ -3696,7 +3696,7 @@ void ItemFinder_OnChange(void)
|
||||||
static void PointLimit_OnChange(void)
|
static void PointLimit_OnChange(void)
|
||||||
{
|
{
|
||||||
// Don't allow pointlimit in Single Player/Co-Op/Race!
|
// Don't allow pointlimit in Single Player/Co-Op/Race!
|
||||||
if (server && Playing() && G_PlatformGametype())
|
if (server && Playing() && !(gametyperules & GTR_POINTLIMIT))
|
||||||
{
|
{
|
||||||
if (cv_pointlimit.value)
|
if (cv_pointlimit.value)
|
||||||
CV_StealthSetValue(&cv_pointlimit, 0);
|
CV_StealthSetValue(&cv_pointlimit, 0);
|
||||||
|
@ -3859,7 +3859,7 @@ UINT32 timelimitintics = 0;
|
||||||
static void TimeLimit_OnChange(void)
|
static void TimeLimit_OnChange(void)
|
||||||
{
|
{
|
||||||
// Don't allow timelimit in Single Player/Co-Op/Race!
|
// Don't allow timelimit in Single Player/Co-Op/Race!
|
||||||
if (server && Playing() && cv_timelimit.value != 0 && G_PlatformGametype())
|
if (server && Playing() && cv_timelimit.value != 0 && !(gametyperules & GTR_TIMELIMIT))
|
||||||
{
|
{
|
||||||
CV_SetValue(&cv_timelimit, 0);
|
CV_SetValue(&cv_timelimit, 0);
|
||||||
return;
|
return;
|
||||||
|
@ -3964,7 +3964,7 @@ void D_GameTypeChanged(INT32 lastgametype)
|
||||||
// reset timelimit and pointlimit in race/coop, prevent stupid cheats
|
// reset timelimit and pointlimit in race/coop, prevent stupid cheats
|
||||||
if (server)
|
if (server)
|
||||||
{
|
{
|
||||||
if (G_PlatformGametype())
|
if (!(gametyperules & GTR_POINTLIMIT))
|
||||||
{
|
{
|
||||||
if (cv_timelimit.value)
|
if (cv_timelimit.value)
|
||||||
CV_SetValue(&cv_timelimit, 0);
|
CV_SetValue(&cv_timelimit, 0);
|
||||||
|
|
|
@ -8894,7 +8894,7 @@ static const char *const GAMETYPERULE_LIST[] = {
|
||||||
"LIVES",
|
"LIVES",
|
||||||
"RACE",
|
"RACE",
|
||||||
"CHASECAM",
|
"CHASECAM",
|
||||||
"TIMELIMIT",
|
"\x01", // 1<<8, empty
|
||||||
"HIDETIME",
|
"HIDETIME",
|
||||||
"HIDETIMEFROZEN",
|
"HIDETIMEFROZEN",
|
||||||
"BLINDFOLDED",
|
"BLINDFOLDED",
|
||||||
|
@ -8908,6 +8908,9 @@ static const char *const GAMETYPERULE_LIST[] = {
|
||||||
"ALLOWEXIT",
|
"ALLOWEXIT",
|
||||||
"ROUNDENDMESSAGE",
|
"ROUNDENDMESSAGE",
|
||||||
"NOTITLECARD",
|
"NOTITLECARD",
|
||||||
|
"POINTLIMIT",
|
||||||
|
"TIMELIMIT",
|
||||||
|
"OVERTIME",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -402,7 +402,7 @@ enum GameTypeRules
|
||||||
// flexibility! Those will replace some straight-up gametype checks scattered around the source code!
|
// flexibility! Those will replace some straight-up gametype checks scattered around the source code!
|
||||||
|
|
||||||
GTR_CHASECAM = 1<<7, // Prefer chasecam at map load (All platform gametypes)
|
GTR_CHASECAM = 1<<7, // Prefer chasecam at map load (All platform gametypes)
|
||||||
GTR_TIMELIMIT = 1<<8, // Ringslinger time limit (Tag and Hide and Seek)
|
// 1<<8, empty
|
||||||
GTR_HIDETIME = 1<<9, // Tag and Hide and Seek
|
GTR_HIDETIME = 1<<9, // Tag and Hide and Seek
|
||||||
GTR_HIDETIMEFROZEN = 1<<10, // Hide and Seek, but not Tag
|
GTR_HIDETIMEFROZEN = 1<<10, // Hide and Seek, but not Tag
|
||||||
GTR_BLINDFOLDED = 1<<11, // Blindfolded view (Tag and Hide and Seek)
|
GTR_BLINDFOLDED = 1<<11, // Blindfolded view (Tag and Hide and Seek)
|
||||||
|
@ -416,6 +416,9 @@ enum GameTypeRules
|
||||||
GTR_ALLOWEXIT = 1<<19, // Allow exit sectors
|
GTR_ALLOWEXIT = 1<<19, // Allow exit sectors
|
||||||
GTR_ROUNDENDMESSAGE = 1<<20, // Prints "The round has ended." into the console
|
GTR_ROUNDENDMESSAGE = 1<<20, // Prints "The round has ended." into the console
|
||||||
GTR_NOTITLECARD = 1<<21, // Don't show the title card
|
GTR_NOTITLECARD = 1<<21, // Don't show the title card
|
||||||
|
GTR_POINTLIMIT = 1<<22, // Ringslinger point limit
|
||||||
|
GTR_TIMELIMIT = 1<<23, // Ringslinger time limit
|
||||||
|
GTR_OVERTIME = 1<<24, // Allow overtime
|
||||||
};
|
};
|
||||||
|
|
||||||
// String names for gametypes
|
// String names for gametypes
|
||||||
|
|
10
src/g_game.c
10
src/g_game.c
|
@ -3085,17 +3085,17 @@ UINT32 gametypedefaultrules[NUMGAMETYPES] =
|
||||||
GTR_PLATFORM|GTR_RACE|GTR_CHASECAM|GTR_SPAWNENEMIES|GTR_ALLOWEXIT|GTR_ROUNDENDMESSAGE,
|
GTR_PLATFORM|GTR_RACE|GTR_CHASECAM|GTR_SPAWNENEMIES|GTR_ALLOWEXIT|GTR_ROUNDENDMESSAGE,
|
||||||
|
|
||||||
// Match
|
// Match
|
||||||
GTR_RINGSLINGER|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_EMERALDS|GTR_PITYSHIELD|GTR_DEATHPENALTY|GTR_ROUNDENDMESSAGE,
|
GTR_RINGSLINGER|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_EMERALDS|GTR_PITYSHIELD|GTR_DEATHPENALTY|GTR_ROUNDENDMESSAGE,
|
||||||
// Team Match
|
// Team Match
|
||||||
GTR_RINGSLINGER|GTR_TEAMS|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_PITYSHIELD|GTR_ROUNDENDMESSAGE,
|
GTR_RINGSLINGER|GTR_TEAMS|GTR_POINTLIMIT|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_PITYSHIELD|GTR_ROUNDENDMESSAGE,
|
||||||
|
|
||||||
// Tag
|
// Tag
|
||||||
GTR_RINGSLINGER|GTR_TAG|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_HIDETIME|GTR_BLINDFOLDED|GTR_ROUNDENDMESSAGE,
|
GTR_RINGSLINGER|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_HIDETIME|GTR_BLINDFOLDED|GTR_ROUNDENDMESSAGE,
|
||||||
// Hide and Seek
|
// Hide and Seek
|
||||||
GTR_RINGSLINGER|GTR_TAG|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_HIDETIME|GTR_BLINDFOLDED|GTR_ROUNDENDMESSAGE,
|
GTR_RINGSLINGER|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT||GTR_TIMELIMIT|GTR_HIDETIME|GTR_BLINDFOLDED|GTR_ROUNDENDMESSAGE,
|
||||||
|
|
||||||
// CTF
|
// CTF
|
||||||
GTR_RINGSLINGER|GTR_TEAMS|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_EMERALDS|GTR_TEAMFLAGS|GTR_PITYSHIELD|GTR_ROUNDENDMESSAGE,
|
GTR_RINGSLINGER|GTR_TEAMS|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_EMERALDS|GTR_TEAMFLAGS|GTR_PITYSHIELD|GTR_ROUNDENDMESSAGE,
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -3026,7 +3026,7 @@ static void HU_DrawRankings(void)
|
||||||
// draw the current gametype in the lower right
|
// draw the current gametype in the lower right
|
||||||
HU_drawGametype();
|
HU_drawGametype();
|
||||||
|
|
||||||
if (!G_PlatformGametype())
|
if (gametyperules & GTR_POINTLIMIT)
|
||||||
{
|
{
|
||||||
if (cv_timelimit.value && timelimitintics > 0)
|
if (cv_timelimit.value && timelimitintics > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2093,7 +2093,7 @@ void P_CheckTimeLimit(void)
|
||||||
if (!(multiplayer || netgame))
|
if (!(multiplayer || netgame))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (G_PlatformGametype())
|
if (!(gametyperules & GTR_TIMELIMIT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (leveltime < timelimitintics)
|
if (leveltime < timelimitintics)
|
||||||
|
@ -2124,7 +2124,7 @@ void P_CheckTimeLimit(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Optional tie-breaker for Match/CTF
|
//Optional tie-breaker for Match/CTF
|
||||||
else if (cv_overtime.value)
|
else if ((cv_overtime.value) && (gametyperules & GTR_OVERTIME))
|
||||||
{
|
{
|
||||||
INT32 playerarray[MAXPLAYERS];
|
INT32 playerarray[MAXPLAYERS];
|
||||||
INT32 tempplayer = 0;
|
INT32 tempplayer = 0;
|
||||||
|
@ -2206,7 +2206,7 @@ void P_CheckPointLimit(void)
|
||||||
if (!(multiplayer || netgame))
|
if (!(multiplayer || netgame))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (G_PlatformGametype())
|
if (!(gametyperules & GTR_POINTLIMIT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// pointlimit is nonzero, check if it's been reached by this player
|
// pointlimit is nonzero, check if it's been reached by this player
|
||||||
|
|
|
@ -2638,7 +2638,7 @@ static void ST_overlayDrawer(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If you are in overtime, put a big honkin' flashin' message on the screen.
|
// If you are in overtime, put a big honkin' flashin' message on the screen.
|
||||||
if (G_RingSlingerGametype() && cv_overtime.value
|
if (((gametyperules & GTR_TIMELIMIT) && (gametyperules & GTR_OVERTIME)) && cv_overtime.value
|
||||||
&& (leveltime > (timelimitintics + TICRATE/2)) && cv_timelimit.value && (leveltime/TICRATE % 2 == 0))
|
&& (leveltime > (timelimitintics + TICRATE/2)) && cv_timelimit.value && (leveltime/TICRATE % 2 == 0))
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, 184, V_PERPLAYER, M_GetText("OVERTIME!"));
|
V_DrawCenteredString(BASEVIDWIDTH/2, 184, V_PERPLAYER, M_GetText("OVERTIME!"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue