]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc
Split the gamelog code out of miscfunctions and into its own file
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / domination / sv_domination.qc
index 751d23aa10639fc4956dfa4fb75136e7445f9233..6e333c17e119e81f75291b611b4f75fc11a4be3c 100644 (file)
@@ -1,5 +1,6 @@
 #include "sv_domination.qh"
 
+#include <server/gamelog.qh>
 #include <server/teamplay.qh>
 
 bool g_domination;
@@ -69,10 +70,12 @@ void dompoint_captured(entity this)
                this.enemy = NULL;
 
        if (head.noise != "")
+       {
                if(this.enemy)
                        _sound(this.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
                else
                        _sound(this, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
+       }
        if (head.noise1 != "")
                play2all(head.noise1);
 
@@ -188,7 +191,7 @@ void dompointtouch(entity this, entity toucher)
 {
        if(!IS_PLAYER(toucher))
                return;
-       if(GetResourceAmount(toucher, RESOURCE_HEALTH) < 1)
+       if(GetResource(toucher, RES_HEALTH) < 1)
                return;
 
        if(round_handler_IsActive() && !round_handler_IsRoundStarted())
@@ -344,7 +347,7 @@ int Domination_GetWinnerTeam()
        return -1; // no control points left?
 }
 
-float Domination_CheckWinner()
+bool Domination_CheckWinner()
 {
        if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
        {
@@ -353,7 +356,7 @@ float Domination_CheckWinner()
 
                game_stopped = true;
                round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit);
-               return 1;
+               return true;
        }
 
        Domination_count_controlpoints();
@@ -361,7 +364,7 @@ float Domination_CheckWinner()
        float winner_team = Domination_GetWinnerTeam();
 
        if(winner_team == -1)
-               return 0;
+               return false;
 
        if(winner_team > 0)
        {
@@ -378,12 +381,12 @@ float Domination_CheckWinner()
        game_stopped = true;
        round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit);
 
-       return 1;
+       return true;
 }
 
-float Domination_CheckPlayers()
+bool Domination_CheckPlayers()
 {
-       return 1;
+       return true;
 }
 
 void Domination_RoundStart()
@@ -399,9 +402,9 @@ void havocbot_goalrating_controlpoints(entity this, float ratingscale, vector or
                if(it.cnt > -1) // this is just being fought
                        navigation_routerating(this, it, ratingscale, 5000);
                else if(it.goalentity.cnt == 0) // unclaimed
-                       navigation_routerating(this, it, ratingscale * 0.5, 5000);
+                       navigation_routerating(this, it, ratingscale, 5000);
                else if(it.goalentity.team != this.team) // other team's point
-                       navigation_routerating(this, it, ratingscale * 0.2, 5000);
+                       navigation_routerating(this, it, ratingscale, 5000);
        });
 }
 
@@ -414,8 +417,8 @@ void havocbot_role_dom(entity this)
        {
                navigation_goalrating_start(this);
                havocbot_goalrating_controlpoints(this, 10000, this.origin, 15000);
-               havocbot_goalrating_items(this, 8000, this.origin, 8000);
-               //havocbot_goalrating_enemyplayers(this, 3000, this.origin, 2000);
+               havocbot_goalrating_items(this, 20000, this.origin, 8000);
+               //havocbot_goalrating_enemyplayers(this, 1500, this.origin, 2000);
                havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
                navigation_goalrating_end(this);
 
@@ -466,10 +469,7 @@ MUTATOR_HOOKFUNCTION(dom, PlayerSpawn)
        entity player = M_ARGV(0, entity);
 
        if(domination_roundbased)
-       if(!round_handler_IsRoundStarted())
-               player.player_blocked = 1;
-       else
-               player.player_blocked = 0;
+               player.player_blocked = !round_handler_IsRoundStarted();
 }
 
 MUTATOR_HOOKFUNCTION(dom, ClientConnect)