#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;
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);
{
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())
});
}
-int Domination_GetWinnerTeam()
-{
- int winner_team = 0;
- if (Team_GetNumberOfControlPoints(Team_GetTeamFromIndex(1)) ==
- total_control_points)
- {
- winner_team = NUM_TEAM_1;
- }
- for (int i = 2; i <= NUM_TEAMS; ++i)
- {
- if (Team_GetNumberOfControlPoints(Team_GetTeamFromIndex(i)) ==
- total_control_points)
- {
- if (winner_team != 0)
- {
- return 0;
- }
- winner_team = Team_IndexToTeam(i);
- }
- }
- if (winner_team)
- {
- return winner_team;
- }
- return -1; // no control points left?
-}
-
bool Domination_CheckWinner()
{
if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
}
Domination_count_controlpoints();
-
- float winner_team = Domination_GetWinnerTeam();
-
- if(winner_team == -1)
- return false;
+ int winner_team = Team_GetWinnerTeam_WIthControlPoints(total_control_points);
+ if (winner_team == -1)
+ return 0;
if(winner_team > 0)
{
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
TeamScore_AddToTeam(winner_team, ST_DOM_CAPS, +1);
}
- else if(winner_team == -1)
- {
- Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED);
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
- }
game_stopped = true;
round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit);
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)
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;
void dom_spawnpoint(vector org)
{
entity e = spawn();
- e.classname = "dom_controlpoint";
setthink(e, spawnfunc_dom_controlpoint);
e.nextthink = time;
setorigin(e, org);
void dom_Initialize()
{
g_domination = true;
+ g_dompoints = IL_NEW();
+
InitializeEntity(NULL, dom_DelayedInit, INITPRIO_GAMETYPE);
}