Rename sv_realistic back to sh_realistic for compat, and create an alias to sv_gamemode

Some clean up to the mess I left in gamerules.h by accident
Preview of a new gamemode, Invasion
This commit is contained in:
Xylemon 2023-04-24 04:02:49 -07:00
parent 0156cc4f28
commit d1ad61a2f5
3 changed files with 24 additions and 11 deletions

View file

@ -56,14 +56,16 @@ class SHTeamRules:HLGameRules
virtual bool(void) IsTeamplay;
virtual void(void) AddTeam1Kill;
virtual void(void) AddTeam2Kill;
virtual void(void) RemoveTeam1Kill;
virtual void(void) RemoveTeam2Kill;
virtual void(void) RegisterSciDeathHuntTeam;
virtual void(void) RegisterSciDeath;
virtual void(NSClientPlayer, entity) ScientistKill;
virtual void(NSClientPlayer, entity) ScientistKillFear;
virtual void(void) InitPostEnts;
};
class SHRules:HLGameRules
{
virtual void(void) RegisterSciDeath;
};
/* Standard Hunting (0):
Round-based competitive killing where scientists are always running around. Scientists don't respawn.
*/
@ -73,7 +75,7 @@ class SHGameHunt:SHTeamRules
};
/* 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.
Round-based competitive killing where scientists stand or walk around, but will run in fear if they see the player. Similar to deer hunting. Scientists don't respawn.
*/
class SHGameStealth:SHTeamRules
{
@ -81,7 +83,7 @@ class SHGameStealth:SHTeamRules
};
/* 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?
Casual killing where scientists behave the same as they were in Half-Life. Scientists respawn.
*/
class SHGameSlaughter:HLGameRules
{
@ -101,18 +103,26 @@ class SHGameFear:HLGameRules
*/
class SHGameMadness:HLGameRules
{
void(void) SHGameMadness;
};
/* Invasion (5):
Unique new round-based gamemode where scientists attack similar to madness but work together to kill everyone else. If players eleminate all scientists, then they win the round and have to do it all over again. Heavy WIP. Scientists and players don't respawn.
*/
class SHGameInvasion:SHRules
{
void(void) SHGameInvasion;
};
typedef enum
{
SHMODE_STANDARD = 0,
SHMODE_STEALTH,
SHMODE_SLAUGHTER,
SHMODE_LIVEINFEAR,
SHMODE_MADNESS
SHMODE_MADNESS,
SHMODE_INVASION
} shmode_e;
var shmode_e autocvar_sv_realistic = SHMODE_SLAUGHTER;
var shmode_e autocvar_sh_realistic = SHMODE_SLAUGHTER;
var shmode_e g_chosen_mode;

View file

@ -17,9 +17,9 @@
void
Game_InitRules(void)
{
g_chosen_mode = autocvar_sv_realistic;
g_chosen_mode = autocvar_sh_realistic;
switch (autocvar_sv_realistic) {
switch (autocvar_sh_realistic) {
case SHMODE_STANDARD:
g_grMode = spawn(SHGameHunt);
break;

View file

@ -55,3 +55,6 @@ alias mp_fraglimit fraglimit
seta gl_overbright 0
seta gl_ldr 1
seta r_lightmap_format rgb8
// keep compat with old cvar
alias sv_gamemode "sh_realistic $*" // sets the gamemode for Scientist Hunt; 0 - Standard Hunting, 1 - Stealth Hunting, 2 - Traditional Slaughter, 3 - Live in Fear, 4 - Madness,