Organise rules

This commit is contained in:
Jaime Passos 2019-12-19 16:12:10 -03:00
parent 6d7262e985
commit f4bb618f93
4 changed files with 39 additions and 46 deletions

View File

@ -8857,19 +8857,21 @@ static const char *const PLAYERFLAG_LIST[] = {
};
static const char *const GAMETYPERULE_LIST[] = {
"\x01",
"TAG",
"CAMPAIGN",
"RINGSLINGER",
"SPECTATORS",
"TEAMS",
"LIVES",
"RACE",
"CHASECAM",
"FRIENDLYFIRE",
"LIVES",
"TEAMS",
"RACE",
"TAG",
"POINTLIMIT",
"TIMELIMIT",
"HIDETIME",
"HIDEFROZEN",
"BLINDFOLDED",
"EMERALDS",
"CHASECAM",
"MATCHEMERALDS",
"TEAMFLAGS",
"PITYSHIELD",
"DEATHPENALTY",
@ -8880,11 +8882,8 @@ static const char *const GAMETYPERULE_LIST[] = {
"EMERALDHUNT",
"SPAWNENEMIES",
"ALLOWEXIT",
"CAMPAIGN",
"NOGAMEEND",
"NOTITLECARD",
"POINTLIMIT",
"TIMELIMIT",
"OVERTIME",
NULL
};

View File

@ -389,40 +389,34 @@ enum GameType
// Game type rules
enum GameTypeRules
{
GTR_SORRYNOTHING = 1,
GTR_TAG = 1<<1, // Tag and Hide and Seek
GTR_RINGSLINGER = 1<<2, // Not Co-op, not Competition, and not Race (overriden by cv_ringslinger)
GTR_SPECTATORS = 1<<3, // Not Co-op, not Competition, and not Race
GTR_TEAMS = 1<<4, // Team Match, CTF
GTR_LIVES = 1<<5, // A lot of special cases in G_GametypeUsesLives actually, but just Co-op and Competition
GTR_CAMPAIGN = 1, // Linear Co-op map progression. Don't allow random maps.
GTR_RINGSLINGER = 1<<1, // Outside of Co-op, Competition, and Race (overriden by cv_ringslinger)
GTR_SPECTATORS = 1<<2, // Outside of Co-op, Competition, and Race
GTR_FRIENDLYFIRE = 1<<3, // Always allow friendly fire
GTR_LIVES = 1<<4, // Co-op and Competition
GTR_TEAMS = 1<<5, // Team Match, CTF
GTR_RACE = 1<<6, // Race and Competition
// Lactozilla
// Awesome! Those are new game type rules provided by yours truly to allow for more
// 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_FRIENDLYFIRE = 1<<8, // Always allow friendly fire
GTR_HIDETIME = 1<<9, // Hide time (Tag and Hide and Seek)
GTR_HIDEFROZEN = 1<<10, // Frozen after hide time (Hide and Seek, but not Tag)
GTR_BLINDFOLDED = 1<<11, // Blindfolded view (Tag and Hide and Seek)
GTR_EMERALDS = 1<<12, // Ringslinger emeralds (Match and CTF)
GTR_TEAMFLAGS = 1<<13, // Gametype has team flags (CTF)
GTR_PITYSHIELD = 1<<14, // Award pity shield
GTR_DEATHPENALTY = 1<<15, // Death score penalty
GTR_NOSPECTATORSPAWN = 1<<16, // For use with GTR_SPECTATORS - spawn in the map instead of with the spectators
GTR_DEATHMATCHSTARTS = 1<<17, // Use deathmatch starts
GTR_SPECIALSTAGES = 1<<18, // Allow special stages
GTR_EMERALDTOKENS = 1<<19, // Spawn emerald tokens
GTR_EMERALDHUNT = 1<<20, // Emerald Hunt
GTR_SPAWNENEMIES = 1<<21, // Spawn enemies
GTR_ALLOWEXIT = 1<<22, // Allow exit sectors
GTR_CAMPAIGN = 1<<23, // Linear Co-op map progression. Don't allow random maps.
GTR_NOGAMEEND = 1<<24, // Don't end the game. That is, wrap around the maps instead of starting the ending.
GTR_NOTITLECARD = 1<<25, // Don't show the title card
GTR_POINTLIMIT = 1<<26, // Ringslinger point limit
GTR_TIMELIMIT = 1<<27, // Ringslinger time limit
GTR_OVERTIME = 1<<28, // Allow overtime
GTR_TAG = 1<<7, // Tag and Hide and Seek
GTR_POINTLIMIT = 1<<8, // Ringslinger point limit
GTR_TIMELIMIT = 1<<9, // Ringslinger time limit
GTR_HIDETIME = 1<<10, // Hide time (Tag and Hide and Seek)
GTR_HIDEFROZEN = 1<<11, // Frozen after hide time (Hide and Seek, but not Tag)
GTR_BLINDFOLDED = 1<<12, // Blindfolded view (Tag and Hide and Seek)
GTR_CHASECAM = 1<<13, // Prefer chasecam at map load (All platform gametypes)
GTR_MATCHEMERALDS = 1<<14, // Ringslinger emeralds (Match and CTF)
GTR_TEAMFLAGS = 1<<15, // Gametype has team flags (CTF)
GTR_PITYSHIELD = 1<<16, // Award pity shield
GTR_DEATHPENALTY = 1<<17, // Death score penalty
GTR_NOSPECTATORSPAWN = 1<<18, // For use with GTR_SPECTATORS - spawn in the map instead of with the spectators
GTR_DEATHMATCHSTARTS = 1<<19, // Use deathmatch starts
GTR_SPECIALSTAGES = 1<<20, // Allow special stages
GTR_EMERALDTOKENS = 1<<21, // Spawn emerald tokens
GTR_EMERALDHUNT = 1<<22, // Emerald Hunt
GTR_SPAWNENEMIES = 1<<23, // Spawn enemies
GTR_ALLOWEXIT = 1<<24, // Allow exit sectors
GTR_NOGAMEEND = 1<<25, // Don't end the game. That is, wrap around the maps instead of starting the ending.
GTR_NOTITLECARD = 1<<26, // Don't show the title card
GTR_OVERTIME = 1<<27, // Allow overtime
};
// String names for gametypes

View File

@ -3095,7 +3095,7 @@ UINT32 gametypedefaultrules[NUMGAMETYPES] =
GTR_RACE|GTR_CHASECAM|GTR_SPAWNENEMIES|GTR_ALLOWEXIT|GTR_NOGAMEEND,
// Match
GTR_RINGSLINGER|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_EMERALDS|GTR_PITYSHIELD|GTR_DEATHPENALTY,
GTR_RINGSLINGER|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_MATCHEMERALDS|GTR_PITYSHIELD|GTR_DEATHPENALTY,
// Team Match
GTR_RINGSLINGER|GTR_SPECTATORS|GTR_TEAMS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_PITYSHIELD,
@ -3105,7 +3105,7 @@ UINT32 gametypedefaultrules[NUMGAMETYPES] =
GTR_RINGSLINGER|GTR_TAG|GTR_SPECTATORS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_HIDETIME|GTR_BLINDFOLDED,
// CTF
GTR_RINGSLINGER|GTR_SPECTATORS|GTR_TEAMS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_EMERALDS|GTR_TEAMFLAGS|GTR_PITYSHIELD,
GTR_RINGSLINGER|GTR_SPECTATORS|GTR_TEAMS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_MATCHEMERALDS|GTR_TEAMFLAGS|GTR_PITYSHIELD,
};
//

View File

@ -11774,7 +11774,7 @@ You should think about modifying the deathmatch starts to take full advantage of
if (!cv_powerstones.value)
return;
if (!(gametyperules & GTR_EMERALDS))
if (!(gametyperules & GTR_MATCHEMERALDS))
return;
runemeraldmanager = true;