if (!autocvar_con_chatrect)
cvar_set("con_chatrect", "1");
- cvar_set("con_chatrect_x", ftos(pos.x/vid_conwidth));
- cvar_set("con_chatrect_y", ftos(pos.y/vid_conheight));
-
- cvar_set("con_chatwidth", ftos(mySize.x/vid_conwidth));
- cvar_set("con_chat", ftos(floor(mySize.y/autocvar_con_chatsize - 0.5)));
+ // can't use a name ending with _x, _y and _z for a float autocvar as for autocvar specs
+ // it prevents ambiguity with component names of vector autocvars
+ if (cvar_string("con_chatrect_x") != ftos(pos.x / vid_conwidth))
+ cvar_set("con_chatrect_x", ftos(pos.x / vid_conwidth));
+ if (cvar_string("con_chatrect_y") != ftos(pos.y / vid_conheight))
+ cvar_set("con_chatrect_y", ftos(pos.y / vid_conheight));
+ // can't use direct comparison here, it would always returns true even if
+ // both arguments are equal because con_chatwidth is saved with cvar_set
+ //if (autocvar_con_chatwidth != mySize.x / vid_conwidth)
+ if (fabs(autocvar_con_chatwidth - mySize.x / vid_conwidth) > 0.00001)
+ cvar_set("con_chatwidth", ftos(mySize.x / vid_conwidth));
+ if (autocvar_con_chat != floor(mySize.y / autocvar_con_chatsize - 0.5))
+ cvar_set("con_chat", ftos(floor(mySize.y / autocvar_con_chatsize - 0.5)));
+ vector chatsize = '1 1 0' * autocvar_con_chatsize;
if(autocvar__hud_configure)
{
- vector chatsize = '1 1 0' * autocvar_con_chatsize;
cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
string str = textShortenToWidth(_("^3Player^7: This is the chat area."), mySize.x, chatsize, stringwidth_colors);
for(int i = 0; i < autocvar_con_chat; ++i)
PlayerScoreField j;
switch(str)
{
+ // fields without a label (not networked via the score system)
case "ping": sbt_field[sbt_num_fields] = SP_PING; break;
case "pl": sbt_field[sbt_num_fields] = SP_PL; break;
- case "kd": case "kdr": case "kdratio": sbt_field[sbt_num_fields] = SP_KDRATIO; break;
- case "sum": case "diff": case "k-d": sbt_field[sbt_num_fields] = SP_SUM; break;
+ case "cn": sbt_field[sbt_num_fields] = SP_COUNTRY; break; //LegendGuard adds cn label for Country column 05-04-2021
case "name": case "nick": sbt_field[sbt_num_fields] = SP_NAME; have_name = true; break;
case "|": sbt_field[sbt_num_fields] = SP_SEPARATOR; have_separator = true; break;
- case "elo": sbt_field[sbt_num_fields] = SP_ELO; break;
- case "dmg": case "damage": sbt_field[sbt_num_fields] = SP_DMG; break;
- case "dmgtaken": case "damagetaken": sbt_field[sbt_num_fields] = SP_DMGTAKEN; break;
- default:
+ case "kd": case "kdr": case "kdratio": sbt_field[sbt_num_fields] = SP_KDRATIO; break;
+ case "sum": case "diff": case "k-d": sbt_field[sbt_num_fields] = SP_SUM; break;
+ case "frags": sbt_field[sbt_num_fields] = SP_FRAGS; break;
+ default: // fields with a label
{
+ // map alternative labels
+ if (str == "damage") str = "dmg";
+ if (str == "damagetaken") str = "dmgtaken";
+
FOREACH(Scores, true, {
if (str == strtolower(scores_label(it))) {
j = it;
{ WriteByte(chan, ent.sv_solid); },
{ ent.sv_solid = ReadByte(); })
+// z411 weapon
+ENTCS_PROP(ACTIVEWEPID, false, activewepid, activewepid, ENTCS_SET_NORMAL,
+ { WriteByte(chan, ent.activewepid); },
+ { ent.activewepid = ReadByte(); })
+
+//LegendGuard adds ENTCS_PROP from Mario/survival 15-02-2021
+// gamemode specific player survival status (independent of score and frags)
+ENTCS_PROP(SURVIVAL_STATUS, true, survival_status, survival_status, ENTCS_SET_NORMAL,
+ { WriteShort(chan, ent.survival_status); },
+ { ent.survival_status = ReadShort(); })
+
+
#ifdef SVQC
- int ENTCS_PUBLICMASK = 0;
+ int ENTCS_PUBLICMASK = 0, ENTCS_PRIVATEMASK = 0;
STATIC_INIT(ENTCS_PUBLICMASK)
{
- FOREACH(EntCSProps, it.m_public,
+ FOREACH(EntCSProps, true,
{
- ENTCS_PUBLICMASK |= BIT(it.m_id);
+ if (it.m_public)
+ ENTCS_PUBLICMASK |= BIT(it.m_id);
+ else
+ ENTCS_PRIVATEMASK |= BIT(it.m_id);
+ });
+ }
+
+ void entcs_update_players(entity player)
+ {
+ FOREACH_CLIENT(it != player && IS_PLAYER(it),
+ {
+ CS(it).entcs.SendFlags |= ENTCS_PRIVATEMASK;
});
}
nades_GiveBonus(it, autocvar_g_nades_bonus_score_low);
}
- entity first = reviving_players_first;
- Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, first.netname);
- Send_Notification(NOTIF_ONE, first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, first.netname);
- Give_Medal(first, ASSIST);
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, revivers_first.netname);
+ Send_Notification(NOTIF_ONE, revivers_first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, revivers_first.netname);
++ Give_Medal(revivers_first, ASSIST);
+ if(autocvar_sv_eventlog)
+ {
+ string revivers = "";
+ for(entity it = revivers_first; it; it = it.chain)
+ revivers = strcat(revivers, ftos(it.playerid), ",");
+ revivers = substring(revivers, 0, strlen(revivers) - 1);
+ GameLogEcho(strcat(":ft:revival:", ftos(player.playerid), ":", revivers));
+ }
}
- for(entity it = reviving_players_first; it; it = it.chain)
+ for(entity it = revivers_first; it; it = it.chain)
STAT(REVIVE_PROGRESS, it) = STAT(REVIVE_PROGRESS, player);
}
else
player.alpha = player.nade_veil_prevalpha;
}
+ //LegendGuard adds nade if STAT DARK_ORB 08-02-2021
+ if(STAT(DARK_ORB, player) && STAT(DARK_ORB, player) <= time)
+ {
+ STAT(DARK_ORB, player) = 0;
+ if(player.vehicle)
+ player.vehicle.alpha = player.vehicle.nade_dark_prevalpha;
+ else
+ player.alpha = player.nade_dark_prevalpha;
+ }
}
- if (frametime && IS_PLAYER(player))
- {
- int n = 0;
+ if (!(frametime && IS_PLAYER(player)))
+ return true;
- IntrusiveList reviving_players = NULL;
+ entity revivers_last = NULL;
+ entity revivers_first = NULL;
- if(player.freezetag_frozen_timeout > 0 && time >= player.freezetag_frozen_timeout)
- n = -1;
- else if (STAT(FROZEN, player) == FROZEN_TEMP_DYING)
+ bool player_is_reviving = false;
+ int n = 0;
+ vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
+ FOREACH_CLIENT(IS_PLAYER(it) && IN_REVIVING_RANGE(player, it, revive_extra_size), {
+ // check if player is reviving anyone
+ if (STAT(FROZEN, it) == FROZEN_TEMP_DYING)
{
- vector revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
- n = 0;
- FOREACH_CLIENT(IS_PLAYER(it) && IS_REVIVING(player, it, revive_extra_size), {
- if (!reviving_players)
- reviving_players = IL_NEW();
- IL_PUSH(reviving_players, it);
- ++n;
- });
+ if ((STAT(FROZEN, player) == FROZEN_TEMP_DYING))
+ continue;
+ if (!IN_REVIVING_RANGE(player, it, revive_extra_size))
+ continue;
+ player_is_reviving = true;
+ break;
}
- if (n > 0 && STAT(FROZEN, player) == FROZEN_TEMP_DYING) // OK, there is at least one teammate reviving us
- {
- STAT(REVIVE_PROGRESS, player) = bound(0, STAT(REVIVE_PROGRESS, player) + frametime * max(1/60, autocvar_g_freezetag_revive_speed), 1);
- SetResource(player, RES_HEALTH, max(1, STAT(REVIVE_PROGRESS, player) * start_health));
+ if (!(STAT(FROZEN, player) == FROZEN_TEMP_DYING))
+ continue; // both player and it are NOT frozen
+ if (revivers_last)
+ revivers_last.chain = it;
+ revivers_last = it;
+ if (!revivers_first)
+ revivers_first = it;
+ ++n;
+ });
+ if (revivers_last)
+ revivers_last.chain = NULL;
- if(STAT(REVIVE_PROGRESS, player) >= 1)
- {
- Unfreeze(player, false);
+ if (!n) // no teammate nearby
+ {
+ // freezetag already resets revive progress
+ if (!g_freezetag && !STAT(FROZEN, player) && !player_is_reviving)
+ STAT(REVIVE_PROGRESS, player) = 0; // thawing nobody
+ }
+ else if (n > 0 && STAT(FROZEN, player) == FROZEN_TEMP_DYING) // OK, there is at least one teammate reviving us
+ {
+ STAT(REVIVE_PROGRESS, player) = bound(0, STAT(REVIVE_PROGRESS, player) + frametime * max(1/60, autocvar_g_freezetag_revive_speed), 1);
+ // undo what PlayerPreThink did
+ STAT(REVIVE_PROGRESS, player) = bound(0, STAT(REVIVE_PROGRESS, player) + frametime * player.revive_speed, 1);
+ SetResource(player, RES_HEALTH, max(1, STAT(REVIVE_PROGRESS, player) * start_health));
- entity first = IL_FIRST(reviving_players);
- Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, first.netname);
- Send_Notification(NOTIF_ONE, first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
- }
+ if(STAT(REVIVE_PROGRESS, player) >= 1)
+ {
+ Unfreeze(player, false);
- IL_EACH(reviving_players, true, {
- STAT(REVIVE_PROGRESS, it) = STAT(REVIVE_PROGRESS, player);
- });
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, revivers_first.netname);
+ Send_Notification(NOTIF_ONE, revivers_first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
}
- if (reviving_players)
- IL_DELETE(reviving_players);
+
+ for(entity it = revivers_first; it; it = it.chain)
+ STAT(REVIVE_PROGRESS, it) = STAT(REVIVE_PROGRESS, player);
}
}
}
yoda = 0;
- damage_goodhits = 0;
+ impressive_hits = 0;
FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, true, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, thiswep.m_id);
- if(yoda && flying) {
+ if(yoda && flying)
++ {
+ Give_Medal(actor, YODA);
+ Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
+ }
-
- if(damage_goodhits && actor.oknex_lasthit)
+ if(impressive_hits && actor.oknex_lasthit)
{
- damage_goodhits = 0; // only every second time
+ Give_Medal(actor, IMPRESSIVE);
+ Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+ impressive_hits = 0; // only every second time
}
- actor.oknex_lasthit = damage_goodhits;
+ actor.oknex_lasthit = impressive_hits;
//beam and muzzle flash done on client
SendCSQCVortexBeamParticle(charge);
Notification optiona,
Notification optionb);
+void Create_Notification_Entity_Medal(entity notif,
+ float var_cvar,
+ string namestring,
+ /* MSG_MEDAL */
+ string icon,
+ Notification anncename);
+
void Dump_Notifications(int fh, bool alsoprint);
- GENERIC_COMMAND(dumpnotifs, "Dump all notifications into notifications_dump.txt", false)
+ #define DEFAULT_FILENAME "notifications_dump.cfg"
+ // NOTE: dumpeffectinfo, dumpnotifs, dumpturrets and dumpweapons use similar code
+ GENERIC_COMMAND(dumpnotifs, "Dump all notifications into " DEFAULT_FILENAME, false)
{
switch (request)
{
bool cvar_cl_allow_uidranking;
float cvar_cl_autoscreenshot;
float cvar_cl_autotaunt;
- float cvar_cl_clippedspectating;
+ bool cvar_cl_clippedspectating;
int cvar_cl_gunalign;
+ bool cvar_cl_chat_sounds;
float cvar_cl_handicap;
float cvar_cl_jetpack_jump;
float cvar_cl_movement_track_canjump;
#elif defined(SVQC)
.float cvar_cl_handicap;
.int cvar_cl_gunalign;
- .float cvar_cl_clippedspectating;
+ .bool cvar_cl_chat_sounds;
+ .bool cvar_cl_clippedspectating;
.float cvar_cl_autoscreenshot;
.float cvar_cl_jetpack_jump;
.float cvar_cl_movement_track_canjump;
REGISTER_SP(PING);
REGISTER_SP(PL);
+REGISTER_SP(COUNTRY); //LegendGuard adds new column for country label 05-04-2021
REGISTER_SP(NAME);
- REGISTER_SP(KDRATIO);
- REGISTER_SP(SUM);
-
REGISTER_SP(SEPARATOR);
+ REGISTER_SP(KDRATIO); // kills / deaths
+ REGISTER_SP(SUM); // kills - deaths
+ REGISTER_SP(FRAGS); // kills - suicides
+
+ // networked fields
+
REGISTER_SP(SCORE);
REGISTER_SP(DMG);
REGISTER_STAT(KILL_TIME, float)
REGISTER_STAT(VEIL_ORB, float)
REGISTER_STAT(VEIL_ORB_ALPHA, float)
+REGISTER_STAT(ARMORIZING_ORB, float) //LegendGuard registers new STAT 11-02-2021
+REGISTER_STAT(ARMORIZING_ORB_ALPHA, float)
+REGISTER_STAT(AMMUNITIONING_ORB, float) //LegendGuard registers new STAT 11-02-2021
+REGISTER_STAT(AMMUNITIONING_ORB_ALPHA, float)
+REGISTER_STAT(DARK_ORB, float) //LegendGuard registers new STAT 08-02-2021
+REGISTER_STAT(DARK_ORB_ALPHA, float)
+REGISTER_STAT(TKA_BALLSTATUS, int) //LegendGuard adds STAT from Mario/team_keepaway 15-02-2021
#ifdef SVQC
- float autocvar_sv_showfps = 5;
+ float autocvar_sv_showfps = 0;
#endif
REGISTER_STAT(SHOWFPS, float, autocvar_sv_showfps)
if(IS_PLAYER(directhitentity))
if(DIFF_TEAM(this.realowner, directhitentity))
if(!IS_DEAD(directhitentity))
- if(IsFlying(directhitentity))
- Send_Notification(NOTIF_ONE, this.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
-
+ if(IsFlying(directhitentity)) {
+ Give_Medal(this.realowner, ELECTROBITCH);
+ }
+ */
+
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
+ this.velocity = this.movedir; // particle fx and decals need .velocity
if(this.move_movetype == MOVETYPE_BOUNCE || this.classname == "electro_orb") // TODO: classname is more reliable anyway?
{
// do this now, as goodhits is disabled below
vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, normalize(v - w_shotorg));
- SendCSQCVaporizerBeamParticle(actor, damage_goodhits);
+ SendCSQCVaporizerBeamParticle(actor, impressive_hits);
- if(yoda && flying) {
- Give_Medal(actor, YODA);
- }
-
- if(damage_goodhits && actor.vaporizer_lasthit)
+ if(yoda && flying)
++ {
++ Give_Medal(actor, YODA);
+ Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
- if(impressive_hits && actor.vaporizer_lasthit)
++ }
++ if(impressive_hits && actor.vaporizer_lasthit)
{
- Give_Medal(actor, IMPRESSIVE);
- damage_goodhits = 0; // only every second time
++ Give_Medal(actor, IMPRESSIVE);
+ Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+ impressive_hits = 0; // only every second time
}
- actor.vaporizer_lasthit = damage_goodhits;
+ actor.vaporizer_lasthit = impressive_hits;
if(autocvar_g_rm)
if(!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
}
yoda = 0;
- damage_goodhits = 0;
+ impressive_hits = 0;
FireRailgunBullet(actor, weaponentity, w_shotorg, w_shotorg + w_shotdir * max_shot_distance, mydmg, false, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, dtype);
- if(yoda && flying) {
- Give_Medal(actor, YODA);
- }
-
- if(damage_goodhits && actor.vortex_lasthit)
+ if(yoda && flying)
++ {
++ Give_Medal(actor, YODA);
+ Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
- if(impressive_hits && actor.vortex_lasthit)
++ }
++ if(impressive_hits && actor.vortex_lasthit)
{
- Give_Medal(actor, IMPRESSIVE);
- damage_goodhits = 0; // only every second time
++ Give_Medal(actor, IMPRESSIVE);
+ Send_Notification(NOTIF_ONE, actor, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+ impressive_hits = 0; // only every second time
}
- actor.vortex_lasthit = damage_goodhits;
+ actor.vortex_lasthit = impressive_hits;
//beam done on client
vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
backtrace("Can't spawn round_handler again!");
return;
}
- entity this = round_handler = new(round_handler);
+ entity this = round_handler = new_pure(round_handler);
- setthink(this, round_handler_FirstThink);
+
this.canRoundStart = canRoundStart_func;
this.canRoundEnd = canRoundEnd_func;
this.roundStart = roundStart_func;