]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc
Merge branch 'master' into terencehill/glowmod_color_fix
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / domination / sv_domination.qc
index 751d23aa10639fc4956dfa4fb75136e7445f9233..4c208465657777e9b3c800fd45c5f8586d623ff1 100644 (file)
@@ -1,6 +1,14 @@
 #include "sv_domination.qh"
 
+#include <server/client.qh>
+#include <server/command/vote.qh>
+#include <server/damage.qh>
+#include <server/gamelog.qh>
+#include <server/items/items.qh>
 #include <server/teamplay.qh>
+#include <server/world.qh>
+#include <common/mapobjects/platforms.qh>
+#include <common/mapobjects/triggers.qh>
 
 bool g_domination;
 
@@ -69,10 +77,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 +198,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 +354,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 +363,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 +371,7 @@ float Domination_CheckWinner()
        float winner_team = Domination_GetWinnerTeam();
 
        if(winner_team == -1)
-               return 0;
+               return false;
 
        if(winner_team > 0)
        {
@@ -378,12 +388,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 +409,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 +424,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 +476,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)
@@ -549,7 +556,6 @@ spawnfunc(dom_team)
                precache_sound(this.noise);
        if (this.noise1 != "")
                precache_sound(this.noise1);
-       this.classname = "dom_team";
        _setmodel(this, this.model); // precision not needed
        this.mdl = this.model;
        this.dmg = this.modelindex;
@@ -614,7 +620,6 @@ void dom_spawnteam(string teamname, float teamcolor, string pointmodel, float po
 void dom_spawnpoint(vector org)
 {
        entity e = spawn();
-       e.classname = "dom_controlpoint";
        setthink(e, spawnfunc_dom_controlpoint);
        e.nextthink = time;
        setorigin(e, org);