From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Thu, 27 Jan 2022 18:21:03 +0000 (+0100) Subject: show waypoints if squadmates in battle royale are too far away X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=954a31b02f56cc0ed84385d72167bfc278fe6ec1;p=xonotic%2Fxonotic-data.pk3dir.git show waypoints if squadmates in battle royale are too far away --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 70c754afa..a9cd7ed91 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -579,6 +579,7 @@ set g_br_not_dm_maps 0 "when this is set, DM maps will NOT be listed in BR" set g_br_minplayers 2 "minimum players to start the BR match" set g_br_squad_size 3 "maximum squad size" set g_br_squad_colors 1 "assign each squad a random color scheme and force players to use it" +set g_br_squad_waypoint_distance 1500 "minimum distance required to show an ally waypoint" set g_br_startweapons 0 "when disabled, players land from the dropship without weapons" set g_br_bleed 0.02 "amount of health rot while injured" set g_br_bleedlinear 1 "linear amount of health rot while injured" diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc index 29e914bf1..df8e33a15 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc +++ b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc @@ -48,6 +48,7 @@ float autocvar_g_br_drop_accel_dive = 50; float autocvar_g_br_drop_accel_turn = 600; bool autocvar_g_br_startweapons = false; bool autocvar_g_br_ring_exitvehicle = false; +float autocvar_g_br_squad_waypoint_distance = 1500; .vector br_drop_velocity; .vector br_drop_angles; @@ -693,6 +694,8 @@ MUTATOR_HOOKFUNCTION(br, PlayerDies, CBC_ORDER_FIRST) frag_target.(weaponentity).m_weapon = frag_target.br_weapon_prev[slot]; } } + WaypointSprite_Kill(frag_target.br_allywaypoint); + frag_target.respawn_flags = RESPAWN_SILENT | RESPAWN_FORCE; frag_target.respawn_time = time + 2; return true; @@ -872,6 +875,9 @@ MUTATOR_HOOKFUNCTION(br, CustomizeWaypoint) entity wp = M_ARGV(0, entity); entity player = M_ARGV(1, entity); + if((wp == wp.owner.br_allywaypoint) && (vdist(wp.owner.origin - player.origin, <, autocvar_g_br_squad_waypoint_distance) || STAT(BLEEDING, wp.owner))) + return true; + if(!IS_PLAYER(player) || DIFF_SQUAD(wp, player)) return true; } @@ -1087,6 +1093,8 @@ void br_RoundStart(){ STAT(DROP, it) = DROP_TRANSPORT; it.br_drop_launch = 0; UNSET_ONGROUND(it); // otherwise this isn't unset if the player drops in the same frame + + WaypointSprite_Spawn(WP_BRAlly, 0, 0, it, '0 0 64', NULL, 0, it, br_allywaypoint, true, RADARICON_WAYPOINT).br_squad = it.br_squad; }); squads_colored = autocvar_g_br_squad_colors; diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_br.qh b/qcsrc/common/gamemodes/gamemode/br/sv_br.qh index 38478c5e8..d14442783 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_br.qh +++ b/qcsrc/common/gamemodes/gamemode/br/sv_br.qh @@ -25,6 +25,8 @@ REGISTER_MUTATOR(br, false) return 0; } +.entity br_allywaypoint; + float autocvar_g_br_revive_extra_size = 100; float autocvar_g_br_revive_speed = 0.4; float autocvar_g_br_revive_clearspeed = 1.6; diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_squad.qc b/qcsrc/common/gamemodes/gamemode/br/sv_squad.qc index 3e18f1aac..60cc3277a 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_squad.qc +++ b/qcsrc/common/gamemodes/gamemode/br/sv_squad.qc @@ -81,6 +81,7 @@ void br_SquadMember_Remove(entity player) if(!squad) return; + WaypointSprite_Kill(player.br_allywaypoint); --squad.br_squad_members; entity member_next = player.br_squad_next; diff --git a/qcsrc/common/mutators/mutator/waypoints/all.inc b/qcsrc/common/mutators/mutator/waypoints/all.inc index 656273f6a..1356edd5b 100644 --- a/qcsrc/common/mutators/mutator/waypoints/all.inc +++ b/qcsrc/common/mutators/mutator/waypoints/all.inc @@ -62,6 +62,8 @@ const vector WP_BR_REVIVING_COLOR = '0.2 0.8 0.2'; REGISTER_WAYPOINT(BRBleeding, _("Bleeding!"), "", WP_BR_BLEEDING_COLOR, 1); REGISTER_WAYPOINT(BRReviving, _("Reviving"), "", WP_BR_REVIVING_COLOR, 1); +REGISTER_WAYPOINT(BRAlly, _("Ally"), "", '1 0.5 0', 1); + REGISTER_WAYPOINT(Weapon, _("Weapon"), "", '0 0 0', 1); REGISTER_WAYPOINT(Monster, _("Monster"), "", '1 0 0', 1);