From: LegendaryGuard Date: Thu, 15 Apr 2021 00:33:22 +0000 (+0200) Subject: Merge branch 'master' into LegendaryGuard/bai_mod X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e5b899a6b905607adec33acf67d99f08b959cb40;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into LegendaryGuard/bai_mod --- e5b899a6b905607adec33acf67d99f08b959cb40 diff --cc qcsrc/client/hud/panel/chat.qc index cee949f30,972848260..6f3e78b38 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@@ -77,15 -74,23 +77,23 @@@ void HUD_Chat( 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) diff --cc qcsrc/client/hud/panel/scoreboard.qc index a83645097,24b6efe6c..54d2d3ba9 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@@ -490,18 -484,20 +503,21 @@@ void Cmd_Scoreboard_SetFields(int argc 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; diff --cc qcsrc/common/ent_cs.qc index 0f91e23ff,a3691386b..3c7808901 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@@ -161,26 -157,25 +161,37 @@@ ENTCS_PROP(SOLID, true, sv_solid, solid { 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; }); } diff --cc qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc index 5eb256320,54fac9a5a..460a1c300 --- a/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc @@@ -625,14 -606,20 +645,21 @@@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink 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); } diff --cc qcsrc/common/mutators/mutator/nades/nades.qc index 4cab4fe29,e71c61855..6f9e89128 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@@ -1835,57 -1339,64 +1841,73 @@@ MUTATOR_HOOKFUNCTION(nades, PlayerPreTh 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); } } diff --cc qcsrc/common/mutators/mutator/overkill/oknex.qc index a4e55983f,aefc72346..c6918c5f0 --- a/qcsrc/common/mutators/mutator/overkill/oknex.qc +++ b/qcsrc/common/mutators/mutator/overkill/oknex.qc @@@ -94,20 -94,18 +94,22 @@@ void W_OverkillNex_Attack(Weapon thiswe } 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) { + Give_Medal(actor, IMPRESSIVE); - damage_goodhits = 0; // only every second time + 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); diff --cc qcsrc/common/notifications/all.qh index 354a0166f,5a7b0af0f..85d96f917 --- a/qcsrc/common/notifications/all.qh +++ b/qcsrc/common/notifications/all.qh @@@ -164,16 -158,11 +164,18 @@@ void Create_Notification_Entity_Choice( 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) { diff --cc qcsrc/common/replicate.qh index ad79d2cc7,f9cb040fa..7c10cce32 --- a/qcsrc/common/replicate.qh +++ b/qcsrc/common/replicate.qh @@@ -8,9 -8,8 +8,9 @@@ 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; @@@ -29,8 -28,7 +29,8 @@@ #elif defined(SVQC) .float cvar_cl_handicap; .int cvar_cl_gunalign; + .bool cvar_cl_chat_sounds; - .float cvar_cl_clippedspectating; + .bool cvar_cl_clippedspectating; .float cvar_cl_autoscreenshot; .float cvar_cl_jetpack_jump; .float cvar_cl_movement_track_canjump; diff --cc qcsrc/common/scores.qh index 418bd44b8,cf50a7fd1..78a7053d3 --- a/qcsrc/common/scores.qh +++ b/qcsrc/common/scores.qh @@@ -21,13 -22,15 +22,16 @@@ REGISTER_SP(END) 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); diff --cc qcsrc/common/stats.qh index a488a7f58,e5621c29e..4ee421162 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@@ -154,16 -138,9 +154,16 @@@ REGISTER_STAT(ITEMSTIME, int, autocvar_ 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) diff --cc qcsrc/common/weapons/weapon/electro.qc index 310d69599,9409819e9..9e7213057 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@@ -79,13 -74,12 +74,14 @@@ void W_Electro_Explode(entity this, ent 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? { diff --cc qcsrc/common/weapons/weapon/vaporizer.qc index a7b0533ee,6f4d4aebf..8690bcfd9 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@@ -129,19 -129,17 +129,21 @@@ void W_Vaporizer_Attack(Weapon thiswep // 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))) diff --cc qcsrc/common/weapons/weapon/vortex.qc index e78a1be08,7372fe8e1..18a6d69fd --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@@ -138,20 -138,18 +138,22 @@@ void W_Vortex_Attack(Weapon thiswep, en } 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); diff --cc qcsrc/server/round_handler.qc index ef6466747,93c383527..d8163cd0e --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@@ -96,9 -93,9 +96,9 @@@ void round_handler_Spawn(bool() canRoun 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;