X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fdomination.qc;h=3406d11711be6bb0cf684cbb5dc6d3dfac14ea2d;hb=07569cd6cb3b1774f3337c963e2af0c80809bc7e;hp=d87d8419b25b5302d127ecd49780191e1601d3d0;hpb=0e7ed909bffb4ff21f0c68d163edfc17487e380a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/domination.qc b/qcsrc/server/domination.qc index d87d8419b..3406d1171 100644 --- a/qcsrc/server/domination.qc +++ b/qcsrc/server/domination.qc @@ -17,6 +17,9 @@ Note: The only teams who can use dom control points are identified by spawnfunc_ #define DOMPOINTFRAGS frags +float g_domination_point_amt; +float g_domination_point_rate; + .float enemy_playerid; .entity sprite; .float captime; @@ -63,7 +66,22 @@ void dompoint_captured () //bprint(self.message); //bprint("\n"); - bprint("^3", head.netname, "^3", self.message, "\n"); + float points, wait_time; + if (g_domination_point_amt) + points = g_domination_point_amt; + else + points = self.frags; + if (g_domination_point_rate) + wait_time = g_domination_point_rate; + else + wait_time = self.wait; + + bprint("^3", head.netname, "^3", self.message); + if (points > 1) + bprint(" ^7(", ftos(points), " points every ", ftos(wait_time), " seconds)\n"); + else + bprint(" ^7(", ftos(points), " point every ", ftos(wait_time), " seconds)\n"); + if(self.enemy.playerid == self.enemy_playerid) PlayerScore_Add(self.enemy, SP_DOM_TAKES, 1); else @@ -80,10 +98,7 @@ void dompoint_captured () //self.nextthink = time + cvar("g_domination_point_rate"); //self.think = dompointthink; - if(cvar("g_domination_point_rate")) - self.delay = time + cvar("g_domination_point_rate"); - else - self.delay = time + self.wait; + self.delay = time + wait_time; // do trigger work old_delay = self.delay; @@ -131,7 +146,6 @@ void AnimateDomPoint() void dompointthink() { - local float waittime; local float fragamt; self.nextthink = time + 0.1; @@ -146,17 +160,21 @@ void dompointthink() if (gameover || self.delay > time || time < game_starttime) // game has ended, don't keep giving points return; - waittime = cvar("g_domination_point_rate"); - if(!waittime) - waittime = self.wait; - self.delay = time + waittime; + g_domination_point_rate = cvar("g_domination_point_rate"); + g_domination_point_amt = cvar("g_domination_point_amt"); + + if(g_domination_point_rate) + self.delay = time + g_domination_point_rate; + else + self.delay = time + self.wait; // give credit to the team // NOTE: this defaults to 0 if (self.goalentity.netname != "") { - fragamt = cvar("g_domination_point_amt"); - if(!fragamt) + if(g_domination_point_amt) + fragamt = g_domination_point_amt; + else fragamt = self.DOMPOINTFRAGS; TeamScore_AddToTeam(self.goalentity.team, ST_SCORE, fragamt); TeamScore_AddToTeam(self.goalentity.team, ST_DOM_TICKS, fragamt);