]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
show waypoints if squadmates in battle royale are too far away
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Thu, 27 Jan 2022 18:21:03 +0000 (19:21 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Thu, 27 Jan 2022 18:21:03 +0000 (19:21 +0100)
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/br/sv_br.qc
qcsrc/common/gamemodes/gamemode/br/sv_br.qh
qcsrc/common/gamemodes/gamemode/br/sv_squad.qc
qcsrc/common/mutators/mutator/waypoints/all.inc

index 70c754afa8527ba7bc87f68178ae03ddbe5941f5..a9cd7ed914ca82e971ccc348f561cd9632e10010 100644 (file)
@@ -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"
index 29e914bf1bae503360b5bd8941e1cca5a0e6c58e..df8e33a15fbae512ee9a5b684c92f0b31af47a48 100644 (file)
@@ -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;
index 38478c5e88374acc18cdd02fbc9306804cd91cc5..d14442783e73a652763fda406bb68c3673b01d61 100644 (file)
@@ -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;
index 3e18f1aac2f537d814a767cd46c9b2956288e4d4..60cc3277a11162fe985c1e73808ab517c99ee13b 100644 (file)
@@ -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;
index 656273f6a7820af0c29f86a0c2016a88f3baa75a..1356edd5b2d342a731f0fc89e5d499bf07bb3cc6 100644 (file)
@@ -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);