Server: Add stubs for game-mode seperation

This commit is contained in:
Marco Cawthorne 2022-07-13 22:58:58 -07:00
parent 08383e1d90
commit eda8140127
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
9 changed files with 128 additions and 1 deletions

View File

@ -38,3 +38,68 @@ class HLGameRules:CGameRules
void(void) HLGameRules;
};
class SHTeamRules:HLGameRules
{
void(void) SHTeamRules;
virtual bool(void) IsTeamPlay;
};
/* Standard Hunting (0):
Round-based competitive killing where scientists are always running around. Scientists don't respawn.
*/
class SHGameHunt:SHTeamRules
{
void(void) SHGameHunt;
};
/* Stealth Hunting (1):
Round-based competitive killing where scientists stand or walk around, but will run in fear if they see the player. Scientists don't respawn. Similar to deer hunting.
*/
class SHGameStealth:SHTeamRules
{
void(void) SHGameStealth;
};
/* Traditional Slaughter (2):
Casual killing where scientists treat the player same as in Single Player. Scientists respawn. I suggest we just leave teams out on this one?
*/
class SHGameSlaughter:HLGameRules
{
void(void) SHGameSlaughter;
};
/* Live in Fear (3):
Unique round-based gamemode where players have to only kill an evil randomly selected player controlled scientist causing chaos. Those who kill good scientists are punished with lost points. The evil scientist gains one point from every kill (NPC or Players). Scientists respawn. This is the only gamemode where there are no teams.
*/
class SHGameFear:HLGameRules
{
void(void) SHGameFear;
};
/* Madness (4):
Unique gamemode where scientists attack themselves and the players. Scientists inject players and NPCs only once with a poison that slowly drains their health to 0. The scientists also play a sound (sh/hide_laugh.wav) when they get a sucessful kill and are still alive. Scientists respawn. We use to have something similar, still in the logic?
*/
class SHGameMadness:HLGameRules
{
void(void) SHGameMadness;
};
typedef enum
{
SHMODE_STANDARD = 0,
SHMODE_STEALTH,
SHMODE_SLAUGHTER,
SHMODE_LIVEINFEAR,
SHMODE_MADNESS
} shmode_e;
var shmode_e autocvar_sv_realistic = SHMODE_SLAUGHTER;

View File

@ -336,3 +336,16 @@ HLGameRules::HLGameRules(void)
{
CGameRules::CGameRules();
}
/* TEAMPLAY ONLY LOGIC */
bool
SHTeamRules::IsTeamPlay(void)
{
return true;
}
void
SHTeamRules::SHTeamRules(void)
{
}

View File

@ -0,0 +1,5 @@
void
SHGameFear::SHGameFear(void)
{
}

View File

@ -0,0 +1,5 @@
void
SHGameHunt::SHGameHunt(void)
{
}

View File

@ -0,0 +1,5 @@
void
SHGameMadness::SHGameMadness(void)
{
}

View File

@ -0,0 +1,5 @@
void
SHGameSlaughter::SHGameSlaughter(void)
{
}

View File

@ -0,0 +1,5 @@
void
SHGameStealth::SHGameStealth(void)
{
}

View File

@ -72,6 +72,12 @@ monster_scientist.qc
shdata_parse.qc
gamerules.qc
gamerules_fear.qc
gamerules_hunt.qc
gamerules_madness.qc
gamerules_slaughter.qc
gamerules_stealth.qc
../../../valve/src/server/client.qc
server.qc
../../../base/src/server/damage.qc

View File

@ -17,7 +17,25 @@
void
Game_InitRules(void)
{
g_grMode = spawn(HLGameRules);
switch (autocvar_sv_realistic) {
case SHMODE_STANDARD:
g_grMode = spawn(SHGameHunt);
break;
case SHMODE_STEALTH:
g_grMode = spawn(SHGameStealth);
break;
case SHMODE_SLAUGHTER:
g_grMode = spawn(SHGameSlaughter);
break;
case SHMODE_LIVEINFEAR:
g_grMode = spawn(SHGameFear);
break;
case SHMODE_MADNESS:
g_grMode = spawn(SHGameMadness);
break;
default:
g_grMode = spawn(HLGameRules);
}
}
void