]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Show autorevival progress of frozen players as waypoint health bar rather than normal...
authorterencehill <piuntn@gmail.com>
Fri, 12 Jun 2020 21:38:54 +0000 (23:38 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 12 Jun 2020 21:38:54 +0000 (23:38 +0200)
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc

index fba19aabae067407635f874fe69ece0aae11a4c7..9a47eea2ed5d3069290a5a752247b4702f33334c 100644 (file)
@@ -374,7 +374,7 @@ set g_freezetag_revive_nade_health 40 "Amount of health player has if they reviv
 set g_freezetag_round_timelimit 360 "round time limit in seconds"
 set g_freezetag_revive_auto 1 "automatically revive frozen players after some time (g_freezetag_frozen_maxtime)"
 set g_freezetag_revive_auto_progress 1 "start the automatic reviving progress as soon as the player gets frozen"
-set g_freezetag_revive_auto_reducible 1 "reduce auto-revival time when frozen players are hit by enemies; if cvar value is negative reduce time even when they are hit by teammates"
+set g_freezetag_revive_auto_reducible 1 "reduce auto-revival time when frozen players are hit by enemies; set to -1 to reduce it even when they are hit by teammates"
 set g_freezetag_revive_auto_reducible_forcefactor 0.025 "hit force to time reduction conversion factor"
 set g_freezetag_frozen_maxtime 60 "frozen players will be automatically unfrozen after this time in seconds"
 set g_freezetag_teams_override 0
index 2a931fa975f8931b7b6759e5b7a4500033e93d91..98b20f32adbfbb8faeb4f22af5b0813b924ed8a7 100644 (file)
@@ -540,22 +540,19 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
        if (!n) // no teammate nearby
        {
                if (STAT(FROZEN, player) == FROZEN_NORMAL)
-               {
                        STAT(REVIVE_PROGRESS, player) = bound(base_progress, STAT(REVIVE_PROGRESS, player) - frametime * autocvar_g_freezetag_revive_clearspeed * (1 - base_progress), 1);
-                       SetResourceExplicit(player, RES_HEALTH, max(1, STAT(REVIVE_PROGRESS, player) * ((warmup_stage) ? warmup_start_health : start_health)));
-               }
                else if (!STAT(FROZEN, player))
                        STAT(REVIVE_PROGRESS, player) = base_progress; // thawing nobody
        }
        else if (STAT(FROZEN, player) == FROZEN_NORMAL) // OK, there is at least one teammate reviving us
        {
                STAT(REVIVE_PROGRESS, player) = bound(base_progress, STAT(REVIVE_PROGRESS, player) + frametime * max(1/60, autocvar_g_freezetag_revive_speed * (1 - base_progress)), 1);
-               SetResourceExplicit(player, RES_HEALTH, max(1, STAT(REVIVE_PROGRESS, player) * ((warmup_stage) ? warmup_start_health : start_health)));
 
                if(STAT(REVIVE_PROGRESS, player) >= 1)
                {
                        float frozen_time = time - player.freezetag_frozen_time;
                        Unfreeze(player, false);
+                       SetResourceExplicit(player, RES_HEALTH, ((warmup_stage) ? warmup_start_health : start_health));
                        freezetag_count_alive_players();
 
                        if(n == -1)
@@ -583,6 +580,12 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
                        STAT(REVIVE_PROGRESS, it) = STAT(REVIVE_PROGRESS, player);
        }
 
+       if (STAT(FROZEN, player) == FROZEN_NORMAL)
+       {
+               WaypointSprite_UpdateMaxHealth(player.waypointsprite_attached, 1);
+               WaypointSprite_UpdateHealth(player.waypointsprite_attached, STAT(REVIVE_PROGRESS, player));
+       }
+
        return true;
 }