}
void dompoint_captured ()
-{
+{SELFPARAM();
entity head;
float old_delay, old_team, real_team;
- string msg = "dom-neut";
// now that the delay has expired, switch to the latest team to lay claim to this point
head = self.owner;
if (head.noise != "")
if(self.enemy)
- sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
+ _sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
else
- sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
+ _sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
if (head.noise1 != "")
play2all(head.noise1);
self.delay = old_delay;
self.team = old_team;
+ entity msg = WP_DomNeut;
switch(self.team)
{
- case NUM_TEAM_1: msg = "dom-red"; break;
- case NUM_TEAM_2: msg = "dom-blue"; break;
- case NUM_TEAM_3: msg = "dom-yellow"; break;
- case NUM_TEAM_4: msg = "dom-pink"; break;
+ case NUM_TEAM_1: msg = WP_DomRed; break;
+ case NUM_TEAM_2: msg = WP_DomBlue; break;
+ case NUM_TEAM_3: msg = WP_DomYellow; break;
+ case NUM_TEAM_4: msg = WP_DomPink; break;
}
- WaypointSprite_UpdateSprites(self.sprite, msg, "", "");
+ WaypointSprite_UpdateSprites(self.sprite, msg, WP_Null, WP_Null);
total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
for(head = world; (head = find(head, classname, "dom_controlpoint")) != world; )
}
void AnimateDomPoint()
-{
+{SELFPARAM();
if(self.pain_finished > time)
return;
self.pain_finished = time + self.t_width;
}
void dompointthink()
-{
+{SELFPARAM();
float fragamt;
self.nextthink = time + 0.1;
}
void dompointtouch()
-{
+{SELFPARAM();
entity head;
if (!IS_PLAYER(other))
return;
if(head == world)
return;
- WaypointSprite_UpdateSprites(self.sprite, "dom-neut", "", "");
+ WaypointSprite_UpdateSprites(self.sprite, WP_DomNeut, WP_Null, WP_Null);
WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, '0 1 1');
WaypointSprite_Ping(self.sprite);
}
void dom_controlpoint_setup()
-{
+{SELFPARAM();
entity head;
// find the spawnfunc_dom_team representing unclaimed points
head = find(world, classname, "dom_team");
// copy important properties from spawnfunc_dom_team entity
self.goalentity = head;
- setmodel(self, head.mdl); // precision already set
+ _setmodel(self, head.mdl); // precision already set
self.skin = head.skin;
self.cnt = -1;
droptofloor();
waypoint_spawnforitem(self);
- WaypointSprite_SpawnFixed("dom-neut", self.origin + '0 0 32', self, sprite, RADARICON_DOMPOINT, '0 1 1');
+ WaypointSprite_SpawnFixed(WP_DomNeut, self.origin + '0 0 32', self, sprite, RADARICON_DOMPOINT);
}
float total_controlpoints, redowned, blueowned, yellowowned, pinkowned;
//go to best items, or control points you don't own
void havocbot_role_dom()
-{
+{SELFPARAM();
if(self.deadflag != DEAD_NO)
return;
}
MUTATOR_HOOKFUNCTION(dom_ResetMap)
-{
+{SELFPARAM();
total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
- FOR_EACH_PLAYER(self)
+ entity e;
+ FOR_EACH_PLAYER(e)
{
+ setself(e);
PutClientInServer();
self.player_blocked = 1;
if(IS_REAL_CLIENT(self))
}
MUTATOR_HOOKFUNCTION(dom_PlayerSpawn)
-{
+{SELFPARAM();
if(domination_roundbased)
if(!round_handler_IsRoundStarted())
self.player_blocked = 1;
}
MUTATOR_HOOKFUNCTION(dom_ClientConnect)
-{
+{SELFPARAM();
set_dom_state(self);
return false;
}
MUTATOR_HOOKFUNCTION(dom_BotRoles)
-{
+{SELFPARAM();
self.havocbot_role = havocbot_role_dom;
return true;
}
Control point for Domination gameplay.
*/
void spawnfunc_dom_controlpoint()
-{
+{SELFPARAM();
if(!g_domination)
{
remove(self);
*/
void spawnfunc_dom_team()
-{
+{SELFPARAM();
if(!g_domination || autocvar_g_domination_teams_override >= 2)
{
remove(self);
if (self.noise1 != "")
precache_sound(self.noise1);
self.classname = "dom_team";
- setmodel(self, self.model); // precision not needed
+ _setmodel(self, self.model); // precision not needed
self.mdl = self.model;
self.dmg = self.modelindex;
self.model = "";
// code from here on is just to support maps that don't have control point and team entities
void dom_spawnteam (string teamname, float teamcolor, string pointmodel, float pointskin, string capsound, string capnarration, string capmessage)
-{
- entity oldself;
- oldself = self;
- self = spawn();
+{SELFPARAM();
+ setself(spawn());
self.classname = "dom_team";
self.netname = teamname;
self.cnt = teamcolor;
self.message = capmessage;
// this code is identical to spawnfunc_dom_team
- setmodel(self, self.model); // precision not needed
+ _setmodel(self, self.model); // precision not needed
self.mdl = self.model;
self.dmg = self.modelindex;
self.model = "";
self.team = self.cnt + 1;
//eprint(self);
- self = oldself;
+ setself(this);
}
void dom_spawnpoint(vector org)
-{
- entity oldself;
- oldself = self;
- self = spawn();
+{SELFPARAM();
+ setself(spawn());
self.classname = "dom_controlpoint";
self.think = spawnfunc_dom_controlpoint;
self.nextthink = time;
setorigin(self, org);
spawnfunc_dom_controlpoint();
- self = oldself;
+ setself(this);
}
// spawn some default teams if the map is not set up for domination
void dom_spawnteams(float teams)
{
- dom_spawnteam("Red", NUM_TEAM_1-1, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point");
- dom_spawnteam("Blue", NUM_TEAM_2-1, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point");
+ dom_spawnteam("Red", NUM_TEAM_1-1, "models/domination/dom_red.md3", 0, SND(DOM_CLAIM), "", "Red team has captured a control point");
+ dom_spawnteam("Blue", NUM_TEAM_2-1, "models/domination/dom_blue.md3", 0, SND(DOM_CLAIM), "", "Blue team has captured a control point");
if(teams >= 3)
- dom_spawnteam("Yellow", NUM_TEAM_3-1, "models/domination/dom_yellow.md3", 0, "domination/claim.wav", "", "Yellow team has captured a control point");
+ dom_spawnteam("Yellow", NUM_TEAM_3-1, "models/domination/dom_yellow.md3", 0, SND(DOM_CLAIM), "", "Yellow team has captured a control point");
if(teams >= 4)
- dom_spawnteam("Pink", NUM_TEAM_4-1, "models/domination/dom_pink.md3", 0, "domination/claim.wav", "", "Pink team has captured a control point");
+ dom_spawnteam("Pink", NUM_TEAM_4-1, "models/domination/dom_pink.md3", 0, SND(DOM_CLAIM), "", "Pink team has captured a control point");
dom_spawnteam("", 0, "models/domination/dom_unclaimed.md3", 0, "", "", "");
}
// if no teams are found, spawn defaults
if(find(world, classname, "dom_team") == world || autocvar_g_domination_teams_override >= 2)
{
- print("No ""dom_team"" entities found on this map, creating them anyway.\n");
+ LOG_INFO("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);
}
void dom_Initialize()
{
- precache_model("models/domination/dom_red.md3");
- precache_model("models/domination/dom_blue.md3");
- precache_model("models/domination/dom_yellow.md3");
- precache_model("models/domination/dom_pink.md3");
- precache_model("models/domination/dom_unclaimed.md3");
- precache_sound("domination/claim.wav");
-
InitializeEntity(world, dom_DelayedInit, INITPRIO_GAMETYPE);
}
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}