func_escapezone: balance tweak via new cvar fcs_escapepenalty. Suggested by Xylemon

This commit is contained in:
Marco Cawthorne 2023-03-01 23:07:02 -08:00
parent f74e44ef4e
commit 2d51a765b7
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
2 changed files with 16 additions and 1 deletions

View File

@ -67,6 +67,7 @@ var string autocvar_motdfile = "motd.txt";
var int autocvar_mp_friendlyfire = FALSE;
/* new, FreeCS exclusive variables */
var int autocvar_fcs_escapepenalty = -300;
var int autocvar_fcs_swaponround = 0;
var int autocvar_fcs_voxannounce = FALSE;
var int autocvar_fcs_knifeonly = FALSE; /* Disallows buying and spawning with weps */

View File

@ -52,7 +52,10 @@ void
func_escapezone::Touch(entity eToucher)
{
CSMultiplayerRules rule = (CSMultiplayerRules)g_grMode;
int to_escape = g_cs_total_t;
int to_escape = 0;
rule.CountPlayers();
to_escape = g_cs_total_t;
/* only 3 Ts need to escape, max */
if (to_escape > 3)
@ -72,6 +75,17 @@ func_escapezone::Touch(entity eToucher)
rule.m_iEscapedTerrorists++;
/* balancing tweak: for every escaped T, each and every CT will lose funds */
if (autocvar_fcs_escapepenalty != 0) {
for (entity eFind = world; (eFind = find(eFind, ::classname, "player"));) {
player ct = (player)eFind;
if (ct.team == TEAM_CT) {
Money_AddMoney(ct, autocvar_fcs_escapepenalty);
}
}
}
/* mark player as spectator for the end of this 'round' */
pl.MakeTempSpectator();