SERVER: Add sv_tracedmgmultiplier

This commit is contained in:
Steam Deck User 2023-03-17 15:01:32 -04:00
parent 447342ed71
commit 618cda4e04
4 changed files with 35 additions and 3 deletions

View file

@ -65,6 +65,8 @@ float ach_tracker_barr;
float ach_tracker_spin;
float ach_tracker_luck;
float global_trace_damage_multiplier;
.float ads_release;
.vector oldvelocity;

View file

@ -34,6 +34,7 @@ void() SUB_Remove = {remove(self);}
void() main =
{
cheats_have_been_activated = false;
global_trace_damage_multiplier = 1;
}
float ai_delay_time;

View file

@ -161,6 +161,30 @@ float(string params) Command_noclip =
return COMMAND_SUCCESS;
}
//
// Command_tracedmgmultiplier()
// Multiplies damage output with weapons that fire Traces.
//
float(string params) Command_tracedmgmultiplier =
{
// Anti-Cheat in Co-Op.
if (coop && cheats_have_been_activated == false) {
bprint(PRINT_HIGH, "Someone tried to issue sv_tracedmgmultiplier in a Co-Op match. Nice try!\n");
return COMMAND_FAILURE;
}
// Grab parameters.
tokenize(params);
float value = stof(argv(0));
if (value <= 0) {
bprint(PRINT_HIGH, "Command_tracedmgmultiplier: 0 or less than 0 multiplier not allowed. Failing.\n");
return COMMAND_FAILURE;
}
global_trace_damage_multiplier = value;
return COMMAND_SUCCESS;
}
//
// Server command table
@ -181,7 +205,8 @@ var struct {
{"give", Command_give, true, "Usage: give <weapon number>\n Gives `weapon` of index.\n"},
{"qc_soft_restart", Command_softrestart, false, "Executes the Soft_Restart QuakeC function. Useful for debugging its functionality.\n"},
{"god", Command_godmode, false, "Toggles God Mode.\n"},
{"noclip", Command_noclip, false, "Toggles No Clip.\n"}
{"noclip", Command_noclip, false, "Toggles No Clip.\n"},
{"sv_tracedmgmultiplier", Command_tracedmgmultiplier, true, "Multiplies damage output with weapons that fire Traces.\n"}
};
//
@ -237,4 +262,4 @@ void(string command_string) SV_ParseClientCommand =
clientcommand(self, command_string);
#endif // FTE
};
};

View file

@ -1426,7 +1426,11 @@ void(float side) W_Fire =
}
//get some basic info
damage = getWeaponDamage(self.weapon);
damage = getWeaponDamage(self.weapon);
if (global_trace_damage_multiplier != 0)
damage *= global_trace_damage_multiplier;
firetype = GetFiretype (self.weapon);
if (side == S_RIGHT) {
modelname = GetWeaponModel(self.weapon, 0);