Gamerules: Fix kill rewards or something. Add cvar fcs_penalty_teamkill.

This commit is contained in:
Marco Cawthorne 2022-04-28 10:52:13 -07:00
parent 4f589848bf
commit 20b960761e
Signed by: eukara
GPG key ID: C196CD8BA993248A
4 changed files with 15 additions and 8 deletions

View file

@ -1,2 +1,3 @@
void Ammo_BuyPrimary(base_player pl, int free);
void Ammo_BuySecondary(base_player pl, int free);
void Ammo_AutoFill(base_player);

View file

@ -314,8 +314,10 @@ CSEv_AmmoBuyPrimary(void)
}
void
Ammo_AutoFill(player pl)
Ammo_AutoFill(base_player pp)
{
player pl = (player)pp;
if (autocvar_fcs_fillweapons == FALSE) {
return;
}

View file

@ -74,6 +74,7 @@ var int autocvar_fcs_nopickups = FALSE; /* Disable weapon items */
var int autocvar_fcs_reward_kill = 300;
var int autocvar_fcs_penalty_pain = -150;
var int autocvar_fcs_penalty_kill = -1500;
var int autocvar_fcs_penalty_teamkill = -3300;
var int autocvar_fcs_maxmoney = 16000;
var int autocvar_fcs_fillweapons = FALSE; /* This will automatically get ammo for the weapon you buy */
var int autocvar_fcs_fix_bombtimer = TRUE; /* If true, the bomb-timer will dictate the round-end */

View file

@ -63,10 +63,17 @@ CSMultiplayerRules::PlayerDeath(base_player pl)
/* update score-counter */
if (g_dmg_eTarget.flags & FL_CLIENT || g_dmg_eTarget.flags & FL_MONSTER)
if (g_dmg_eAttacker.flags & FL_CLIENT) {
if (g_dmg_eTarget == g_dmg_eAttacker || g_dmg_eTarget.team == g_dmg_eAttacker.team)
float vip = (g_dmg_eTarget.team == TEAM_VIP && g_dmg_eAttacker.team == TEAM_CT);
if (g_dmg_eTarget == g_dmg_eAttacker) {
g_dmg_eAttacker.frags--;
else
} else if (g_dmg_eTarget.team == g_dmg_eAttacker.team || vip) {
g_dmg_eAttacker.frags--;
Money_AddMoney((base_player)g_dmg_eAttacker, autocvar_fcs_penalty_teamkill);
} else {
g_dmg_eAttacker.frags++;
Money_AddMoney((base_player)g_dmg_eAttacker, autocvar_fcs_reward_kill);
}
}
Weapon_DropCurrentWeapon(targ);
@ -792,11 +799,7 @@ CSMultiplayerRules::PlayerRespawn(base_player pp, int fTeam)
pl.velocity = [0,0,0];
pl.progress = 0.0f;
Weapons_SwitchBest(pl);
if (autocvar_fcs_fillweapons) {
Ammo_BuyPrimary(pl, TRUE);
Ammo_BuySecondary(pl, TRUE);
}
Ammo_AutoFill(pl);
}
void