void dom_EventLog(string mode, float team_before, entity actor) // use an alias for easy changing and quick editing later
{
if(autocvar_sv_eventlog)
void dom_EventLog(string mode, float team_before, entity actor) // use an alias for easy changing and quick editing later
{
if(autocvar_sv_eventlog)
- GameLogEcho(strcat(":dom:", mode, ":", ftos(team_before), ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
+ GameLogEcho(strcat(":dom:", mode, ":", ftos(team_before), ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : "")));
float old_delay, old_team, real_team;
// now that the delay has expired, switch to the latest team to lay claim to this point
float old_delay, old_team, real_team;
// now that the delay has expired, switch to the latest team to lay claim to this point
- dom_EventLog("taken", self.team, self.dmg_inflictor);
- self.dmg_inflictor = world;
+ dom_EventLog("taken", this.team, this.dmg_inflictor);
+ this.dmg_inflictor = NULL;
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_DOMINATION_CAPTURE_TIME, head.netname, self.message, points, wait_time);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_DOMINATION_CAPTURE_TIME, head.netname, this.message, points, wait_time);
- if(self.enemy.playerid == self.enemy_playerid)
- PlayerScore_Add(self.enemy, SP_DOM_TAKES, 1);
+ if(this.enemy.playerid == this.enemy_playerid)
+ PlayerScore_Add(this.enemy, SP_DOM_TAKES, 1);
- if(self.enemy)
- _sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
+ if(this.enemy)
+ _sound(this.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
- _sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
+ _sound(this, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
- old_delay = self.delay;
- old_team = self.team;
- self.team = real_team;
- self.delay = 0;
- SUB_UseTargets (self, self, NULL);
- self.delay = old_delay;
- self.team = old_team;
+ old_delay = this.delay;
+ old_team = this.team;
+ this.team = real_team;
+ this.delay = 0;
+ SUB_UseTargets (this, this, NULL);
+ this.delay = old_delay;
+ this.team = old_team;
- WaypointSprite_UpdateSprites(self.sprite, msg, WP_Null, WP_Null);
+ WaypointSprite_UpdateSprites(this.sprite, msg, WP_Null, WP_Null);
total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
FOREACH_ENTITY_CLASS("dom_controlpoint", true, LAMBDA(
if (autocvar_g_domination_point_amt)
points = autocvar_g_domination_point_amt;
FOREACH_ENTITY_CLASS("dom_controlpoint", true, LAMBDA(
if (autocvar_g_domination_point_amt)
points = autocvar_g_domination_point_amt;
- WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, colormapPaletteColor(self.goalentity.team - 1, 0));
- WaypointSprite_Ping(self.sprite);
+ WaypointSprite_UpdateTeamRadar(this.sprite, RADARICON_DOMPOINT, colormapPaletteColor(this.goalentity.team - 1, 0));
+ WaypointSprite_Ping(this.sprite);
- self.pain_finished = time + self.t_width;
- if(self.nextthink > self.pain_finished)
- self.nextthink = self.pain_finished;
+ this.pain_finished = time + this.t_width;
+ if(this.nextthink > this.pain_finished)
+ this.nextthink = this.pain_finished;
// give credit to the team
// NOTE: this defaults to 0
if (!domination_roundbased)
// give credit to the team
// NOTE: this defaults to 0
if (!domination_roundbased)
- fragamt = self.frags;
- TeamScore_AddToTeam(self.goalentity.team, ST_SCORE, fragamt);
- TeamScore_AddToTeam(self.goalentity.team, ST_DOM_TICKS, fragamt);
+ fragamt = this.frags;
+ TeamScore_AddToTeam(this.goalentity.team, ST_SCORE, fragamt);
+ TeamScore_AddToTeam(this.goalentity.team, ST_DOM_TICKS, fragamt);
- PlayerScore_Add(self.enemy, SP_SCORE, fragamt);
- PlayerScore_Add(self.enemy, SP_DOM_TICKS, fragamt);
+ PlayerScore_Add(this.enemy, SP_SCORE, fragamt);
+ PlayerScore_Add(this.enemy, SP_DOM_TICKS, fragamt);
while (head && head.team != other.team)
head = find(head, classname, "dom_team");
while (head && head.team != other.team)
head = find(head, classname, "dom_team");
- // self.state = 1;
- // self.delay = time + cvar("g_domination_point_capturetime");
- //self.nextthink = time + cvar("g_domination_point_capturetime");
- //self.think = dompoint_captured;
+ // this.state = 1;
+ // this.delay = time + cvar("g_domination_point_capturetime");
+ //this.nextthink = time + cvar("g_domination_point_capturetime");
+ //this.think = dompoint_captured;
while (head && head.netname != "")
head = find(head, classname, "dom_team");
while (head && head.netname != "")
head = find(head, classname, "dom_team");
- WaypointSprite_UpdateSprites(self.sprite, WP_DomNeut, WP_Null, WP_Null);
- WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, '0 1 1');
- WaypointSprite_Ping(self.sprite);
+ WaypointSprite_UpdateSprites(this.sprite, WP_DomNeut, WP_Null, WP_Null);
+ WaypointSprite_UpdateTeamRadar(this.sprite, RADARICON_DOMPOINT, '0 1 1');
+ WaypointSprite_Ping(this.sprite);
- self.enemy = other; // individual player scoring
- self.enemy_playerid = other.playerid;
- dompoint_captured();
+ this.enemy = other; // individual player scoring
+ this.enemy_playerid = other.playerid;
+ dompoint_captured(this);
}
void dom_controlpoint_setup(entity this)
{
entity head;
// find the spawnfunc_dom_team representing unclaimed points
}
void dom_controlpoint_setup(entity this)
{
entity head;
// find the spawnfunc_dom_team representing unclaimed points
while(head && head.netname != "")
head = find(head, classname, "dom_team");
if (!head)
while(head && head.netname != "")
head = find(head, classname, "dom_team");
if (!head)
- self.goalentity = head;
- _setmodel(self, head.mdl); // precision already set
- self.skin = head.skin;
+ this.goalentity = head;
+ _setmodel(this, head.mdl); // precision already set
+ this.skin = head.skin;
- if(!self.t_width)
- self.t_width = 0.02; // frame animation rate
- if(!self.t_length)
- self.t_length = 239; // maximum frame
-
- setthink(self, dompointthink);
- self.nextthink = time;
- settouch(self, dompointtouch);
- self.solid = SOLID_TRIGGER;
- self.flags = FL_ITEM;
- setsize(self, '-32 -32 -32', '32 32 32');
- setorigin(self, self.origin + '0 0 20');
- droptofloor();
-
- waypoint_spawnforitem(self);
- WaypointSprite_SpawnFixed(WP_DomNeut, self.origin + '0 0 32', self, sprite, RADARICON_DOMPOINT);
+ if(!this.t_width)
+ this.t_width = 0.02; // frame animation rate
+ if(!this.t_length)
+ this.t_length = 239; // maximum frame
+
+ setthink(this, dompointthink);
+ this.nextthink = time;
+ settouch(this, dompointtouch);
+ this.solid = SOLID_TRIGGER;
+ this.flags = FL_ITEM;
+ setsize(this, '-32 -32 -32', '32 32 32');
+ setorigin(this, this.origin + '0 0 20');
+ droptofloor(this);
+
+ waypoint_spawnforitem(this);
+ WaypointSprite_SpawnFixed(WP_DomNeut, this.origin + '0 0 32', this, sprite, RADARICON_DOMPOINT);
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
+ 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)
{
TeamScore_AddToTeam(winner_team, ST_DOM_CAPS, +1);
}
else if(winner_team == -1)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
- ret_float = domination_teams;
- ret_string = "dom_team";
+ M_ARGV(0, float) = domination_teams;
+ string ret_string = "dom_team";
void dom_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up.
{
// if no teams are found, spawn defaults
void dom_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up.
{
// if no teams are found, spawn defaults
{
LOG_TRACE("No \"dom_team\" entities found on this map, creating them anyway.\n");
domination_teams = bound(2, ((autocvar_g_domination_teams_override < 2) ? autocvar_g_domination_default_teams : autocvar_g_domination_teams_override), 4);
dom_spawnteams(domination_teams);
}
{
LOG_TRACE("No \"dom_team\" entities found on this map, creating them anyway.\n");
domination_teams = bound(2, ((autocvar_g_domination_teams_override < 2) ? autocvar_g_domination_default_teams : autocvar_g_domination_teams_override), 4);
dom_spawnteams(domination_teams);
}
domination_teams = ((c4>=0) ? 4 : (c3>=0) ? 3 : 2);
domination_roundbased = autocvar_g_domination_roundbased;
domination_teams = ((c4>=0) ? 4 : (c3>=0) ? 3 : 2);
domination_roundbased = autocvar_g_domination_roundbased;