]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_freezetag.qc
Merged master
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_freezetag.qc
index cec7d950e9076cdecfc573fdaeafe9be16f409e2..811614c21b9d5771f89b91db197f0742a8de7c27 100644 (file)
@@ -110,6 +110,7 @@ float freezetag_CheckWinner()
                        it.freezetag_frozen_timeout = 0;
                        nades_Clear(it);
                ));
+               game_stopped = true;
                round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
                return 1;
        }
@@ -134,6 +135,8 @@ float freezetag_CheckWinner()
                it.freezetag_frozen_timeout = 0;
                nades_Clear(it);
        ));
+
+       game_stopped = true;
        round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
        return 1;
 }
@@ -222,6 +225,7 @@ void(entity this) havocbot_role_ft_offense;
 
 void havocbot_goalrating_freeplayers(entity this, float ratingscale, vector org, float sradius)
 {
+       float t;
        FOREACH_CLIENT(IS_PLAYER(it) && it != this && SAME_TEAM(it, this), LAMBDA(
                if (STAT(FROZEN, it) == 1)
                {
@@ -229,11 +233,12 @@ void havocbot_goalrating_freeplayers(entity this, float ratingscale, vector org,
                                continue;
                        navigation_routerating(this, it, ratingscale, 2000);
                }
-               else
+               else if(vdist(it.origin - org, >, 400)) // avoid gathering all teammates in one place
                {
                        // If teamate is not frozen still seek them out as fight better
                        // in a group.
-                       navigation_routerating(this, it, ratingscale/3, 2000);
+                       t = 0.2 * 150 / (this.health + this.armorvalue);
+                       navigation_routerating(this, it, t * ratingscale, 2000);
                }
        ));
 }
@@ -267,7 +272,7 @@ void havocbot_role_ft_offense(entity this)
                havocbot_goalrating_items(this, 10000, this.origin, 10000);
                havocbot_goalrating_enemyplayers(this, 20000, this.origin, 10000);
                havocbot_goalrating_freeplayers(this, 9000, this.origin, 10000);
-               //havocbot_goalrating_waypoints(1, this.origin, 1000);
+               havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
                navigation_goalrating_end(this);
        }
 }
@@ -296,7 +301,7 @@ void havocbot_role_ft_freeing(entity this)
                havocbot_goalrating_items(this, 8000, this.origin, 10000);
                havocbot_goalrating_enemyplayers(this, 10000, this.origin, 10000);
                havocbot_goalrating_freeplayers(this, 20000, this.origin, 10000);
-               //havocbot_goalrating_waypoints(1, this.origin, 1000);
+               havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
                navigation_goalrating_end(this);
        }
 }
@@ -412,7 +417,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerSpawn)
 MUTATOR_HOOKFUNCTION(ft, reset_map_players)
 {
        FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-               it.killcount = 0;
+               CS(it).killcount = 0;
                it.freezetag_frozen_timeout = -1;
                PutClientInServer(it);
                it.freezetag_frozen_timeout = 0;
@@ -429,7 +434,7 @@ MUTATOR_HOOKFUNCTION(ft, GiveFragsForKill, CBC_ORDER_FIRST)
 
 MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
 {
-       if(gameover)
+       if(game_stopped)
                return true;
 
        if(round_handler_IsActive())
@@ -563,8 +568,8 @@ MUTATOR_HOOKFUNCTION(ft, FragCenterMessage)
        if(STAT(FROZEN, frag_target))
                return; // target was already frozen, so this is just pushing them off the cliff
 
-       Send_Notification(NOTIF_ONE, frag_attacker, MSG_CHOICE, CHOICE_FRAG_FREEZE, frag_target.netname, kill_count_to_attacker, (IS_BOT_CLIENT(frag_target) ? -1 : frag_target.ping));
-       Send_Notification(NOTIF_ONE, frag_target, MSG_CHOICE, CHOICE_FRAGGED_FREEZE, frag_attacker.netname, kill_count_to_target, frag_attacker.health, frag_attacker.armorvalue, (IS_BOT_CLIENT(frag_attacker) ? -1 : frag_attacker.ping));
+       Send_Notification(NOTIF_ONE, frag_attacker, MSG_CHOICE, CHOICE_FRAG_FREEZE, frag_target.netname, kill_count_to_attacker, (IS_BOT_CLIENT(frag_target) ? -1 : CS(frag_target).ping));
+       Send_Notification(NOTIF_ONE, frag_target, MSG_CHOICE, CHOICE_FRAGGED_FREEZE, frag_attacker.netname, kill_count_to_target, frag_attacker.health, frag_attacker.armorvalue, (IS_BOT_CLIENT(frag_attacker) ? -1 : CS(frag_attacker).ping));
 
        return true;
 }