return e.team;
}
-const float ST_NEXBALL_GOALS = 1;
+const int ST_NEXBALL_GOALS = 1;
void nb_ScoreRules(int teams)
{
GameRules_scoring(teams, 0, 0, {
MUTATOR_STATIC();
MUTATOR_ONADD
{
- ons_Initialize();
-
GameRules_teams(true);
GameRules_limit_score(autocvar_g_onslaught_point_limit);
+
+ ons_Initialize();
}
return false;
}
// readyrestart not supported (yet)
return true;
}
-
-// scoreboard setup
-void assault_ScoreRules()
-{
- int teams = BITS(2); // always red vs blue
- GameRules_scoring(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, {
- field_team(ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
- field(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
- });
-}
#include "../gamemode.qh"
-void assault_ScoreRules();
+const int ST_ASSAULT_OBJECTIVES = 1;
REGISTER_MUTATOR(as, false)
{
MUTATOR_ONADD
{
GameRules_teams(true);
- assault_ScoreRules();
+ int teams = BITS(2); // always red vs blue
+ GameRules_scoring(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, {
+ field_team(ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
+ field(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
+ });
}
return 0;
}
void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_items;
void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplayers;
-// scoreboard stuff
-const float ST_ASSAULT_OBJECTIVES = 1;
-
// predefined spawnfuncs
void target_objective_decrease_activate(entity this);
MUTATOR_STATIC();
MUTATOR_ONADD
{
- allowed_to_spawn = true;
+ GameRules_teams(true);
+ GameRules_spawning_teams(autocvar_g_ca_team_spawns);
+ GameRules_limit_score(autocvar_g_ca_point_limit);
+ GameRules_limit_lead(autocvar_g_ca_point_leadlimit);
ca_teams = autocvar_g_ca_teams_override;
if (ca_teams < 2)
field_team(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
});
+ allowed_to_spawn = true;
round_handler_Spawn(CA_CheckTeams, CA_CheckWinner, CA_RoundStart);
round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
-
EliminatedPlayers_Init(ca_isEliminated);
-
- GameRules_teams(true);
- GameRules_limit_score(autocvar_g_ca_point_limit);
- GameRules_limit_lead(autocvar_g_ca_point_leadlimit);
-
- GameRules_spawning_teams(autocvar_g_ca_team_spawns);
}
return 0;
}
#include "gamemode_ctf.qh"
-#ifndef CSQC
#include <common/effects/all.qh>
-void ctf_Initialize();
-
-REGISTER_MUTATOR(ctf, false)
-{
- MUTATOR_STATIC();
- MUTATOR_ONADD
- {
- ctf_Initialize();
-
- GameRules_teams(true);
- GameRules_limit_score(autocvar_capturelimit_override);
- GameRules_limit_lead(autocvar_captureleadlimit_override);
- }
- return 0;
-}
-#endif
-
-#ifdef SVQC
#include <common/vehicles/all.qh>
#include <server/teamplay.qh>
-#endif
#include <lib/warpzone/common.qh>
#ifdef SVQC
#include "../gamemode.qh"
+
+void ctf_Initialize();
+
+REGISTER_MUTATOR(ctf, false)
+{
+ MUTATOR_STATIC();
+ MUTATOR_ONADD
+ {
+ GameRules_teams(true);
+ GameRules_limit_score(autocvar_capturelimit_override);
+ GameRules_limit_lead(autocvar_captureleadlimit_override);
+
+ ctf_Initialize();
+ }
+ return 0;
+}
+
// used in cheats.qc
void ctf_RespawnFlag(entity flag);
MUTATOR_STATIC();
MUTATOR_ONADD
{
- dom_Initialize();
-
int fraglimit_override = autocvar_g_domination_point_limit;
if (autocvar_g_domination_roundbased && autocvar_g_domination_roundbased_point_limit)
fraglimit_override = autocvar_g_domination_roundbased_point_limit;
GameRules_teams(true);
GameRules_limit_score(fraglimit_override);
GameRules_limit_lead(autocvar_g_domination_point_leadlimit);
+
+ dom_Initialize();
}
return 0;
}
MUTATOR_STATIC();
MUTATOR_ONADD
{
- freezetag_Initialize();
-
GameRules_teams(true);
+ GameRules_spawning_teams(autocvar_g_freezetag_team_spawns);
GameRules_limit_score(autocvar_g_freezetag_point_limit);
GameRules_limit_lead(autocvar_g_freezetag_point_leadlimit);
- GameRules_spawning_teams(autocvar_g_freezetag_team_spawns);
+ freezetag_Initialize();
}
return 0;
}
MUTATOR_STATIC();
MUTATOR_ONADD
{
- g_invasion = true;
- invasion_Initialize();
-
- cvar_settemp("g_monsters", "1");
-
- GameRules_limit_score(autocvar_g_invasion_point_limit);
-
- if (autocvar_g_invasion_teams >= 2)
- {
+ if (autocvar_g_invasion_teams >= 2) {
GameRules_teams(true);
GameRules_spawning_teams(autocvar_g_invasion_team_spawns);
}
+ GameRules_limit_score(autocvar_g_invasion_point_limit);
+
+ g_invasion = true;
+ cvar_settemp("g_monsters", "1");
+ invasion_Initialize();
}
return 0;
}
void ka_Initialize() // run at the start of a match, initiates game mode
{
- GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0, {
- field(SP_KEEPAWAY_PICKUPS, "pickups", 0);
- field(SP_KEEPAWAY_CARRIERKILLS, "bckills", 0);
- field(SP_KEEPAWAY_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
- });
ka_SpawnBall();
}
MUTATOR_STATIC();
MUTATOR_ONADD
{
+ GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0, {
+ field(SP_KEEPAWAY_PICKUPS, "pickups", 0);
+ field(SP_KEEPAWAY_CARRIERKILLS, "bckills", 0);
+ field(SP_KEEPAWAY_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
+ });
+
ka_Initialize();
}
return false;
int kh_Key_AllOwnedByWhichTeam();
-const float ST_KH_CAPS = 1;
+const int ST_KH_CAPS = 1;
void kh_ScoreRules(int teams)
{
GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
MUTATOR_STATIC();
MUTATOR_ONADD
{
- kh_Initialize();
-
GameRules_teams(true);
+ GameRules_spawning_teams(autocvar_g_keyhunt_team_spawns);
GameRules_limit_score(autocvar_g_keyhunt_point_limit);
GameRules_limit_lead(autocvar_g_keyhunt_point_leadlimit);
- GameRules_spawning_teams(autocvar_g_keyhunt_team_spawns);
+
+ kh_Initialize();
}
return 0;
}
return true; // allow writing to this field in intermission as it is needed for newly joining players
}
-// scoreboard stuff
-void lms_ScoreRules()
-{
- GameRules_score_enabled(false);
- GameRules_scoring(0, 0, 0, {
- field(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
- field(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
- });
-}
-
void lms_Initialize()
{
lms_lowest_lives = 9999;
-
- lms_ScoreRules();
}
MUTATOR_STATIC();
MUTATOR_ONADD
{
- lms_Initialize();
-
GameRules_limit_score(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override));
GameRules_limit_lead(0);
+ GameRules_score_enabled(false);
+ GameRules_scoring(0, 0, 0, {
+ field(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
+ field(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
+ });
+
+ lms_Initialize();
}
return 0;
}
MUTATOR_ONADD
{
rc_SetLimits();
+
race_Initialize();
}
return 0;
MUTATOR_STATIC();
MUTATOR_ONADD
{
- InitializeEntity(NULL, tdm_DelayedInit, INITPRIO_GAMETYPE);
-
GameRules_teams(true);
+ GameRules_spawning_teams(autocvar_g_tdm_team_spawns);
GameRules_limit_score(autocvar_g_tdm_point_limit);
GameRules_limit_lead(autocvar_g_tdm_point_leadlimit);
- GameRules_spawning_teams(autocvar_g_tdm_team_spawns);
+
+ InitializeEntity(NULL, tdm_DelayedInit, INITPRIO_GAMETYPE);
}
return 0;
}