diff --git a/help_variables.json b/help_variables.json index 163e4f021..4d7c3cde5 100644 --- a/help_variables.json +++ b/help_variables.json @@ -1686,7 +1686,7 @@ "default": "1", "desc": "Enables/Disables strings-hud.\nStrings hud is not mqwcl hud. It gives you ability put any string (or value of some variable) on your hud.", "group-id": "40", - "remarks": "Strings hud banned for ruleset smackdown.", + "remarks": "Strings hud banned for ruleset smackdown and smackdrive.", "type": "boolean", "values": [ { @@ -2521,7 +2521,7 @@ "default": "20", "desc": "You can turn off the 'dodging' or 'rolling' effect for your own point of view while still see other player models affected by cl_rollangle.", "group-id": "53", - "remarks": "0 disables, 1 is standard. Disabled by ruleset smackdown.", + "remarks": "0 disables, 1 is standard. Disabled by ruleset smackdown and smackdrive.", "type": "integer" }, "cl_rollangle": { @@ -5142,7 +5142,7 @@ }, "gl_outline_scale_model": { "default": "1", - "desc": "Determines the scale of model outlines. Allows values 0 to 1 for rulesets smackdown and qcon, and 0 to 5 for other rulesets.", + "desc": "Determines the scale of model outlines. Allows values 0 to 1 for rulesets smackdown, smackdrive and qcon, and 0 to 5 for other rulesets.", "group-id": "35", "remarks": "Requires vid_renderer 1", "type": "float" @@ -16516,7 +16516,7 @@ "default": "1", "desc": "Adds transparency to the lightning gun beam (shaft).", "group-id": "8", - "remarks": "Disabled in ruleset smackdown.", + "remarks": "Disabled in ruleset smackdown and smackdrive.", "type": "float", "values": [ { @@ -16529,7 +16529,7 @@ "default": "0", "desc": "Shift start of the shaft lights.", "group-id": "8", - "remarks": "Doesn't work with smackdown ruleset. Intended for movies.", + "remarks": "Doesn't work with ruleset smackdown and smackdrive. Intended for movies.", "type": "float" }, "r_skincolormode": { diff --git a/src/menu_options.c b/src/menu_options.c index 4c9291d6d..af8512c4a 100644 --- a/src/menu_options.c +++ b/src/menu_options.c @@ -248,7 +248,7 @@ const char* s_desired_samples_enum[] = { }; const char* cl_nolerp_enum[] = {"on", "off"}; -const char* ruleset_enum[] = { "ezQuake default", "default", "Smackdown", "smackdown", "Thunderdome", "thunderdome", "Moscow TF League", "mtfl", "QuakeCon", "qcon" }; +const char* ruleset_enum[] = { "ezQuake default", "default", "Smackdown", "smackdown", "Thunderdome", "thunderdome", "Moscow TF League", "mtfl", "QuakeCon", "qcon", "Smackdrive", "smackdrive" }; const char *mediaroot_enum[] = { "relative to exe", "relative to home", "full path" }; const char *teamforceskins_enum[] = { "off", "use player's name", "use player's userid", "set t1, t2, t3, ..." }; const char *enemyforceskins_enum[] = { "off", "use player's name", "use player's userid", "set e1, e2, e3, ..." }; diff --git a/src/rulesets.c b/src/rulesets.c index 1a4c39b95..1cdf0f41f 100644 --- a/src/rulesets.c +++ b/src/rulesets.c @@ -57,7 +57,7 @@ qbool RuleSets_DisallowExternalTexture(struct model_s *mod) case MOD_EYES: return true; case MOD_BACKPACK: - return rulesetDef.ruleset == rs_smackdown || rulesetDef.ruleset == rs_qcon; + return rulesetDef.ruleset == rs_smackdown || rulesetDef.ruleset == rs_qcon || rulesetDef.ruleset == rs_smackdrive; default: return false; } @@ -74,7 +74,7 @@ qbool RuleSets_DisallowSimpleTexture(model_t* mod) case MOD_BACKPACK: // Now allowed in Thunderdome... - return rulesetDef.ruleset == rs_smackdown || rulesetDef.ruleset == rs_qcon; + return rulesetDef.ruleset == rs_smackdown || rulesetDef.ruleset == rs_qcon || rulesetDef.ruleset == rs_smackdrive; default: return false; // replacement always allowed @@ -94,10 +94,10 @@ qbool RuleSets_DisallowModelOutline(struct model_s *mod) case MOD_THUNDERBOLT: return true; case MOD_BACKPACK: - return !cls.demoplayback && (rulesetDef.ruleset == rs_qcon || rulesetDef.ruleset == rs_smackdown); + return !cls.demoplayback && (rulesetDef.ruleset == rs_qcon || rulesetDef.ruleset == rs_smackdown || rulesetDef.ruleset == rs_smackdrive); default: // return to just rs_qcon once backface outlining tested -// return !cls.demoplayback && (rulesetDef.ruleset == rs_qcon || rulesetDef.ruleset == rs_smackdown); +// return !cls.demoplayback && (rulesetDef.ruleset == rs_qcon || rulesetDef.ruleset == rs_smackdown || rulesetDef.ruleset == rs_smackdrive); return !cls.demoplayback && (rulesetDef.ruleset == rs_qcon); } } @@ -108,6 +108,7 @@ float RuleSets_ModelOutlineScale(void) { extern cvar_t gl_outline_scale_model; switch(rulesetDef.ruleset) { case rs_smackdown: + case rs_smackdrive: case rs_qcon: return bound(0.0f, gl_outline_scale_model.value, 1.0f); default: @@ -130,6 +131,7 @@ qbool Rulesets_AllowTimerefresh(void) { switch(rulesetDef.ruleset) { case rs_smackdown: + case rs_smackdrive: case rs_thunderdome: case rs_qcon: return (cl.standby || cl.spectator || cls.demoplayback); @@ -143,6 +145,7 @@ qbool Rulesets_AllowNoShadows(void) switch(rulesetDef.ruleset) { case rs_mtfl: case rs_smackdown: + case rs_smackdrive: case rs_thunderdome: case rs_qcon: return false; @@ -204,6 +207,7 @@ qbool Rulesets_RestrictTCL(void) { switch(rulesetDef.ruleset) { case rs_smackdown: + case rs_smackdrive: case rs_thunderdome: case rs_qcon: return true; @@ -224,6 +228,8 @@ const char *Rulesets_Ruleset(void) return "thunderdome"; case rs_qcon: return "qcon"; + case rs_smackdrive: + return "smackdrive"; default: return "default"; } @@ -459,6 +465,60 @@ static void Rulesets_MTFL(qbool enable) } } +static void Rulesets_Smackdrive(qbool enable) +{ + extern cvar_t cl_independentPhysics, cl_c2spps; + extern cvar_t cl_hud; + extern cvar_t cl_rollalpha; + extern cvar_t r_shiftbeam; + extern cvar_t allow_scripts; + extern cvar_t scr_allowsnap; + int i; + + locked_cvar_t disabled_cvars[] = { + {&allow_scripts, "0"}, // disable movement scripting + {&cl_hud, "0"}, // allows you place any text on the screen & filter incoming messages (hud strings) + {&cl_rollalpha, "20"}, // allows you to not dodge while seeing enemies dodging + {&r_shiftbeam, "0"}, // perphaps some people would think this allows you to aim better (maybe should be added for demo playback and spectating only) + {&scr_allowsnap, "1"} + }; + + if (enable) { + for (i = 0; i < (sizeof(disabled_cvars) / sizeof(disabled_cvars[0])); i++) { + Cvar_RulesetSet(disabled_cvars[i].var, disabled_cvars[i].value, 2); + Cvar_Set(disabled_cvars[i].var, disabled_cvars[i].value); + Cvar_SetFlags(disabled_cvars[i].var, Cvar_GetFlags(disabled_cvars[i].var) | CVAR_ROM); + } + + if (cl_independentPhysics.value) { + Cvar_Set(&cl_c2spps, "0"); // people were complaining that player move is jerky with this. however this has not much to do with independent physics, but people are too paranoid about it + Cvar_SetFlags(&cl_c2spps, Cvar_GetFlags(&cl_c2spps) | CVAR_ROM); + } + + rulesetDef.maxfps = 77; + rulesetDef.restrictTriggers = true; + rulesetDef.restrictPacket = true; // packet command could have been exploited for external timers + rulesetDef.restrictParticles = true; + rulesetDef.restrictLogging = true; + rulesetDef.restrictRollAngle = true; + rulesetDef.ruleset = rs_smackdrive; + } else { + for (i = 0; i < (sizeof(disabled_cvars) / sizeof(disabled_cvars[0])); i++) + Cvar_SetFlags(disabled_cvars[i].var, Cvar_GetFlags(disabled_cvars[i].var) & ~CVAR_ROM); + + if (cl_independentPhysics.value) + Cvar_SetFlags(&cl_c2spps, Cvar_GetFlags(&cl_c2spps) & ~CVAR_ROM); + + rulesetDef.maxfps = 72.0; + rulesetDef.restrictTriggers = false; + rulesetDef.restrictPacket = false; + rulesetDef.restrictParticles = false; + rulesetDef.restrictLogging = false; + rulesetDef.restrictRollAngle = false; + rulesetDef.ruleset = rs_default; + } +} + static void Rulesets_Default(void) { rulesetDef.ruleset = rs_default; @@ -670,6 +730,7 @@ static void Rulesets_OnChange_ruleset(cvar_t *var, char *value, qbool *cancel) strncasecmp(value, "thunderdome", sizeof("thunderdome")) && strncasecmp(value, "mtfl", sizeof("mtfl")) && strncasecmp(value, "qcon", sizeof("qcon")) && + strncasecmp(value, "smackdrive", sizeof("smackdrive")) && strncasecmp(value, "default", sizeof("default"))) { Com_Printf_State(PRINT_INFO, "Unknown ruleset \"%s\"\n", value); *cancel = true; @@ -690,6 +751,8 @@ static void Rulesets_OnChange_ruleset(cvar_t *var, char *value, qbool *cancel) case rs_thunderdome: Rulesets_Thunderdome(false); break; + case rs_smackdrive: + Rulesets_Smackdrive(false); case rs_default: break; default: @@ -711,6 +774,9 @@ static void Rulesets_OnChange_ruleset(cvar_t *var, char *value, qbool *cancel) } else if (!strncasecmp(value, "qcon", sizeof("qcon"))) { Rulesets_Qcon(true); Com_Printf_State(PRINT_OK, "Ruleset Qcon initialized\n"); + } else if (!strncasecmp(value, "smackdrive", sizeof("smackdrive"))) { + Rulesets_Smackdrive(true); + Com_Printf_State(PRINT_OK, "Ruleset Smackdrive initialized\n"); } else if (!strncasecmp(value, "default", sizeof("default"))) { Rulesets_Default(); Com_Printf_State(PRINT_OK, "Ruleset default initialized\n"); @@ -740,6 +806,7 @@ qbool Ruleset_BlockHudPicChange(void) switch (rulesetDef.ruleset) { case rs_qcon: case rs_smackdown: + case rs_smackdrive: case rs_thunderdome: return cls.state != ca_disconnected && !(cl.standby || cl.spectator || cls.demoplayback); default: diff --git a/src/rulesets.h b/src/rulesets.h index a09f56fb7..c8c53b91d 100644 --- a/src/rulesets.h +++ b/src/rulesets.h @@ -43,7 +43,8 @@ typedef enum { rs_smackdown, rs_thunderdome, rs_qcon, - rs_mtfl + rs_mtfl, + rs_smackdrive } ruleset_t; void Rulesets_Init(void);