BADCVAR("g_freezetag");
BADCVAR("g_keepaway");
BADCVAR("g_keyhunt");
+ BADCVAR("g_td");
BADCVAR("g_keyhunt_teams");
BADCVAR("g_keyhunt_teams");
BADCVAR("g_lms");
BADCVAR("g_onslaught");
BADCVAR("g_race");
BADCVAR("g_race_qualifying_timelimit");
- BADCVAR("g_runematch");
BADCVAR("g_tdm");
BADCVAR("g_tdm_teams");
BADCVAR("leadlimit");
BADCVAR("g_keyhunt_point_leadlimit");
BADPREFIX("g_mod_");
BADCVAR("g_nexball_goalleadlimit");
- BADCVAR("g_runematch_point_leadlimit");
BADCVAR("leadlimit_and_fraglimit");
BADCVAR("leadlimit_override");
BADCVAR("pausable");
BADCVAR("g_mirrordamage");
BADCVAR("g_nexball_goallimit");
BADCVAR("g_powerups");
- BADCVAR("g_runematch_point_limit");
BADCVAR("g_start_delay");
BADCVAR("g_warmup");
BADCVAR("g_weapon_stay"); BADPRESUFFIX("g_", "_weapon_stay");
addstat(STAT_FROZEN, AS_INT, freezetag_frozen);
addstat(STAT_REVIVE_PROGRESS, AS_FLOAT, freezetag_revive_progress);
}
+
+ if(g_td)
+ {
+ addstat(STAT_CURRENT_WAVE, AS_FLOAT, stat_current_wave);
+ addstat(STAT_TOTALWAVES, AS_FLOAT, stat_totalwaves);
+ }
+
+ // freeze attacks
+ addstat(STAT_FROZEN, AS_INT, frozen);
+ addstat(STAT_REVIVE_PROGRESS, AS_FLOAT, revive_progress);
// g_movementspeed hack
addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw);
// secrets
addstat(STAT_SECRETS_TOTAL, AS_FLOAT, stat_secrets_total);
addstat(STAT_SECRETS_FOUND, AS_FLOAT, stat_secrets_found);
+
+ // monsters
+ addstat(STAT_MONSTERS_TOTAL, AS_FLOAT, stat_monsters_total);
+ addstat(STAT_MONSTERS_KILLED, AS_FLOAT, stat_monsters_killed);
// misc
addstat(STAT_RESPAWN_TIME, AS_FLOAT, stat_respawn_time);
// weird mutators that deserve to count as mod
if(autocvar_g_minstagib)
modname = "MinstaGib";
+ if(autocvar_g_monsters)
+ modname = "Monsters";
// extra mutators that deserve to count as mod
MUTATOR_CALLHOOK(SetModname);
{
if (head.health > 0)
{
- if (head.team == FL_TEAM_1) t1 = 1;
- if (head.team == FL_TEAM_2) t2 = 1;
- if (head.team == FL_TEAM_3) t3 = 1;
- if (head.team == FL_TEAM_4) t4 = 1;
+ if (head.team == NUM_TEAM_1) t1 = 1;
+ if (head.team == NUM_TEAM_2) t2 = 1;
+ if (head.team == NUM_TEAM_3) t3 = 1;
+ if (head.team == NUM_TEAM_4) t4 = 1;
}
head = find(head, classname, "onslaught_generator");
}
{
// game over, only one team remains (or none)
ClearWinners();
- if (t1) SetWinners(team, FL_TEAM_1);
- if (t2) SetWinners(team, FL_TEAM_2);
- if (t3) SetWinners(team, FL_TEAM_3);
- if (t4) SetWinners(team, FL_TEAM_4);
+ if (t1) SetWinners(team, NUM_TEAM_1);
+ if (t2) SetWinners(team, NUM_TEAM_2);
+ if (t3) SetWinners(team, NUM_TEAM_3);
+ if (t4) SetWinners(team, NUM_TEAM_4);
dprint("Have a winner, ending game.\n");
return WINNING_YES;
}
status = WINNING_NO;
// as the timelimit has not yet passed just assume the defending team will win
- if(assault_attacker_team == FL_TEAM_1)
+ if(assault_attacker_team == NUM_TEAM_1)
{
- SetWinners(team, FL_TEAM_2);
+ SetWinners(team, NUM_TEAM_2);
}
else
{
- SetWinners(team, FL_TEAM_1);
+ SetWinners(team, NUM_TEAM_1);
}
entity ent;
if(teamplay)
{
- team1_score = TeamScore_GetCompareValue(FL_TEAM_1);
- team2_score = TeamScore_GetCompareValue(FL_TEAM_2);
- team3_score = TeamScore_GetCompareValue(FL_TEAM_3);
- team4_score = TeamScore_GetCompareValue(FL_TEAM_4);
+ team1_score = TeamScore_GetCompareValue(NUM_TEAM_1);
+ team2_score = TeamScore_GetCompareValue(NUM_TEAM_2);
+ team3_score = TeamScore_GetCompareValue(NUM_TEAM_3);
+ team4_score = TeamScore_GetCompareValue(NUM_TEAM_4);
}
ClearWinners();
FOR_EACH_PLAYER(head) if(head.deadflag == DEAD_NO)
{
- if(head.team == FL_TEAM_1)
+ if(head.team == NUM_TEAM_1)
team1_score = 1;
- else if(head.team == FL_TEAM_2)
+ else if(head.team == NUM_TEAM_2)
team2_score = 1;
- else if(head.team == FL_TEAM_3)
+ else if(head.team == NUM_TEAM_3)
team3_score = 1;
- else if(head.team == FL_TEAM_4)
+ else if(head.team == NUM_TEAM_4)
team4_score = 1;
}
for(head = world; (head = find(head, classname, "info_player_deathmatch")) != world; )
{
- if(head.team == FL_TEAM_1)
+ if(head.team == NUM_TEAM_1)
team1_score = 1;
- else if(head.team == FL_TEAM_2)
+ else if(head.team == NUM_TEAM_2)
team2_score = 1;
- else if(head.team == FL_TEAM_3)
+ else if(head.team == NUM_TEAM_3)
team3_score = 1;
- else if(head.team == FL_TEAM_4)
+ else if(head.team == NUM_TEAM_4)
team4_score = 1;
}
{
float t, i;
if(team1_score)
- t = FL_TEAM_1;
+ t = NUM_TEAM_1;
else if(team2_score)
- t = FL_TEAM_2;
+ t = NUM_TEAM_2;
else if(team3_score)
- t = FL_TEAM_3;
+ t = NUM_TEAM_3;
else // if(team4_score)
- t = FL_TEAM_4;
+ t = NUM_TEAM_4;
CheckAllowedTeams(world);
for(i = 0; i < MAX_TEAMSCORE; ++i)
{
- if(t != FL_TEAM_1) if(c1 >= 0) TeamScore_AddToTeam(FL_TEAM_1, i, -1000);
- if(t != FL_TEAM_2) if(c2 >= 0) TeamScore_AddToTeam(FL_TEAM_2, i, -1000);
- if(t != FL_TEAM_3) if(c3 >= 0) TeamScore_AddToTeam(FL_TEAM_3, i, -1000);
- if(t != FL_TEAM_4) if(c4 >= 0) TeamScore_AddToTeam(FL_TEAM_4, i, -1000);
+ if(t != NUM_TEAM_1) if(c1 >= 0) TeamScore_AddToTeam(NUM_TEAM_1, i, -1000);
+ if(t != NUM_TEAM_2) if(c2 >= 0) TeamScore_AddToTeam(NUM_TEAM_2, i, -1000);
+ if(t != NUM_TEAM_3) if(c3 >= 0) TeamScore_AddToTeam(NUM_TEAM_3, i, -1000);
+ if(t != NUM_TEAM_4) if(c4 >= 0) TeamScore_AddToTeam(NUM_TEAM_4, i, -1000);
}
AddWinners(team, t);
return WINNING_NO;
}
+// TD winning condition:
+// game terminates if there are no generators (or 1 dies if td_dontend is TRUE)
+float gensurvived;
+float WinningCondition_TowerDefense()
+{
+ WinningConditionHelper(); // set worldstatus
+
+ if(inWarmupStage)
+ return WINNING_NO;
+
+ // first check if the game has ended
+ if(gendestroyed == TRUE) // FALSE means either generator hasen't spawned yet, or mapper didn't add one
+ if(td_gencount < 1 || !td_dont_end)
+ {
+ ClearWinners();
+ dprint("Everyone lost, ending game.\n");
+ return WINNING_YES;
+ }
+
+ if(gensurvived)
+ {
+ ClearWinners();
+ SetWinners(winning, 4);
+ return WINNING_YES;
+ }
+
+ // Two or more teams remain
+ return WINNING_NO;
+}
+
/*
============
CheckRules_World
{
checkrules_status = WinningCondition_Onslaught(); // TODO remove this?
}
+ else if(g_td)
+ {
+ checkrules_status = WinningCondition_TowerDefense();
+ }
else
{
checkrules_status = WinningCondition_Scores(fraglimit, leadlimit);