set sv_dodging_air_dodging 0
set sv_dodging_wall_dodging 0 "allow dodging off walls"
- set sv_dodging_delay 0.5 "determines how long a player has to wait to be able to dodge again after dodging"
+ set sv_dodging_delay 0.6 "determines how long a player has to wait to be able to dodge again after dodging"
set sv_dodging_up_speed 200 "the jump velocity of the dodge"
- set sv_dodging_horiz_speed 400 "the horizontal velocity of the dodge"
- set sv_dodging_horiz_speed_frozen 200 "the horizontal velocity of the dodge while frozen"
+ set sv_dodging_horiz_speed_min 200 "the lower bound of current velocity for force scaling"
+ set sv_dodging_horiz_speed_max 1000 "the upper bound of current velocity for force scaling"
+ set sv_dodging_horiz_force_slowest 400 "the horizontal velocity of the dodge when current velocity is <= sv_dodging_horiz_speed_min, values between min and max are linearly scaled"
+ set sv_dodging_horiz_force_fastest 400 "the horizontal velocity of the dodge when current velocity is >= sv_dodging_horiz_speed_max, values between min and max are linearly scaled"
+ set sv_dodging_horiz_force_frozen 200 "the horizontal velocity of the dodge while frozen"
set sv_dodging_ramp_time 0.1 "a ramp so that the horizontal part of the dodge is added smoothly (seconds)"
set sv_dodging_height_threshold 10 "the maximum height above ground where to allow dodging"
set sv_dodging_wall_distance_threshold 10 "the maximum distance from a wall that still allows dodging"
set sv_dodging_sound 1 "if 1 dodging makes a sound. if 0 dodging is silent"
set sv_dodging_frozen 0 "allow dodging while frozen"
set sv_dodging_frozen_doubletap 0
- set sv_dodging_maxspeed 450 "maximum speed a player can be moving at before they dodge again"
+ set sv_dodging_maxspeed 350 "maximum speed a player can be moving at to use the standard dodging from an (almost) standstill"
+ set sv_dodging_air_maxspeed 450 "maximum speed a player can be moving at before they dodge again when air dodging is enabled"
// ===========
// dynamic handicap
// ==================
set g_dynamic_handicap 0 "Whether to enable dynamic handicap."
- set g_dynamic_handicap_scale 1 "The scale of the handicap. Larger values mean more penalties for strong players and more buffs for weak players."
+ set g_dynamic_handicap_scale 0.2 "The scale of the handicap. Larger values mean more penalties for strong players and more buffs for weak players."
+ set g_dynamic_handicap_exponent 1 "The exponent used to calculate handicap. 1 means linear scale. Values more than 1 mean stronger non-linear handicap. Values less than 1 mean weaker non-linear handicap"
set g_dynamic_handicap_min 0 "The minimum value of the handicap."
set g_dynamic_handicap_max 0 "The maximum value of the handicap."
+// ===============
+// kick teamkiller
+// ===============
+set g_kick_teamkiller_rate 0 "Limit for teamkills per minute before the client gets dropped. 0 means that the teamkillers don't get kicked automatically"
+set g_kick_teamkiller_lower_limit 5 "Minimum number of teamkills before the teamkill rate is considered"
++
+ // =====================
+ // stale-move negation
+ // =====================
+ set g_smneg 0 "Stale-move negation: penalize repeated use of the same weapon"
+ set g_smneg_bonus 1 "Stale-move negation: allow weapons to become stronger than their baseline"
+ set g_smneg_bonus_asymptote 4 "Stale-move negation: damage = infinity at this bonus level"
+ set g_smneg_cooldown_factor 0.25 "Stale-move negation: penalty cooldown factor"
++
#include <common/mutators/mutator/instagib/_mod.inc>
#include <common/mutators/mutator/invincibleproj/_mod.inc>
#include <common/mutators/mutator/itemstime/_mod.inc>
+#include <common/mutators/mutator/kick_teamkiller/_mod.inc>
#include <common/mutators/mutator/melee_only/_mod.inc>
#include <common/mutators/mutator/midair/_mod.inc>
#include <common/mutators/mutator/multijump/_mod.inc>
#include <common/mutators/mutator/running_guns/_mod.inc>
#include <common/mutators/mutator/sandbox/_mod.inc>
#include <common/mutators/mutator/spawn_near_teammate/_mod.inc>
+ #include <common/mutators/mutator/stale_move_negation/_mod.inc>
#include <common/mutators/mutator/superspec/_mod.inc>
#include <common/mutators/mutator/touchexplode/_mod.inc>
#include <common/mutators/mutator/vampire/_mod.inc>
#include <common/mutators/mutator/instagib/_mod.qh>
#include <common/mutators/mutator/invincibleproj/_mod.qh>
#include <common/mutators/mutator/itemstime/_mod.qh>
+#include <common/mutators/mutator/kick_teamkiller/_mod.qh>
#include <common/mutators/mutator/melee_only/_mod.qh>
#include <common/mutators/mutator/midair/_mod.qh>
#include <common/mutators/mutator/multijump/_mod.qh>
#include <common/mutators/mutator/running_guns/_mod.qh>
#include <common/mutators/mutator/sandbox/_mod.qh>
#include <common/mutators/mutator/spawn_near_teammate/_mod.qh>
+ #include <common/mutators/mutator/stale_move_negation/_mod.qh>
#include <common/mutators/mutator/superspec/_mod.qh>
#include <common/mutators/mutator/touchexplode/_mod.qh>
#include <common/mutators/mutator/vampire/_mod.qh>
MSG_INFO_NOTIF(QUIT_DISCONNECT, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 disconnected"), "")
MSG_INFO_NOTIF(QUIT_KICK_IDLING, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was kicked for idling"), "")
MSG_INFO_NOTIF(QUIT_KICK_SPECTATING, N_CONSOLE, 0, 0, "", "", "", _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment."), "")
+ MSG_INFO_NOTIF(QUIT_KICK_TEAMKILL, N_CHATCON, 1, 0, "s1", "", "", _("^BG%s^F3 was kicked for excessive teamkilling"), "")
MSG_INFO_NOTIF(QUIT_SPECTATE, N_CONSOLE, 1, 0, "s1", "", "", _("^BG%s^F3 is now spectating"), "")
MSG_INFO_NOTIF(RACE_ABANDONED, N_CONSOLE, 1, 0, "s1", "", "", _("^BG%s^BG has abandoned the race"), "")
MSG_INFO_NOTIF(WEAPON_CRYLINK_MURDER, N_CONSOLE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponcrylink", _("^BG%s%s^K1 felt the strong pull of ^BG%s^K1's Crylink%s%s"), "")
MSG_INFO_NOTIF(WEAPON_CRYLINK_SUICIDE, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "weaponcrylink", _("^BG%s^K1 felt the strong pull of their Crylink%s%s"), "")
MSG_INFO_NOTIF(WEAPON_DEVASTATOR_MURDER_DIRECT, N_CONSOLE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponrocketlauncher", _("^BG%s%s^K1 ate ^BG%s^K1's rocket%s%s"), "")
- MSG_INFO_NOTIF(WEAPON_DEVASTATOR_MURDER_SPLASH, N_CONSOLE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponrocketlauncher", _("^BG%s%s^K1 got too close ^BG%s^K1's rocket%s%s"), "")
+ MSG_INFO_NOTIF(WEAPON_DEVASTATOR_MURDER_SPLASH, N_CONSOLE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponrocketlauncher", _("^BG%s%s^K1 got too close to ^BG%s^K1's rocket%s%s"), "")
MSG_INFO_NOTIF(WEAPON_DEVASTATOR_SUICIDE, N_CONSOLE, 2, 1, "s1 s2loc spree_lost", "s1", "weaponrocketlauncher", _("^BG%s^K1 blew themself up with their Devastator%s%s"), "")
MSG_INFO_NOTIF(WEAPON_ELECTRO_MURDER_BOLT, N_CONSOLE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponelectro", _("^BG%s%s^K1 was blasted by ^BG%s^K1's Electro bolt%s%s"), "")
MSG_INFO_NOTIF(WEAPON_ELECTRO_MURDER_COMBO, N_CONSOLE, 3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1", "weaponelectro", _("^BG%s%s^K1 felt the electrifying air of ^BG%s^K1's Electro combo%s%s"), "")
if (this.alivetime)
{
if (!warmup_stage)
- PS_GR_P_ADDVAL(this, PLAYERSTATS_ALIVETIME, time - this.alivetime);
+ PlayerStats_GameReport_Event_Player(this, PLAYERSTATS_ALIVETIME, time - this.alivetime);
this.alivetime = 0;
}
this.health = start_health;
this.armorvalue = start_armorvalue;
this.weapons = start_weapons;
+ GiveRandomWeapons(this, random_start_weapons_count,
+ autocvar_g_random_start_weapons, random_start_ammo);
}
SetSpectatee_status(this, 0);
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_JUMP(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false;
+ // player was spectator
if (CS(this).killcount == FRAGS_SPECTATOR) {
PlayerScore_Clear(this);
CS(this).killcount = 0;
+ CS(this).startplaytime = time;
}
for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
.float clientkill_nexttime;
void ClientKill_Now_TeamChange(entity this)
{
- if(CS(this).killindicator_teamchange == -1)
+ if(this.killindicator_teamchange == -1)
{
JoinBestTeam( this, false, true );
}
- else if(CS(this).killindicator_teamchange == -2)
+ else if(this.killindicator_teamchange == -2)
{
if(blockSpectators)
Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
PutObserverInServer(this);
}
else
- SV_ChangeTeam(this, CS(this).killindicator_teamchange - 1);
- CS(this).killindicator_teamchange = 0;
+ SV_ChangeTeam(this, this.killindicator_teamchange - 1);
+ this.killindicator_teamchange = 0;
}
void ClientKill_Now(entity this)
if(this.vehicle)
{
vehicles_exit(this.vehicle, VHEF_RELEASE);
- if(!CS(this).killindicator_teamchange)
+ if(!this.killindicator_teamchange)
{
this.vehicle_health = -1;
Damage(this, this, this, 1 , DEATH_KILL.m_id, this.origin, '0 0 0');
this.killindicator = NULL;
- if(CS(this).killindicator_teamchange)
+ if(this.killindicator_teamchange)
ClientKill_Now_TeamChange(this);
if (!IS_SPEC(this) && !IS_OBSERVER(this) && MUTATOR_CALLHOOK(ClientKill_Now, this) == false)
return;
killtime = M_ARGV(1, float);
- CS(this).killindicator_teamchange = targetteam;
+ this.killindicator_teamchange = targetteam;
if(!this.killindicator)
{
CS(this).just_joined = true; // stop spamming the eventlog with additional lines when the client connects
- CS(this).netname_previous = strzone(this.netname);
-
if(teamplay && IS_PLAYER(this))
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_JOIN_CONNECT_TEAM), this.netname);
else
// WORKAROUND: only use dropclient in server frames (frametime set).
// Never use it in cl_movement frames (frametime zero).
checkSpectatorBlock(this);
- }
+ }
zoomstate_set = false;
// Check for nameless players
- if (isInvisibleString(this.netname)) {
- this.netname = strzone(sprintf("Player#%d", this.playerid));
- // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe?
- }
- if (this.netname != CS(this).netname_previous) {
- if (autocvar_sv_eventlog) {
+ if (this.netname == "" || this.netname != CS(this).netname_previous)
+ {
+ bool assume_unchanged = (CS(this).netname_previous == "");
+ if (isInvisibleString(this.netname))
+ {
+ this.netname = strzone(sprintf("Player#%d", this.playerid));
+ assume_unchanged = false;
+ // stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe?
+ }
+ if (!assume_unchanged && autocvar_sv_eventlog)
GameLogEcho(strcat(":name:", ftos(this.playerid), ":", playername(this, false)));
- }
if (CS(this).netname_previous) strunzone(CS(this).netname_previous);
CS(this).netname_previous = strzone(this.netname);
}
ATTRIB(Client, parm_idlesince, int, this.parm_idlesince);
ATTRIB(Client, muted, bool, this.muted);
- ATTRIB(Client, killindicator_teamchange, int, this.killindicator_teamchange);
ATTRIB(Client, idlekick_lasttimeleft, float, this.idlekick_lasttimeleft);
ATTRIB(Client, pm_frametime, float, this.pm_frametime);
ATTRIB(Client, pressedkeys, int, this.pressedkeys);
ATTRIB(Client, motd_actived_time, float, this.motd_actived_time);
ATTRIB(Client, jointime, float, this.jointime);
ATTRIB(Client, spectatortime, float, this.spectatortime);
+ ATTRIB(Client, startplaytime, float, this.startplaytime);
ATTRIB(Client, version_nagtime, float, this.version_nagtime);
ATTRIB(Client, netname_previous, string, this.netname_previous);
ATTRIB(Client, allowed_timeouts, int, this.allowed_timeouts);
float game_completion_ratio; // 0 at start, 1 near end
.float winning;
-.float jointime; // time of joining
+.float jointime; // time of connecting
+.float startplaytime; // time of switching from spectator to player
.float alivetime; // time of being alive
.float motd_actived_time; // used for both motd and campaign_message
.float stat_respawn_time = _STAT(RESPAWN_TIME); // shows respawn time, and is negative when awaiting respawn
+ .int killindicator_teamchange;
+
void PlayerUseKey(entity this);
USING(spawn_evalfunc_t, vector(entity this, entity player, entity spot, vector current));
else
{
// teamkill
- GameRules_scoring_add(attacker, KILLS, -1); // or maybe add a teamkills field?
+ GameRules_scoring_add(attacker, TEAMKILLS, 1);
}
}
else
{
// regular frag
GameRules_scoring_add(attacker, KILLS, 1);
- if(targ.playerid)
- PS_GR_P_ADDVAL(attacker, sprintf("kills-%d", targ.playerid), 1);
+ if(!warmup_stage && targ.playerid)
+ PlayerStats_GameReport_Event_Player(attacker, sprintf("kills-%d", targ.playerid), 1);
}
GameRules_scoring_add(targ, DEATHS, 1);
string s1, string s2, string s3,
float f1, float f2, float f3)
{
- if(DEATH_ISSPECIAL(deathtype))
+ if(!DEATH_ISSPECIAL(deathtype))
{
- entity deathent = Deathtypes_from(deathtype - DT_FIRST);
- if (!deathent) { backtrace("Obituary_SpecialDeath: Could not find deathtype entity!\n"); return; }
+ backtrace("Obituary_SpecialDeath called without a special deathtype?\n");
+ return;
+ }
- if(g_cts && deathtype == DEATH_KILL.m_id)
- return; // TODO: somehow put this in CTS gamemode file!
+ entity deathent = Deathtypes_from(deathtype - DT_FIRST);
+ if (!deathent)
+ {
+ backtrace("Obituary_SpecialDeath: Could not find deathtype entity!\n");
+ return;
+ }
- if(murder)
- {
- if(deathent.death_msgmurder)
- {
- Send_Notification_WOCOVA(
- NOTIF_ONE,
- notif_target,
- MSG_MULTI,
- deathent.death_msgmurder,
- s1, s2, s3, "",
- f1, f2, f3, 0
- );
- Send_Notification_WOCOVA(
- NOTIF_ALL_EXCEPT,
- notif_target,
- MSG_INFO,
- deathent.death_msgmurder.nent_msginfo,
- s1, s2, s3, "",
- f1, f2, f3, 0
- );
- }
- }
- else
- {
- if(deathent.death_msgself)
- {
- Send_Notification_WOCOVA(
- NOTIF_ONE,
- notif_target,
- MSG_MULTI,
- deathent.death_msgself,
- s1, s2, s3, "",
- f1, f2, f3, 0
- );
- Send_Notification_WOCOVA(
- NOTIF_ALL_EXCEPT,
- notif_target,
- MSG_INFO,
- deathent.death_msgself.nent_msginfo,
- s1, s2, s3, "",
- f1, f2, f3, 0
- );
- }
- }
+ if(g_cts && deathtype == DEATH_KILL.m_id)
+ return; // TODO: somehow put this in CTS gamemode file!
+
+ Notification death_message = (murder) ? deathent.death_msgmurder : deathent.death_msgself;
+ if(death_message)
+ {
+ Send_Notification_WOCOVA(
+ NOTIF_ONE,
+ notif_target,
+ MSG_MULTI,
+ death_message,
+ s1, s2, s3, "",
+ f1, f2, f3, 0
+ );
+ Send_Notification_WOCOVA(
+ NOTIF_ALL_EXCEPT,
+ notif_target,
+ MSG_INFO,
+ death_message.nent_msginfo,
+ s1, s2, s3, "",
+ f1, f2, f3, 0
+ );
}
- else { backtrace("Obituary_SpecialDeath called without a special deathtype?\n"); return; }
}
float Obituary_WeaponDeath(
float f1, float f2)
{
Weapon death_weapon = DEATH_WEAPONOF(deathtype);
- if (death_weapon != WEP_Null)
- {
- w_deathtype = deathtype;
- Notification death_message = ((murder) ? death_weapon.wr_killmessage(death_weapon) : death_weapon.wr_suicidemessage(death_weapon));
- w_deathtype = false;
+ if (death_weapon == WEP_Null)
+ return false;
- if (death_message)
- {
- Send_Notification_WOCOVA(
- NOTIF_ONE,
- notif_target,
- MSG_MULTI,
- death_message,
- s1, s2, s3, "",
- f1, f2, 0, 0
- );
- // send the info part to everyone
- Send_Notification_WOCOVA(
- NOTIF_ALL_EXCEPT,
- notif_target,
- MSG_INFO,
- death_message.nent_msginfo,
- s1, s2, s3, "",
- f1, f2, 0, 0
- );
- }
- else
- {
- LOG_TRACEF(
- "Obituary_WeaponDeath(): ^1Deathtype ^7(%d)^1 has no notification for weapon %d!\n",
- deathtype,
- death_weapon
- );
- }
+ w_deathtype = deathtype;
+ Notification death_message = ((murder) ? death_weapon.wr_killmessage(death_weapon) : death_weapon.wr_suicidemessage(death_weapon));
+ w_deathtype = false;
- return true;
+ if (death_message)
+ {
+ Send_Notification_WOCOVA(
+ NOTIF_ONE,
+ notif_target,
+ MSG_MULTI,
+ death_message,
+ s1, s2, s3, "",
+ f1, f2, 0, 0
+ );
+ // send the info part to everyone
+ Send_Notification_WOCOVA(
+ NOTIF_ALL_EXCEPT,
+ notif_target,
+ MSG_INFO,
+ death_message.nent_msginfo,
+ s1, s2, s3, "",
+ f1, f2, 0, 0
+ );
}
- return false;
+ else
+ {
+ LOG_TRACEF(
+ "Obituary_WeaponDeath(): ^1Deathtype ^7(%d)^1 has no notification for weapon %d!\n",
+ deathtype,
+ death_weapon
+ );
+ }
+
+ return true;
}
bool frag_centermessage_override(entity attacker, entity targ, int deathtype, int kill_count_to_attacker, int kill_count_to_target)
attacker.killsound += 1;
+ // TODO: improve SPREE_ITEM and KILL_SPREE_LIST
+ // these 2 macros are spread over multiple files
#define SPREE_ITEM(counta,countb,center,normal,gentle) \
case counta: \
{ \
Send_Notification(NOTIF_ONE, attacker, MSG_ANNCE, ANNCE_KILLSTREAK_##countb); \
- PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_##counta, 1); \
+ if (!warmup_stage)\
+ {\
+ PlayerStats_GameReport_Event_Player(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_##counta, 1); \
+ }\
break; \
}
switch(CS(attacker).killcount)
}
#undef SPREE_ITEM
- if(!checkrules_firstblood)
+ if(!warmup_stage && !checkrules_firstblood)
{
checkrules_firstblood = true;
notif_firstblood = true; // modify the current messages so that they too show firstblood information
- PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
- PS_GR_P_ADDVAL(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
+ PlayerStats_GameReport_Event_Player(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
+ PlayerStats_GameReport_Event_Player(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
// tell spree_inf and spree_cen that this is a first-blood and first-victim event
kill_count_to_attacker = -1;
if(GameRules_scoring_add(targ, SCORE, 0) == -5)
{
Send_Notification(NOTIF_ONE, targ, MSG_ANNCE, ANNCE_ACHIEVEMENT_BOTLIKE);
- PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
+ if (!warmup_stage)
+ {
+ PlayerStats_GameReport_Event_Player(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
+ }
}
}
PlayerStats_GameReport_AddTeam(t);
}
-float TeamScore_AddToTeam(float t, float scorefield, float score)
+float TeamScore_AddToTeam(int t, float scorefield, float score)
{
entity s;
if(scores_label(scorefield) != "")
s.SendFlags |= (2 ** (scorefield.m_id % 16));
if(!warmup_stage)
- PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score);
- return (s.(scores(scorefield)) += score);
+ PlayerStats_GameReport_Event_Player(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score);
+ s.(scores(scorefield)) += score;
+ MUTATOR_CALLHOOK(AddedPlayerScore, scorefield, score, player);
+ return s.(scores(scorefield));
}
float PlayerTeamScore_Add(entity player, PlayerScoreField pscorefield, float tscorefield, float score)
{
entity s = CS(p).scorekeeper;
FOREACH(Scores, true, {
- if(s.(scores(it)) != 0)
- if(scores_label(it) != "")
- PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_SCOREBOARD, scores_label(it)), s.(scores(it)));
- });
+ if(s.(scores(it)) != 0 && scores_label(it) != "")
+ PlayerStats_GameReport_Event_Player(s.owner,
+ strcat(PLAYERSTATS_SCOREBOARD, scores_label(it)), s.(scores(it)));
+ });
}
void PlayerScore_TeamStats()
if(!sk)
continue;
for(i = 0; i < MAX_TEAMSCORE; ++i)
- if(sk.(teamscores(i)) != 0)
- if(teamscores_label(i) != "")
- // the +1 is important here!
- PS_GR_T_ADDVAL(t+1, strcat(PLAYERSTATS_SCOREBOARD, teamscores_label(i)), sk.(teamscores(i)));
+ if(sk.(teamscores(i)) != 0 && teamscores_label(i) != "")
+ // the +1 is important here!
+ PlayerStats_GameReport_Event_Team(t+1,
+ strcat(PLAYERSTATS_SCOREBOARD, teamscores_label(i)), sk.(teamscores(i)));
}
}