PlayerScore_Clear(e);
}
-void dom_init();
-void runematch_init();
void tdm_init();
void entcs_init();
ActivateTeamplay();
fraglimit_override = autocvar_g_domination_point_limit;
leadlimit_override = autocvar_g_domination_point_leadlimit;
- dom_init();
+ MUTATOR_ADD(gamemode_domination);
have_team_spawns = -1; // request team spawns
}
have_team_spawns = -1; // request team spawns
}
- if(g_runematch)
- {
- // ActivateTeamplay();
- fraglimit_override = autocvar_g_runematch_point_limit;
- leadlimit_override = autocvar_g_runematch_point_leadlimit;
- runematch_init();
- }
-
if(g_lms)
{
fraglimit_override = autocvar_g_lms_lives_override;
leadlimit_override = 0; // not supported by LMS
if(fraglimit_override == 0)
fraglimit_override = -1;
- lms_lowest_lives = 9999;
- lms_next_place = 0;
- ScoreRules_lms();
+ MUTATOR_ADD(gamemode_lms);
}
if(g_arena)
{
fraglimit_override = autocvar_g_arena_point_limit;
leadlimit_override = autocvar_g_arena_point_leadlimit;
- maxspawned = autocvar_g_arena_maxspawned;
- if(maxspawned < 2)
- maxspawned = 2;
- arena_roundbased = autocvar_g_arena_roundbased;
+ MUTATOR_ADD(gamemode_arena);
}
if(g_ca)
ActivateTeamplay();
fraglimit_override = autocvar_g_ca_point_limit;
leadlimit_override = autocvar_g_ca_point_leadlimit;
- precache_sound("ctf/red_capture.wav");
- precache_sound("ctf/blue_capture.wav");
+ MUTATOR_ADD(gamemode_ca);
}
+
if(g_keyhunt)
{
ActivateTeamplay();
if(g_assault)
{
ActivateTeamplay();
- ScoreRules_assault();
+ MUTATOR_ADD(gamemode_assault);
have_team_spawns = -1; // request team spawns
}
ret_string = "";
MUTATOR_CALLHOOK(BuildMutatorsPrettyString);
modifications = ret_string;
-
- if(g_minstagib)
- modifications = strcat(modifications, ", MinstaGib");
+
if(g_weaponarena)
{
if(g_weaponarena_random)
float _color;
if(t == 4)
- _color = FL_TEAM_4 - 1;
+ _color = NUM_TEAM_4 - 1;
else if(t == 3)
- _color = FL_TEAM_3 - 1;
+ _color = NUM_TEAM_3 - 1;
else if(t == 2)
- _color = FL_TEAM_2 - 1;
+ _color = NUM_TEAM_2 - 1;
else
- _color = FL_TEAM_1 - 1;
+ _color = NUM_TEAM_1 - 1;
SetPlayerColors(pl,_color);
head = findchain(classname, "onslaught_generator");
while (head)
{
- if (head.team == FL_TEAM_1) c1 = 0;
- if (head.team == FL_TEAM_2) c2 = 0;
- if (head.team == FL_TEAM_3) c3 = 0;
- if (head.team == FL_TEAM_4) c4 = 0;
+ if (head.team == NUM_TEAM_1) c1 = 0;
+ if (head.team == NUM_TEAM_2) c2 = 0;
+ if (head.team == NUM_TEAM_3) c3 = 0;
+ if (head.team == NUM_TEAM_4) c4 = 0;
head = head.chain;
}
}
{
if(!(g_domination && head.netname == ""))
{
- if(head.team == FL_TEAM_1)
+ if(head.team == NUM_TEAM_1)
c1 = 0;
- else if(head.team == FL_TEAM_2)
+ else if(head.team == NUM_TEAM_2)
c2 = 0;
- else if(head.team == FL_TEAM_3)
+ else if(head.team == NUM_TEAM_3)
c3 = 0;
- else if(head.team == FL_TEAM_4)
+ else if(head.team == NUM_TEAM_4)
c4 = 0;
}
head = find(head, classname, teament_name);
if(autocvar_bot_vs_human > 0)
{
// bots are all blue
- if(clienttype(for_whom) == CLIENTTYPE_BOT)
+ if(IS_BOT_CLIENT(for_whom))
c1 = c3 = c4 = -1;
else
c2 = -1;
else
{
// bots are all red
- if(clienttype(for_whom) == CLIENTTYPE_BOT)
+ if(IS_BOT_CLIENT(for_whom))
c2 = c3 = c4 = -1;
else
c1 = -1;
}
// if player has a forced team, ONLY allow that one
- if(self.team_forced == FL_TEAM_1 && c1 >= 0)
+ if(self.team_forced == NUM_TEAM_1 && c1 >= 0)
c2 = c3 = c4 = -1;
- else if(self.team_forced == FL_TEAM_2 && c2 >= 0)
+ else if(self.team_forced == NUM_TEAM_2 && c2 >= 0)
c1 = c3 = c4 = -1;
- else if(self.team_forced == FL_TEAM_3 && c3 >= 0)
+ else if(self.team_forced == NUM_TEAM_3 && c3 >= 0)
c1 = c2 = c4 = -1;
- else if(self.team_forced == FL_TEAM_4 && c4 >= 0)
+ else if(self.team_forced == NUM_TEAM_4 && c4 >= 0)
c1 = c2 = c3 = -1;
}
FOR_EACH_CLIENT(head)
{
float t;
- if(head.classname == "player")
+ if(IS_PLAYER(head))
t = head.team;
else if(head.team_forced > 0)
t = head.team_forced; // reserve the spot
if(head != ignore)// && head.netname != "")
{
value = PlayerValue(head);
- if(clienttype(head) == CLIENTTYPE_BOT)
+ if(IS_BOT_CLIENT(head))
bvalue = value;
else
bvalue = 0;
- if(t == FL_TEAM_1)
+ if(t == NUM_TEAM_1)
{
if(c1 >= 0)
{
cb1 = cb1 + bvalue;
}
}
- if(t == FL_TEAM_2)
+ if(t == NUM_TEAM_2)
{
if(c2 >= 0)
{
cb2 = cb2 + bvalue;
}
}
- if(t == FL_TEAM_3)
+ if(t == NUM_TEAM_3)
{
if(c3 >= 0)
{
cb3 = cb3 + bvalue;
}
}
- if(t == FL_TEAM_4)
+ if(t == NUM_TEAM_4)
{
if(c4 >= 0)
{
if(ta == tb)
return TRUE;
- if(clienttype(e) == CLIENTTYPE_REAL)
+ if(IS_REAL_CLIENT(e))
{
if(bots_would_leave)
{
if(totalteams <= 1)
{
- if(autocvar_g_campaign && pl && clienttype(pl) == CLIENTTYPE_REAL)
+ if(autocvar_g_campaign && pl && IS_REAL_CLIENT(pl))
return 1; // special case for campaign and player joining
else if(g_domination)
error("Too few teams available for domination\n");
// if he's not on a valid team, then let other code put him on the smallest team
if(!forcebestteam)
{
- if( c1 >= 0 && pl.team == FL_TEAM_1)
+ if( c1 >= 0 && pl.team == NUM_TEAM_1)
selectedteam = pl.team;
- else if(c2 >= 0 && pl.team == FL_TEAM_2)
+ else if(c2 >= 0 && pl.team == NUM_TEAM_2)
selectedteam = pl.team;
- else if(c3 >= 0 && pl.team == FL_TEAM_3)
+ else if(c3 >= 0 && pl.team == NUM_TEAM_3)
selectedteam = pl.team;
- else if(c4 >= 0 && pl.team == FL_TEAM_4)
+ else if(c4 >= 0 && pl.team == NUM_TEAM_4)
selectedteam = pl.team;
else
selectedteam = -1;
TeamchangeFrags(self);
if(smallest == 1)
{
- SetPlayerColors(pl, FL_TEAM_1 - 1);
+ SetPlayerColors(pl, NUM_TEAM_1 - 1);
}
else if(smallest == 2)
{
- SetPlayerColors(pl, FL_TEAM_2 - 1);
+ SetPlayerColors(pl, NUM_TEAM_2 - 1);
}
else if(smallest == 3)
{
- SetPlayerColors(pl, FL_TEAM_3 - 1);
+ SetPlayerColors(pl, NUM_TEAM_3 - 1);
}
else if(smallest == 4)
{
- SetPlayerColors(pl, FL_TEAM_4 - 1);
+ SetPlayerColors(pl, NUM_TEAM_4 - 1);
}
else
{
scolor = self.clientcolors & 0x0F;
dcolor = _color & 0x0F;
- if(scolor == FL_TEAM_1 - 1)
+ if(scolor == NUM_TEAM_1 - 1)
steam = 1;
- else if(scolor == FL_TEAM_2 - 1)
+ else if(scolor == NUM_TEAM_2 - 1)
steam = 2;
- else if(scolor == FL_TEAM_3 - 1)
+ else if(scolor == NUM_TEAM_3 - 1)
steam = 3;
- else // if(scolor == FL_TEAM_4 - 1)
+ else // if(scolor == NUM_TEAM_4 - 1)
steam = 4;
- if(dcolor == FL_TEAM_1 - 1)
+ if(dcolor == NUM_TEAM_1 - 1)
dteam = 1;
- else if(dcolor == FL_TEAM_2 - 1)
+ else if(dcolor == NUM_TEAM_2 - 1)
dteam = 2;
- else if(dcolor == FL_TEAM_3 - 1)
+ else if(dcolor == NUM_TEAM_3 - 1)
dteam = 3;
- else // if(dcolor == FL_TEAM_4 - 1)
+ else // if(dcolor == NUM_TEAM_4 - 1)
dteam = 4;
CheckAllowedTeams(self);
// bprint("allow change teams from ", ftos(steam), " to ", ftos(dteam), "\n");
- if(self.classname == "player" && steam != dteam)
+ if(IS_PLAYER(self) && steam != dteam)
{
// reduce frags during a team change
TeamchangeFrags(self);
SetPlayerTeam(self, dteam, steam, FALSE);
- if(self.classname == "player" && steam != dteam)
+ if(IS_PLAYER(self) && steam != dteam)
{
// kill player when changing teams
if(self.deadflag == DEAD_NO)
}
if(source_team == 1)
- steam = FL_TEAM_1;
+ steam = NUM_TEAM_1;
else if(source_team == 2)
- steam = FL_TEAM_2;
+ steam = NUM_TEAM_2;
else if(source_team == 3)
- steam = FL_TEAM_3;
+ steam = NUM_TEAM_3;
else // if(source_team == 4)
- steam = FL_TEAM_4;
+ steam = NUM_TEAM_4;
lowest_bot = world;
lowest_bot_score = 999999999;
numteams = autocvar_g_tdm_teams;
numteams = bound(2, numteams, 4);
- tdm_spawnteam("Red", FL_TEAM_1-1);
- tdm_spawnteam("Blue", FL_TEAM_2-1);
+ tdm_spawnteam("Red", NUM_TEAM_1-1);
+ tdm_spawnteam("Blue", NUM_TEAM_2-1);
if(numteams >= 3)
- tdm_spawnteam("Yellow", FL_TEAM_3-1);
+ tdm_spawnteam("Yellow", NUM_TEAM_3-1);
if(numteams >= 4)
- tdm_spawnteam("Pink", FL_TEAM_4-1);
+ tdm_spawnteam("Pink", NUM_TEAM_4-1);
}
void tdm_delayedinit()