return true;
}
-MUTATOR_HOOKFUNCTION(nexball_BallDrop)
+void nb_DropBall(entity player)
+{
+ if(player.ballcarried && g_nexball)
+ DropBall(player.ballcarried, player.origin, player.velocity);
+}
+
+MUTATOR_HOOKFUNCTION(nb, ClientDisconnect)
{SELFPARAM();
- if(self.ballcarried && g_nexball)
- DropBall(self.ballcarried, self.origin, self.velocity);
+ nb_DropBall(self);
+ return false;
+}
- return 0;
+MUTATOR_HOOKFUNCTION(nb, PlayerDies)
+{SELFPARAM();
+ nb_DropBall(self);
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(nb, MakePlayerObserver)
+{SELFPARAM();
+ nb_DropBall(self);
+ return false;
}
-MUTATOR_HOOKFUNCTION(nexball_PlayerPreThink)
+MUTATOR_HOOKFUNCTION(nb, PlayerPreThink)
{SELFPARAM();
makevectors(self.v_angle);
if(nexball_mode & NBM_BASKETBALL)
return false;
}
-MUTATOR_HOOKFUNCTION(nexball_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(nb, PlayerSpawn)
{SELFPARAM();
self.weaponentity.weapons = '0 0 0';
.float stat_sv_airspeedlimit_nonqw;
.float stat_sv_maxspeed;
-MUTATOR_HOOKFUNCTION(nexball_PlayerPhysics)
+MUTATOR_HOOKFUNCTION(nb, PlayerPhysics)
{SELFPARAM();
if(self.ballcarried)
{
return false;
}
-MUTATOR_HOOKFUNCTION(nexball_ForbidThrowing)
+MUTATOR_HOOKFUNCTION(nb, ForbidThrowCurrentWeapon)
{SELFPARAM();
if(self.weapon == WEP_NEXBALL.m_id)
return true;
return false;
}
-MUTATOR_HOOKFUNCTION(nexball_FilterItem)
+MUTATOR_HOOKFUNCTION(nb, FilterItem)
{SELFPARAM();
if(self.classname == "droppedweapon")
if(self.weapon == WEP_NEXBALL.m_id)
return false;
}
-MUTATOR_DEFINITION(gamemode_nexball)
+REGISTER_MUTATOR(nb, g_nexball)
{
- MUTATOR_HOOK(PlayerDies, nexball_BallDrop, CBC_ORDER_ANY);
- MUTATOR_HOOK(MakePlayerObserver, nexball_BallDrop, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, nexball_BallDrop, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, nexball_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPreThink, nexball_PlayerPreThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPhysics, nexball_PlayerPhysics, CBC_ORDER_ANY);
- MUTATOR_HOOK(ForbidThrowCurrentWeapon, nexball_ForbidThrowing, CBC_ORDER_ANY);
- MUTATOR_HOOK(FilterItem, nexball_FilterItem, CBC_ORDER_ANY);
+ ActivateTeamplay();
+ SetLimits(autocvar_g_nexball_goallimit, autocvar_g_nexball_goalleadlimit, -1, -1);
+ have_team_spawns = -1; // request team spawns
MUTATOR_ONADD
{
#include "weapon.qc"
#ifdef SVQC
-MUTATOR_DECLARATION(gamemode_nexball);
-
//EF_BRIGHTFIELD|EF_BRIGHTLIGHT|EF_DIMLIGHT|EF_BLUE|EF_RED|EF_FLAME
const float BALL_EFFECTMASK = 1229;
const vector BALL_MINS = '-16 -16 -16'; // The model is 24*24*24
}
// mutator hooks
-MUTATOR_HOOKFUNCTION(assault_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(assault, PlayerSpawn)
{SELFPARAM();
if(self.team == assault_attacker_team)
Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_ASSAULT_ATTACKING);
return false;
}
-MUTATOR_HOOKFUNCTION(assault_TurretSpawn)
+MUTATOR_HOOKFUNCTION(assault, TurretSpawn)
{SELFPARAM();
if(!self.team || self.team == MAX_SHOT_DISTANCE)
self.team = 5; // this gets reversed when match starts?
return false;
}
-MUTATOR_HOOKFUNCTION(assault_VehicleSpawn)
+MUTATOR_HOOKFUNCTION(assault, VehicleSpawn)
{SELFPARAM();
self.nextthink = time + 0.5;
return false;
}
-MUTATOR_HOOKFUNCTION(assault_BotRoles)
+MUTATOR_HOOKFUNCTION(assault, HavocBot_ChooseRole)
{SELFPARAM();
havocbot_ast_reset_role(self);
return true;
}
-MUTATOR_HOOKFUNCTION(assault_PlayHitsound)
+MUTATOR_HOOKFUNCTION(assault, PlayHitsound)
{
return (frag_victim.classname == "func_assault_destructible");
}
ScoreRules_basics_end();
}
-MUTATOR_DEFINITION(gamemode_assault)
+REGISTER_MUTATOR(assault, g_assault)
{
- MUTATOR_HOOK(PlayerSpawn, assault_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(TurretSpawn, assault_TurretSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(VehicleSpawn, assault_VehicleSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(HavocBot_ChooseRole, assault_BotRoles, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayHitsound, assault_PlayHitsound, CBC_ORDER_ANY);
+ ActivateTeamplay();
+ have_team_spawns = -1; // request team spawns
MUTATOR_ONADD
{
return false;
}
-MUTATOR_HOOKFUNCTION(ca_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(ca, PlayerSpawn)
{SELFPARAM();
self.caplayer = 1;
if(!warmup_stage)
return 1;
}
-MUTATOR_HOOKFUNCTION(ca_PutClientInServer)
+MUTATOR_HOOKFUNCTION(ca, PutClientInServer)
{SELFPARAM();
if(!allowed_to_spawn)
if(IS_PLAYER(self)) // this is true even when player is trying to join
return 1;
}
-MUTATOR_HOOKFUNCTION(ca_reset_map_players)
+MUTATOR_HOOKFUNCTION(ca, reset_map_players)
{SELFPARAM();
entity e;
FOR_EACH_CLIENT(e)
return 1;
}
-MUTATOR_HOOKFUNCTION(ca_ClientConnect)
+MUTATOR_HOOKFUNCTION(ca, ClientConnect)
{SELFPARAM();
self.classname = "observer";
return 1;
return 1;
}
-MUTATOR_HOOKFUNCTION(ca_GetTeamCount)
+MUTATOR_HOOKFUNCTION(ca, GetTeamCount, CBC_ORDER_EXCLUSIVE)
{
ret_float = ca_teams;
return 0;
}
}
-MUTATOR_HOOKFUNCTION(ca_PlayerDies)
+MUTATOR_HOOKFUNCTION(ca, PlayerDies)
{SELFPARAM();
ca_LastPlayerForTeam_Notify();
if(!allowed_to_spawn)
return 1;
}
-MUTATOR_HOOKFUNCTION(ca_ClientDisconnect)
+MUTATOR_HOOKFUNCTION(ca, ClientDisconnect)
{SELFPARAM();
if(self.caplayer == 1)
ca_LastPlayerForTeam_Notify();
return 1;
}
-MUTATOR_HOOKFUNCTION(ca_ForbidPlayerScore_Clear)
+MUTATOR_HOOKFUNCTION(ca, ForbidPlayerScore_Clear)
{
return 1;
}
-MUTATOR_HOOKFUNCTION(ca_MakePlayerObserver)
+MUTATOR_HOOKFUNCTION(ca, MakePlayerObserver)
{SELFPARAM();
if(self.caplayer == 1)
ca_LastPlayerForTeam_Notify();
return 1;
}
-MUTATOR_HOOKFUNCTION(ca_ForbidThrowCurrentWeapon)
+MUTATOR_HOOKFUNCTION(ca, ForbidThrowCurrentWeapon)
{
return 1;
}
-MUTATOR_HOOKFUNCTION(ca_GiveFragsForKill)
+MUTATOR_HOOKFUNCTION(ca, GiveFragsForKill, CBC_ORDER_FIRST)
{
frag_score = 0; // score will be given to the winner team when the round ends
return 1;
}
-MUTATOR_HOOKFUNCTION(ca_SetStartItems)
+MUTATOR_HOOKFUNCTION(ca, SetStartItems)
{
start_items &= ~IT_UNLIMITED_AMMO;
start_health = warmup_start_health = cvar("g_lms_start_health");
return 0;
}
-MUTATOR_HOOKFUNCTION(ca_PlayerDamage)
+MUTATOR_HOOKFUNCTION(ca, PlayerDamage_Calculate)
{
if(IS_PLAYER(frag_target))
if(frag_target.deadflag == DEAD_NO)
return false;
}
-MUTATOR_HOOKFUNCTION(ca_FilterItem)
+MUTATOR_HOOKFUNCTION(ca, FilterItem)
{SELFPARAM();
if(autocvar_g_powerups <= 0)
if(self.flags & FL_POWERUP)
return false;
}
-MUTATOR_HOOKFUNCTION(ca_PlayerDamage_SplitHealthArmor)
+MUTATOR_HOOKFUNCTION(ca, PlayerDamage_SplitHealthArmor)
{
float excess = max(0, frag_damage - damage_take - damage_save);
return false;
}
-MUTATOR_HOOKFUNCTION(ca_PlayerRegen)
+MUTATOR_HOOKFUNCTION(ca, PlayerRegen)
{
// no regeneration in CA
return true;
}
-MUTATOR_HOOKFUNCTION(ca_CountFrags)
+MUTATOR_HOOKFUNCTION(ca, Scores_CountFragsRemaining)
{
// announce remaining frags
return true;
EliminatedPlayers_Init(ca_isEliminated);
}
-MUTATOR_DEFINITION(gamemode_ca)
+REGISTER_MUTATOR(ca, g_ca)
{
- MUTATOR_HOOK(PlayerSpawn, ca_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PutClientInServer, ca_PutClientInServer, CBC_ORDER_ANY);
- MUTATOR_HOOK(MakePlayerObserver, ca_MakePlayerObserver, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientConnect, ca_ClientConnect, CBC_ORDER_ANY);
- MUTATOR_HOOK(reset_map_global, ca_reset_map_global, CBC_ORDER_ANY);
- MUTATOR_HOOK(reset_map_players, ca_reset_map_players, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetTeamCount, ca_GetTeamCount, CBC_ORDER_EXCLUSIVE);
- MUTATOR_HOOK(PlayerDies, ca_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, ca_ClientDisconnect, CBC_ORDER_ANY);
- MUTATOR_HOOK(ForbidPlayerScore_Clear, ca_ForbidPlayerScore_Clear, CBC_ORDER_ANY);
- MUTATOR_HOOK(ForbidThrowCurrentWeapon, ca_ForbidThrowCurrentWeapon, CBC_ORDER_ANY);
- MUTATOR_HOOK(GiveFragsForKill, ca_GiveFragsForKill, CBC_ORDER_FIRST);
- MUTATOR_HOOK(SetStartItems, ca_SetStartItems, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDamage_Calculate, ca_PlayerDamage, CBC_ORDER_ANY);
- MUTATOR_HOOK(FilterItem, ca_FilterItem, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, ca_PlayerDamage_SplitHealthArmor, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerRegen, ca_PlayerRegen, CBC_ORDER_ANY);
- MUTATOR_HOOK(Scores_CountFragsRemaining, ca_CountFrags, CBC_ORDER_ANY);
+ ActivateTeamplay();
+ SetLimits(autocvar_g_ca_point_limit, autocvar_g_ca_point_leadlimit, -1, -1);
+
+ if(autocvar_g_ca_team_spawns)
+ have_team_spawns = -1; // request team spawns
MUTATOR_ONADD
{
// Hook Functions
// ==============
-MUTATOR_HOOKFUNCTION(ctf_PlayerPreThink)
+MUTATOR_HOOKFUNCTION(ctf, PlayerPreThink)
{SELFPARAM();
entity flag;
int t = 0, t2 = 0, t3 = 0;
return false;
}
-MUTATOR_HOOKFUNCTION(ctf_PlayerDamage) // for changing damage and force values that are applied to players in g_damage.qc
+MUTATOR_HOOKFUNCTION(ctf, PlayerDamage_Calculate) // for changing damage and force values that are applied to players in g_damage.qc
{
if(frag_attacker.flagcarried) // if the attacker is a flagcarrier
{
return false;
}
-MUTATOR_HOOKFUNCTION(ctf_PlayerDies)
+MUTATOR_HOOKFUNCTION(ctf, PlayerDies)
{
if((frag_attacker != frag_target) && (IS_PLAYER(frag_attacker)) && (frag_target.flagcarried))
{
return false;
}
-MUTATOR_HOOKFUNCTION(ctf_GiveFragsForKill)
+MUTATOR_HOOKFUNCTION(ctf, GiveFragsForKill)
{
frag_score = 0;
return (autocvar_g_ctf_ignore_frags); // no frags counted in ctf if this is true
}
-MUTATOR_HOOKFUNCTION(ctf_RemovePlayer)
-{SELFPARAM();
- entity flag; // temporary entity for the search method
-
- if(self.flagcarried)
- { ctf_Handle_Throw(self, world, DROP_NORMAL); }
+void ctf_RemovePlayer(entity player)
+{
+ if(player.flagcarried)
+ { ctf_Handle_Throw(player, world, DROP_NORMAL); }
- for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext)
+ for(entity flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext)
{
- if(flag.pass_sender == self) { flag.pass_sender = world; }
- if(flag.pass_target == self) { flag.pass_target = world; }
- if(flag.ctf_dropper == self) { flag.ctf_dropper = world; }
+ if(flag.pass_sender == player) { flag.pass_sender = world; }
+ if(flag.pass_target == player) { flag.pass_target = world; }
+ if(flag.ctf_dropper == player) { flag.ctf_dropper = world; }
}
+}
+
+MUTATOR_HOOKFUNCTION(ctf, MakePlayerObserver)
+{SELFPARAM();
+ ctf_RemovePlayer(self);
+ return false;
+}
+MUTATOR_HOOKFUNCTION(ctf, ClientDisconnect)
+{SELFPARAM();
+ ctf_RemovePlayer(self);
return false;
}
-MUTATOR_HOOKFUNCTION(ctf_PortalTeleport)
+MUTATOR_HOOKFUNCTION(ctf, PortalTeleport)
{SELFPARAM();
if(self.flagcarried)
if(!autocvar_g_ctf_portalteleport)
return false;
}
-MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey)
+MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey)
{SELFPARAM();
if(MUTATOR_RETURNVALUE || gameover) { return false; }
return false;
}
-MUTATOR_HOOKFUNCTION(ctf_HelpMePing)
+MUTATOR_HOOKFUNCTION(ctf, HelpMePing)
{SELFPARAM();
if(self.wps_flagcarrier) // update the flagcarrier waypointsprite with "NEEDING HELP" notification
{
return true;
}
-MUTATOR_HOOKFUNCTION(ctf_VehicleEnter)
+MUTATOR_HOOKFUNCTION(ctf, VehicleEnter)
{
if(vh_player.flagcarried)
{
return false;
}
-MUTATOR_HOOKFUNCTION(ctf_VehicleExit)
+MUTATOR_HOOKFUNCTION(ctf, VehicleExit)
{
if(vh_player.flagcarried)
{
return false;
}
-MUTATOR_HOOKFUNCTION(ctf_AbortSpeedrun)
+MUTATOR_HOOKFUNCTION(ctf, AbortSpeedrun)
{SELFPARAM();
if(self.flagcarried)
{
return false;
}
-MUTATOR_HOOKFUNCTION(ctf_MatchEnd)
+MUTATOR_HOOKFUNCTION(ctf, MatchEnd)
{
entity flag; // temporary entity for the search method
return false;
}
-MUTATOR_HOOKFUNCTION(ctf_BotRoles)
+MUTATOR_HOOKFUNCTION(ctf, HavocBot_ChooseRole)
{SELFPARAM();
havocbot_ctf_reset_role(self);
return true;
}
-MUTATOR_HOOKFUNCTION(ctf_GetTeamCount)
+MUTATOR_HOOKFUNCTION(ctf, GetTeamCount)
{
//ret_float = ctf_teams;
ret_string = "ctf_team";
return true;
}
-MUTATOR_HOOKFUNCTION(ctf_SpectateCopy)
+MUTATOR_HOOKFUNCTION(ctf, SpectateCopy)
{SELFPARAM();
self.ctf_flagstatus = other.ctf_flagstatus;
return false;
}
-MUTATOR_DEFINITION(gamemode_ctf)
+REGISTER_MUTATOR(ctf, g_ctf)
{
- MUTATOR_HOOK(MakePlayerObserver, ctf_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, ctf_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, ctf_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(MatchEnd, ctf_MatchEnd, CBC_ORDER_ANY);
- MUTATOR_HOOK(PortalTeleport, ctf_PortalTeleport, CBC_ORDER_ANY);
- MUTATOR_HOOK(GiveFragsForKill, ctf_GiveFragsForKill, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPreThink, ctf_PlayerPreThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDamage_Calculate, ctf_PlayerDamage, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerUseKey, ctf_PlayerUseKey, CBC_ORDER_ANY);
- MUTATOR_HOOK(HelpMePing, ctf_HelpMePing, CBC_ORDER_ANY);
- MUTATOR_HOOK(VehicleEnter, ctf_VehicleEnter, CBC_ORDER_ANY);
- MUTATOR_HOOK(VehicleExit, ctf_VehicleExit, CBC_ORDER_ANY);
- MUTATOR_HOOK(AbortSpeedrun, ctf_AbortSpeedrun, CBC_ORDER_ANY);
- MUTATOR_HOOK(HavocBot_ChooseRole, ctf_BotRoles, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetTeamCount, ctf_GetTeamCount, CBC_ORDER_ANY);
- MUTATOR_HOOK(SpectateCopy, ctf_SpectateCopy, CBC_ORDER_ANY);
+ ActivateTeamplay();
+ SetLimits(autocvar_capturelimit_override, -1, autocvar_captureleadlimit_override, -1);
+ have_team_spawns = -1; // request team spawns
MUTATOR_ONADD
{
GameLogEcho(strcat(":cts:", mode, ":", ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
}
-MUTATOR_HOOKFUNCTION(cts_PlayerPhysics)
+MUTATOR_HOOKFUNCTION(cts, PlayerPhysics)
{SELFPARAM();
// force kbd movement for fairness
float wishspeed;
return false;
}
-MUTATOR_HOOKFUNCTION(cts_ResetMap)
+MUTATOR_HOOKFUNCTION(cts, reset_map_global)
{
float s;
return false;
}
-MUTATOR_HOOKFUNCTION(cts_PlayerPreThink)
+MUTATOR_HOOKFUNCTION(cts, PlayerPreThink)
{SELFPARAM();
if(IS_SPEC(self) || IS_OBSERVER(self))
if(g_race_qualifying)
return false;
}
-MUTATOR_HOOKFUNCTION(cts_ClientConnect)
+MUTATOR_HOOKFUNCTION(cts, ClientConnect)
{SELFPARAM();
race_PreparePlayer();
self.race_checkpoint = -1;
return false;
}
-MUTATOR_HOOKFUNCTION(cts_MakePlayerObserver)
+MUTATOR_HOOKFUNCTION(cts, MakePlayerObserver)
{SELFPARAM();
if(PlayerScore_Add(self, SP_RACE_FASTEST, 0))
self.frags = FRAGS_LMS_LOSER;
return false;
}
-MUTATOR_HOOKFUNCTION(cts_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(cts, PlayerSpawn)
{SELFPARAM();
if(spawn_spot.target == "")
// Emergency: this wasn't a real spawnpoint. Can this ever happen?
return false;
}
-MUTATOR_HOOKFUNCTION(cts_PutClientInServer)
+MUTATOR_HOOKFUNCTION(cts, PutClientInServer)
{SELFPARAM();
if(IS_PLAYER(self))
if(!gameover)
return false;
}
-MUTATOR_HOOKFUNCTION(cts_PlayerDies)
+MUTATOR_HOOKFUNCTION(cts, PlayerDies)
{SELFPARAM();
self.respawn_flags |= RESPAWN_FORCE;
race_AbandonRaceCheck(self);
return false;
}
-MUTATOR_HOOKFUNCTION(cts_BotRoles)
+MUTATOR_HOOKFUNCTION(cts, HavocBot_ChooseRole)
{SELFPARAM();
self.havocbot_role = havocbot_role_cts;
return true;
}
-MUTATOR_HOOKFUNCTION(cts_PlayerPostThink)
+MUTATOR_HOOKFUNCTION(cts, GetPressedKeys)
{SELFPARAM();
if(self.cvar_cl_allow_uidtracking == 1 && self.cvar_cl_allow_uid2name == 1)
{
return false;
}
-MUTATOR_HOOKFUNCTION(cts_ForbidThrowing)
+MUTATOR_HOOKFUNCTION(cts, ForbidThrowCurrentWeapon)
{
// no weapon dropping in CTS
return true;
}
-MUTATOR_HOOKFUNCTION(cts_FilterItem)
+MUTATOR_HOOKFUNCTION(cts, FilterItem)
{SELFPARAM();
if(self.classname == "droppedweapon")
return true;
return false;
}
-MUTATOR_HOOKFUNCTION(cts_PlayerDamage)
+MUTATOR_HOOKFUNCTION(cts, PlayerDamage_Calculate)
{
if(frag_target == frag_attacker || frag_deathtype == DEATH_FALL.m_id)
if(!autocvar_g_cts_selfdamage)
return false;
}
-MUTATOR_HOOKFUNCTION(cts_ForbidClearPlayerScore)
+MUTATOR_HOOKFUNCTION(cts, ForbidPlayerScore_Clear)
{
return true; // in CTS, you don't lose score by observing
}
-MUTATOR_HOOKFUNCTION(cts_SetMods)
+MUTATOR_HOOKFUNCTION(cts, SetModname)
{
g_cloaked = 1; // always enable cloak in CTS
cts_ScoreRules();
}
-MUTATOR_DEFINITION(gamemode_cts)
+REGISTER_MUTATOR(cts, g_cts)
{
- MUTATOR_HOOK(PlayerPhysics, cts_PlayerPhysics, CBC_ORDER_ANY);
- MUTATOR_HOOK(reset_map_global, cts_ResetMap, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPreThink, cts_PlayerPreThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientConnect, cts_ClientConnect, CBC_ORDER_ANY);
- MUTATOR_HOOK(MakePlayerObserver, cts_MakePlayerObserver, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, cts_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PutClientInServer, cts_PutClientInServer, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, cts_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(HavocBot_ChooseRole, cts_BotRoles, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetPressedKeys, cts_PlayerPostThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(ForbidThrowCurrentWeapon, cts_ForbidThrowing, CBC_ORDER_ANY);
- MUTATOR_HOOK(FilterItem, cts_FilterItem, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDamage_Calculate, cts_PlayerDamage, CBC_ORDER_ANY);
- MUTATOR_HOOK(ForbidPlayerScore_Clear, cts_ForbidClearPlayerScore, CBC_ORDER_ANY);
- MUTATOR_HOOK(SetModname, cts_SetMods, CBC_ORDER_ANY);
+ g_race_qualifying = 1;
+ independent_players = 1;
+ SetLimits(0, 0, 0, -1);
MUTATOR_ONADD
{
#include "gamemode.qh"
-MUTATOR_HOOKFUNCTION(dm_CountFrags)
+MUTATOR_HOOKFUNCTION(dm, Scores_CountFragsRemaining)
{
// announce remaining frags
return true;
}
-MUTATOR_DEFINITION(gamemode_deathmatch)
+REGISTER_MUTATOR(dm, g_dm)
{
- MUTATOR_HOOK(Scores_CountFragsRemaining, dm_CountFrags, CBC_ORDER_ANY);
-
MUTATOR_ONADD
{
if(time > 1) // game loads at time 1
}
}
-MUTATOR_HOOKFUNCTION(dom_GetTeamCount)
+MUTATOR_HOOKFUNCTION(dom, GetTeamCount)
{
ret_float = domination_teams;
return 0;
}
-MUTATOR_HOOKFUNCTION(dom_ResetMap)
+MUTATOR_HOOKFUNCTION(dom, reset_map_players)
{SELFPARAM();
total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
entity e;
return 1;
}
-MUTATOR_HOOKFUNCTION(dom_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(dom, PlayerSpawn)
{SELFPARAM();
if(domination_roundbased)
if(!round_handler_IsRoundStarted())
return false;
}
-MUTATOR_HOOKFUNCTION(dom_ClientConnect)
+MUTATOR_HOOKFUNCTION(dom, ClientConnect)
{SELFPARAM();
set_dom_state(self);
return false;
}
-MUTATOR_HOOKFUNCTION(dom_BotRoles)
+MUTATOR_HOOKFUNCTION(dom, HavocBot_ChooseRole)
{SELFPARAM();
self.havocbot_role = havocbot_role_dom;
return true;
}
-MUTATOR_DEFINITION(gamemode_domination)
+REGISTER_MUTATOR(dom, g_domination)
{
- MUTATOR_HOOK(GetTeamCount, dom_GetTeamCount, CBC_ORDER_ANY);
- MUTATOR_HOOK(reset_map_players, dom_ResetMap, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, dom_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientConnect, dom_ClientConnect, CBC_ORDER_ANY);
- MUTATOR_HOOK(HavocBot_ChooseRole, dom_BotRoles, CBC_ORDER_ANY);
+ 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;
+
+ ActivateTeamplay();
+ SetLimits(fraglimit_override, autocvar_g_domination_point_leadlimit, -1, -1);
+ have_team_spawns = -1; // request team spawns
MUTATOR_ONADD
{
// Hook Functions
// ==============
-MUTATOR_HOOKFUNCTION(freezetag_RemovePlayer)
+void ft_RemovePlayer()
{SELFPARAM();
self.health = 0; // neccessary to update correctly alive stats
if(!self.frozen)
freezetag_LastPlayerForTeam_Notify();
freezetag_Unfreeze(world);
freezetag_count_alive_players();
+}
+
+MUTATOR_HOOKFUNCTION(ft, ClientDisconnect)
+{SELFPARAM();
+ ft_RemovePlayer();
+ return 1;
+}
+
+MUTATOR_HOOKFUNCTION(ft, MakePlayerObserver)
+{SELFPARAM();
+ ft_RemovePlayer();
return 1;
}
-MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
+MUTATOR_HOOKFUNCTION(ft, PlayerDies)
{SELFPARAM();
if(round_handler_IsActive())
if(round_handler_CountdownRunning())
return 1;
}
-MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(ft, PlayerSpawn)
{SELFPARAM();
if(self.freezetag_frozen_timeout == -1) // if PlayerSpawn is called by reset_map_players
return 1; // do nothing, round is starting right now
return 1;
}
-MUTATOR_HOOKFUNCTION(freezetag_reset_map_players)
+MUTATOR_HOOKFUNCTION(ft, reset_map_players)
{SELFPARAM();
entity e;
FOR_EACH_PLAYER(e)
return 1;
}
-MUTATOR_HOOKFUNCTION(freezetag_GiveFragsForKill)
+MUTATOR_HOOKFUNCTION(ft, GiveFragsForKill, CBC_ORDER_FIRST)
{
frag_score = 0; // no frags counted in Freeze Tag
return 1;
}
-MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
+MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
{SELFPARAM();
float n;
return 1;
}
-MUTATOR_HOOKFUNCTION(freezetag_SetStartItems)
+MUTATOR_HOOKFUNCTION(ft, SetStartItems)
{
start_items &= ~IT_UNLIMITED_AMMO;
//start_health = warmup_start_health = cvar("g_lms_start_health");
return 0;
}
-MUTATOR_HOOKFUNCTION(freezetag_BotRoles)
+MUTATOR_HOOKFUNCTION(ft, HavocBot_ChooseRole)
{SELFPARAM();
if (!self.deadflag)
{
return true;
}
-MUTATOR_HOOKFUNCTION(freezetag_GetTeamCount)
+MUTATOR_HOOKFUNCTION(ft, GetTeamCount, CBC_ORDER_EXCLUSIVE)
{
ret_float = freezetag_teams;
return false;
EliminatedPlayers_Init(freezetag_isEliminated);
}
-MUTATOR_DEFINITION(gamemode_freezetag)
+REGISTER_MUTATOR(ft, g_freezetag)
{
- MUTATOR_HOOK(MakePlayerObserver, freezetag_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, freezetag_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, freezetag_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, freezetag_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(reset_map_players, freezetag_reset_map_players, CBC_ORDER_ANY);
- MUTATOR_HOOK(GiveFragsForKill, freezetag_GiveFragsForKill, CBC_ORDER_FIRST);
- MUTATOR_HOOK(PlayerPreThink, freezetag_PlayerPreThink, CBC_ORDER_FIRST);
- MUTATOR_HOOK(SetStartItems, freezetag_SetStartItems, CBC_ORDER_ANY);
- MUTATOR_HOOK(HavocBot_ChooseRole, freezetag_BotRoles, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetTeamCount, freezetag_GetTeamCount, CBC_ORDER_EXCLUSIVE);
+ ActivateTeamplay();
+ SetLimits(autocvar_g_freezetag_point_limit, autocvar_g_freezetag_point_leadlimit, -1, -1);
+
+ if(autocvar_g_freezetag_team_spawns)
+ have_team_spawns = -1; // request team spawns
MUTATOR_ONADD
{
}
}
-MUTATOR_HOOKFUNCTION(invasion_MonsterDies)
+MUTATOR_HOOKFUNCTION(inv, MonsterDies)
{SELFPARAM();
if(!(self.spawnflags & MONSTERFLAG_RESPAWNED))
{
return false;
}
-MUTATOR_HOOKFUNCTION(invasion_MonsterSpawn)
+MUTATOR_HOOKFUNCTION(inv, MonsterSpawn)
{SELFPARAM();
if(!(self.spawnflags & MONSTERFLAG_SPAWNED))
return true;
return false;
}
-MUTATOR_HOOKFUNCTION(invasion_OnEntityPreSpawn)
+MUTATOR_HOOKFUNCTION(inv, OnEntityPreSpawn)
{SELFPARAM();
if(startsWith(self.classname, "monster_"))
if(!(self.spawnflags & MONSTERFLAG_SPAWNED))
return false;
}
-MUTATOR_HOOKFUNCTION(invasion_StartFrame)
+MUTATOR_HOOKFUNCTION(inv, SV_StartFrame)
{
monsters_total = inv_maxspawned; // TODO: make sure numspawned never exceeds maxspawned
monsters_killed = inv_numkilled;
return false;
}
-MUTATOR_HOOKFUNCTION(invasion_PlayerRegen)
+MUTATOR_HOOKFUNCTION(inv, PlayerRegen)
{
// no regeneration in invasion
return true;
}
-MUTATOR_HOOKFUNCTION(invasion_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(inv, PlayerSpawn)
{SELFPARAM();
self.bot_attack = false;
return false;
}
-MUTATOR_HOOKFUNCTION(invasion_PlayerDamage)
+MUTATOR_HOOKFUNCTION(inv, PlayerDamage_Calculate)
{
if(IS_PLAYER(frag_attacker) && IS_PLAYER(frag_target) && frag_attacker != frag_target)
{
return false;
}
-MUTATOR_HOOKFUNCTION(invasion_PlayerCommand)
+MUTATOR_HOOKFUNCTION(inv, SV_ParseClientCommand)
{SELFPARAM();
if(MUTATOR_RETURNVALUE) // command was already handled?
return false;
return false;
}
-MUTATOR_HOOKFUNCTION(invasion_BotShouldAttack)
+MUTATOR_HOOKFUNCTION(inv, BotShouldAttack)
{
if(!IS_MONSTER(checkentity))
return true;
return false;
}
-MUTATOR_HOOKFUNCTION(invasion_SetStartItems)
+MUTATOR_HOOKFUNCTION(inv, SetStartItems)
{
start_health = 200;
start_armorvalue = 200;
-
return false;
}
-MUTATOR_HOOKFUNCTION(invasion_AccuracyTargetValid)
+MUTATOR_HOOKFUNCTION(inv, AccuracyTargetValid)
{
if(IS_MONSTER(frag_target))
return MUT_ACCADD_INVALID;
return MUT_ACCADD_INDIFFERENT;
}
-MUTATOR_HOOKFUNCTION(invasion_AllowMobSpawning)
+MUTATOR_HOOKFUNCTION(inv, AllowMobSpawning)
{
// monster spawning disabled during an invasion
return true;
}
-MUTATOR_HOOKFUNCTION(invasion_GetTeamCount)
+MUTATOR_HOOKFUNCTION(inv, GetTeamCount, CBC_ORDER_EXCLUSIVE)
{
ret_float = invasion_teams;
return false;
InitializeEntity(world, invasion_DelayedInit, INITPRIO_GAMETYPE);
}
-MUTATOR_DEFINITION(gamemode_invasion)
+REGISTER_MUTATOR(inv, g_invasion)
{
- MUTATOR_HOOK(MonsterDies, invasion_MonsterDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(MonsterSpawn, invasion_MonsterSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(OnEntityPreSpawn, invasion_OnEntityPreSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(SV_StartFrame, invasion_StartFrame, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerRegen, invasion_PlayerRegen, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, invasion_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDamage_Calculate, invasion_PlayerDamage, CBC_ORDER_ANY);
- MUTATOR_HOOK(SV_ParseClientCommand, invasion_PlayerCommand, CBC_ORDER_ANY);
- MUTATOR_HOOK(BotShouldAttack, invasion_BotShouldAttack, CBC_ORDER_ANY);
- MUTATOR_HOOK(SetStartItems, invasion_SetStartItems, CBC_ORDER_ANY);
- MUTATOR_HOOK(AccuracyTargetValid, invasion_AccuracyTargetValid, CBC_ORDER_ANY);
- MUTATOR_HOOK(AllowMobSpawning, invasion_AllowMobSpawning, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetTeamCount, invasion_GetTeamCount, CBC_ORDER_ANY);
+ SetLimits(autocvar_g_invasion_point_limit, -1, -1, -1);
+ if(autocvar_g_invasion_teams >= 2)
+ {
+ ActivateTeamplay();
+ if(autocvar_g_invasion_team_spawns)
+ have_team_spawns = -1; // request team spawns
+ }
MUTATOR_ONADD
{
// Hook Functions
// ==============
-MUTATOR_HOOKFUNCTION(ka_Scoring)
+MUTATOR_HOOKFUNCTION(ka, PlayerDies)
{SELFPARAM();
if((frag_attacker != frag_target) && (IS_PLAYER(frag_attacker)))
{
return 0;
}
-MUTATOR_HOOKFUNCTION(ka_GiveFragsForKill)
+MUTATOR_HOOKFUNCTION(ka, GiveFragsForKill)
{
frag_score = 0; // no frags counted in keepaway
return 1; // you deceptive little bugger ;3 This needs to be true in order for this function to even count.
}
-MUTATOR_HOOKFUNCTION(ka_PlayerPreThink)
+MUTATOR_HOOKFUNCTION(ka, PlayerPreThink)
{SELFPARAM();
// clear the item used for the ball in keepaway
self.items &= ~IT_KEY1;
return 0;
}
-MUTATOR_HOOKFUNCTION(ka_PlayerUseKey)
+MUTATOR_HOOKFUNCTION(ka, PlayerUseKey)
{SELFPARAM();
if(MUTATOR_RETURNVALUE == 0)
if(self.ballcarried)
return 0;
}
-MUTATOR_HOOKFUNCTION(ka_PlayerDamage) // for changing damage and force values that are applied to players in g_damage.qc
+MUTATOR_HOOKFUNCTION(ka, PlayerDamage_Calculate) // for changing damage and force values that are applied to players in g_damage.qc
{
if(frag_attacker.ballcarried) // if the attacker is a ballcarrier
{
return 0;
}
-MUTATOR_HOOKFUNCTION(ka_RemovePlayer)
+MUTATOR_HOOKFUNCTION(ka, ClientDisconnect)
{SELFPARAM();
if(self.ballcarried) { ka_DropEvent(self); } // a player with the ball has left the match, drop it
return 0;
}
-MUTATOR_HOOKFUNCTION(ka_PlayerPowerups)
+MUTATOR_HOOKFUNCTION(ka, MakePlayerObserver)
+{SELFPARAM();
+ if(self.ballcarried) { ka_DropEvent(self); } // a player with the ball has left the match, drop it
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(ka, PlayerPowerups)
{SELFPARAM();
// In the future this hook is supposed to allow me to do some extra stuff with waypointsprites and invisibility powerup
// So bare with me until I can fix a certain bug with ka_ballcarrier_waypointsprite_visible_for_player()
.float stat_sv_airspeedlimit_nonqw;
.float stat_sv_maxspeed;
-MUTATOR_HOOKFUNCTION(ka_PlayerPhysics)
+MUTATOR_HOOKFUNCTION(ka, PlayerPhysics)
{SELFPARAM();
if(self.ballcarried)
{
return false;
}
-MUTATOR_HOOKFUNCTION(ka_BotShouldAttack)
+MUTATOR_HOOKFUNCTION(ka, BotShouldAttack)
{SELFPARAM();
// if neither player has ball then don't attack unless the ball is on the ground
if(!checkentity.ballcarried && !self.ballcarried && ka_ball.owner)
return false;
}
-MUTATOR_HOOKFUNCTION(ka_BotRoles)
+MUTATOR_HOOKFUNCTION(ka, HavocBot_ChooseRole)
{SELFPARAM();
if (self.ballcarried)
self.havocbot_role = havocbot_role_ka_carrier;
}
-MUTATOR_DEFINITION(gamemode_keepaway)
+REGISTER_MUTATOR(ka, g_keepaway)
{
- MUTATOR_HOOK(MakePlayerObserver, ka_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, ka_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, ka_Scoring, CBC_ORDER_ANY);
- MUTATOR_HOOK(GiveFragsForKill, ka_GiveFragsForKill, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPreThink, ka_PlayerPreThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDamage_Calculate, ka_PlayerDamage, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPowerups, ka_PlayerPowerups, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerUseKey, ka_PlayerUseKey, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPhysics, ka_PlayerPhysics, CBC_ORDER_ANY);
- MUTATOR_HOOK(BotShouldAttack, ka_BotShouldAttack, CBC_ORDER_ANY);
- MUTATOR_HOOK(HavocBot_ChooseRole, ka_BotRoles, CBC_ORDER_ANY);
-
MUTATOR_ONADD
{
if(time > 1) // game loads at time 1
// register this as a mutator
-MUTATOR_HOOKFUNCTION(kh_Key_DropAll)
+MUTATOR_HOOKFUNCTION(kh, ClientDisconnect)
{SELFPARAM();
kh_Key_DropAll(self, true);
return 0;
}
-MUTATOR_HOOKFUNCTION(kh_PlayerDies)
+MUTATOR_HOOKFUNCTION(kh, MakePlayerObserver)
+{SELFPARAM();
+ kh_Key_DropAll(self, true);
+ return 0;
+}
+
+MUTATOR_HOOKFUNCTION(kh, PlayerDies)
{SELFPARAM();
if(self == other)
kh_Key_DropAll(self, true);
return 0;
}
-MUTATOR_HOOKFUNCTION(kh_GiveFragsForKill)
+MUTATOR_HOOKFUNCTION(kh, GiveFragsForKill, CBC_ORDER_FIRST)
{
frag_score = kh_HandleFrags(frag_attacker, frag_target, frag_score);
return 0;
}
-MUTATOR_HOOKFUNCTION(kh_finalize)
+MUTATOR_HOOKFUNCTION(kh, MatchEnd)
{
kh_finalize();
return 0;
}
-MUTATOR_HOOKFUNCTION(kh_GetTeamCount)
+MUTATOR_HOOKFUNCTION(kh, GetTeamCount, CBC_ORDER_EXCLUSIVE)
{
ret_float = kh_teams;
return 0;
}
-MUTATOR_HOOKFUNCTION(kh_SpectateCopy)
+MUTATOR_HOOKFUNCTION(kh, SpectateCopy)
{SELFPARAM();
self.kh_state = other.kh_state;
return 0;
}
-MUTATOR_HOOKFUNCTION(kh_PlayerUseKey)
+MUTATOR_HOOKFUNCTION(kh, PlayerUseKey)
{SELFPARAM();
if(MUTATOR_RETURNVALUE == 0)
{
return 0;
}
-MUTATOR_DEFINITION(gamemode_keyhunt)
+REGISTER_MUTATOR(kh, g_keyhunt)
{
- MUTATOR_HOOK(MakePlayerObserver, kh_Key_DropAll, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, kh_Key_DropAll, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, kh_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(GiveFragsForKill, kh_GiveFragsForKill, CBC_ORDER_FIRST);
- MUTATOR_HOOK(MatchEnd, kh_finalize, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetTeamCount, kh_GetTeamCount, CBC_ORDER_EXCLUSIVE);
- MUTATOR_HOOK(SpectateCopy, kh_SpectateCopy, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerUseKey, kh_PlayerUseKey, CBC_ORDER_ANY);
+ ActivateTeamplay();
+ SetLimits(autocvar_g_keyhunt_point_limit, autocvar_g_keyhunt_point_leadlimit, -1, -1);
+ if(autocvar_g_keyhunt_team_spawns)
+ have_team_spawns = -1; // request team spawns
MUTATOR_ONADD
{
}
// mutator hooks
-MUTATOR_HOOKFUNCTION(lms_ResetMap)
+MUTATOR_HOOKFUNCTION(lms, reset_map_global)
{
lms_lowest_lives = 999;
lms_next_place = player_count;
return false;
}
-MUTATOR_HOOKFUNCTION(lms_ResetPlayers)
+MUTATOR_HOOKFUNCTION(lms, reset_map_players)
{SELFPARAM();
entity e;
if(restart_mapalreadyrestarted || (time < game_starttime))
return false;
}
-MUTATOR_HOOKFUNCTION(lms_PlayerPreSpawn)
+MUTATOR_HOOKFUNCTION(lms, PutClientInServer)
{SELFPARAM();
// player is dead and becomes observer
// FIXME fix LMS scoring for new system
return false;
}
-MUTATOR_HOOKFUNCTION(lms_PlayerDies)
+MUTATOR_HOOKFUNCTION(lms, PlayerDies)
{SELFPARAM();
self.respawn_flags |= RESPAWN_FORCE;
return false;
}
-MUTATOR_HOOKFUNCTION(lms_RemovePlayer)
-{SELFPARAM();
+void lms_RemovePlayer(entity player)
+{
// Only if the player cannot play at all
- if(PlayerScore_Add(self, SP_LMS_RANK, 0) == 666)
- self.frags = FRAGS_SPECTATOR;
+ if(PlayerScore_Add(player, SP_LMS_RANK, 0) == 666)
+ player.frags = FRAGS_SPECTATOR;
else
- self.frags = FRAGS_LMS_LOSER;
+ player.frags = FRAGS_LMS_LOSER;
- if(self.killcount != -666)
- if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0 && self.lms_spectate_warning != 2)
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_NOLIVES, self.netname);
+ if(player.killcount != -666)
+ if(PlayerScore_Add(player, SP_LMS_RANK, 0) > 0 && player.lms_spectate_warning != 2)
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_NOLIVES, player.netname);
else
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_FORFEIT, self.netname);
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_FORFEIT, player.netname);
+}
+MUTATOR_HOOKFUNCTION(lms, ClientDisconnect)
+{SELFPARAM();
+ lms_RemovePlayer(self);
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(lms, MakePlayerObserver)
+{SELFPARAM();
+ lms_RemovePlayer(self);
return false;
}
-MUTATOR_HOOKFUNCTION(lms_ClientConnect)
+MUTATOR_HOOKFUNCTION(lms, ClientConnect)
{SELFPARAM();
self.classname = "player";
campaign_bots_may_start = 1;
return false;
}
-MUTATOR_HOOKFUNCTION(lms_PlayerThink)
+MUTATOR_HOOKFUNCTION(lms, PlayerPreThink)
{SELFPARAM();
if(self.deadflag == DEAD_DYING)
self.deadflag = DEAD_RESPAWNING;
return false;
}
-MUTATOR_HOOKFUNCTION(lms_PlayerRegen)
+MUTATOR_HOOKFUNCTION(lms, PlayerRegen)
{
if(autocvar_g_lms_regenerate)
return false;
return true;
}
-MUTATOR_HOOKFUNCTION(lms_ForbidThrowing)
+MUTATOR_HOOKFUNCTION(lms, ForbidThrowCurrentWeapon)
{
// forbode!
return true;
}
-MUTATOR_HOOKFUNCTION(lms_GiveFragsForKill)
+MUTATOR_HOOKFUNCTION(lms, GiveFragsForKill)
{
// remove a life
float tl;
return true;
}
-MUTATOR_HOOKFUNCTION(lms_SetStartItems)
+MUTATOR_HOOKFUNCTION(lms, SetStartItems)
{
start_items &= ~IT_UNLIMITED_AMMO;
start_health = warmup_start_health = cvar("g_lms_start_health");
return false;
}
-MUTATOR_HOOKFUNCTION(lms_KeepScore)
+MUTATOR_HOOKFUNCTION(lms, ForbidPlayerScore_Clear)
{
// don't clear player score
return true;
}
-MUTATOR_HOOKFUNCTION(lms_FilterItem)
+MUTATOR_HOOKFUNCTION(lms, FilterItem)
{SELFPARAM();
if(autocvar_g_lms_extra_lives)
if(self.itemdef == ITEM_HealthMega)
return true;
}
-MUTATOR_HOOKFUNCTION(lms_ItemTouch)
+MUTATOR_HOOKFUNCTION(lms, ItemTouch)
{SELFPARAM();
// give extra lives for mega health
if (self.items & ITEM_HealthMega.m_itemid)
lms_ScoreRules();
}
-MUTATOR_DEFINITION(gamemode_lms)
+REGISTER_MUTATOR(lms, g_lms)
{
- MUTATOR_HOOK(reset_map_global, lms_ResetMap, CBC_ORDER_ANY);
- MUTATOR_HOOK(reset_map_players, lms_ResetPlayers, CBC_ORDER_ANY);
- MUTATOR_HOOK(PutClientInServer, lms_PlayerPreSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, lms_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(MakePlayerObserver, lms_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientConnect, lms_ClientConnect, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPreThink, lms_PlayerThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerRegen, lms_PlayerRegen, CBC_ORDER_ANY);
- MUTATOR_HOOK(ForbidThrowCurrentWeapon, lms_ForbidThrowing, CBC_ORDER_ANY);
- MUTATOR_HOOK(GiveFragsForKill, lms_GiveFragsForKill, CBC_ORDER_ANY);
- MUTATOR_HOOK(SetStartItems, lms_SetStartItems, CBC_ORDER_ANY);
- MUTATOR_HOOK(ForbidPlayerScore_Clear, lms_KeepScore, CBC_ORDER_ANY);
- MUTATOR_HOOK(FilterItem, lms_FilterItem, CBC_ORDER_ANY);
- MUTATOR_HOOK(ItemTouch, lms_ItemTouch, CBC_ORDER_ANY);
+ SetLimits(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override), 0, -1, -1);
MUTATOR_ONADD
{
// Hook Functions
// ==============
-MUTATOR_HOOKFUNCTION(ons_ResetMap)
+MUTATOR_HOOKFUNCTION(ons, reset_map_global)
{SELFPARAM();
entity e;
FOR_EACH_PLAYER(e)
return false;
}
-MUTATOR_HOOKFUNCTION(ons_RemovePlayer)
+MUTATOR_HOOKFUNCTION(ons, ClientDisconnect)
{SELFPARAM();
self.ons_deathloc = '0 0 0';
return false;
}
-MUTATOR_HOOKFUNCTION(ons_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(ons, MakePlayerObserver)
+{SELFPARAM();
+ self.ons_deathloc = '0 0 0';
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(ons, PlayerSpawn)
{SELFPARAM();
if(!round_handler_IsRoundStarted())
{
return false;
}
-MUTATOR_HOOKFUNCTION(ons_PlayerDies)
+MUTATOR_HOOKFUNCTION(ons, PlayerDies)
{SELFPARAM();
frag_target.ons_deathloc = frag_target.origin;
entity l;
return false;
}
-MUTATOR_HOOKFUNCTION(ons_MonsterThink)
+MUTATOR_HOOKFUNCTION(ons, MonsterMove)
{SELFPARAM();
entity e = find(world, targetname, self.target);
if (e != world)
remove(self);
}
-MUTATOR_HOOKFUNCTION(ons_MonsterSpawn)
+MUTATOR_HOOKFUNCTION(ons, MonsterSpawn)
{SELFPARAM();
entity e = spawn();
e.owner = self;
remove(self);
}
-MUTATOR_HOOKFUNCTION(ons_TurretSpawn)
+MUTATOR_HOOKFUNCTION(ons, TurretSpawn)
{SELFPARAM();
entity e = spawn();
e.owner = self;
return false;
}
-MUTATOR_HOOKFUNCTION(ons_BotRoles)
+MUTATOR_HOOKFUNCTION(ons, HavocBot_ChooseRole)
{SELFPARAM();
havocbot_ons_reset_role(self);
return true;
}
-MUTATOR_HOOKFUNCTION(ons_GetTeamCount)
+MUTATOR_HOOKFUNCTION(ons, GetTeamCount)
{
// onslaught is special
entity tmp_entity;
return true;
}
-MUTATOR_HOOKFUNCTION(ons_SpectateCopy)
+MUTATOR_HOOKFUNCTION(ons, SpectateCopy)
{SELFPARAM();
self.ons_roundlost = other.ons_roundlost; // make spectators see it too
return false;
}
-MUTATOR_HOOKFUNCTION(ons_SV_ParseClientCommand)
+MUTATOR_HOOKFUNCTION(ons, SV_ParseClientCommand)
{SELFPARAM();
if(MUTATOR_RETURNVALUE) // command was already handled?
return false;
return 0;
}
-MUTATOR_HOOKFUNCTION(ons_PlayerUseKey)
+MUTATOR_HOOKFUNCTION(ons, PlayerUseKey)
{SELFPARAM();
if(MUTATOR_RETURNVALUE || gameover) { return false; }
return false;
}
-MUTATOR_HOOKFUNCTION(ons_PlayHitsound)
+MUTATOR_HOOKFUNCTION(ons, PlayHitsound)
{
return (frag_victim.classname == "onslaught_generator" && !frag_victim.isshielded)
|| (frag_victim.classname == "onslaught_controlpoint_icon" && !frag_victim.owner.isshielded);
InitializeEntity(world, ons_DelayedInit, INITPRIO_GAMETYPE);
}
-MUTATOR_DEFINITION(gamemode_onslaught)
+REGISTER_MUTATOR(ons, g_onslaught)
{
- MUTATOR_HOOK(reset_map_global, ons_ResetMap, CBC_ORDER_ANY);
- MUTATOR_HOOK(MakePlayerObserver, ons_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, ons_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, ons_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, ons_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(MonsterMove, ons_MonsterThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(MonsterSpawn, ons_MonsterSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(TurretSpawn, ons_TurretSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(HavocBot_ChooseRole, ons_BotRoles, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetTeamCount, ons_GetTeamCount, CBC_ORDER_ANY);
- MUTATOR_HOOK(SpectateCopy, ons_SpectateCopy, CBC_ORDER_ANY);
- MUTATOR_HOOK(SV_ParseClientCommand, ons_SV_ParseClientCommand, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerUseKey, ons_PlayerUseKey, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayHitsound, ons_PlayHitsound, CBC_ORDER_ANY);
+ ActivateTeamplay();
+ SetLimits(autocvar_g_onslaught_point_limit, -1, -1, -1);
+ have_team_spawns = -1; // request team spawns
MUTATOR_ONADD
{
GameLogEcho(strcat(":race:", mode, ":", ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
}
-MUTATOR_HOOKFUNCTION(race_PlayerPhysics)
+MUTATOR_HOOKFUNCTION(rc, PlayerPhysics)
{SELFPARAM();
// force kbd movement for fairness
float wishspeed;
return false;
}
-MUTATOR_HOOKFUNCTION(race_ResetMap)
+MUTATOR_HOOKFUNCTION(rc, reset_map_global)
{
float s;
return false;
}
-MUTATOR_HOOKFUNCTION(race_PlayerPreThink)
+MUTATOR_HOOKFUNCTION(rc, PlayerPreThink)
{SELFPARAM();
if(IS_SPEC(self) || IS_OBSERVER(self))
if(g_race_qualifying)
return false;
}
-MUTATOR_HOOKFUNCTION(race_ClientConnect)
+MUTATOR_HOOKFUNCTION(rc, ClientConnect)
{SELFPARAM();
race_PreparePlayer();
self.race_checkpoint = -1;
return false;
}
-MUTATOR_HOOKFUNCTION(race_MakePlayerObserver)
+MUTATOR_HOOKFUNCTION(rc, MakePlayerObserver)
{SELFPARAM();
if(g_race_qualifying)
if(PlayerScore_Add(self, SP_RACE_FASTEST, 0))
return false;
}
-MUTATOR_HOOKFUNCTION(race_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(rc, PlayerSpawn)
{SELFPARAM();
if(spawn_spot.target == "")
// Emergency: this wasn't a real spawnpoint. Can this ever happen?
return false;
}
-MUTATOR_HOOKFUNCTION(race_PutClientInServer)
+MUTATOR_HOOKFUNCTION(rc, PutClientInServer)
{SELFPARAM();
if(IS_PLAYER(self))
if(!gameover)
return false;
}
-MUTATOR_HOOKFUNCTION(race_PlayerDies)
+MUTATOR_HOOKFUNCTION(rc, PlayerDies)
{SELFPARAM();
self.respawn_flags |= RESPAWN_FORCE;
race_AbandonRaceCheck(self);
return false;
}
-MUTATOR_HOOKFUNCTION(race_BotRoles)
+MUTATOR_HOOKFUNCTION(rc, HavocBot_ChooseRole)
{SELFPARAM();
self.havocbot_role = havocbot_role_race;
return true;
}
-MUTATOR_HOOKFUNCTION(race_PlayerPostThink)
+MUTATOR_HOOKFUNCTION(rc, GetPressedKeys)
{SELFPARAM();
if(self.cvar_cl_allow_uidtracking == 1 && self.cvar_cl_allow_uid2name == 1)
{
return false;
}
-MUTATOR_HOOKFUNCTION(race_ForbidClearPlayerScore)
+MUTATOR_HOOKFUNCTION(rc, ForbidPlayerScore_Clear)
{
if(g_race_qualifying)
return true; // in qualifying, you don't lose score by observing
return false;
}
-MUTATOR_HOOKFUNCTION(race_GetTeamCount)
+MUTATOR_HOOKFUNCTION(rc, GetTeamCount, CBC_ORDER_EXCLUSIVE)
{
ret_float = race_teams;
return false;
}
-MUTATOR_HOOKFUNCTION(race_CountFrags)
+MUTATOR_HOOKFUNCTION(rc, Scores_CountFragsRemaining)
{
// announce remaining frags if not in qualifying mode
if(!g_race_qualifying)
warmup_stage = 0;
}
-MUTATOR_DEFINITION(gamemode_race)
+void rc_SetLimits()
{
- MUTATOR_HOOK(PlayerPhysics, race_PlayerPhysics, CBC_ORDER_ANY);
- MUTATOR_HOOK(reset_map_global, race_ResetMap, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPreThink, race_PlayerPreThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientConnect, race_ClientConnect, CBC_ORDER_ANY);
- MUTATOR_HOOK(MakePlayerObserver, race_MakePlayerObserver, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, race_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PutClientInServer, race_PutClientInServer, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, race_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(HavocBot_ChooseRole, race_BotRoles, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetPressedKeys, race_PlayerPostThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(ForbidPlayerScore_Clear, race_ForbidClearPlayerScore, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetTeamCount, race_GetTeamCount, CBC_ORDER_ANY);
- MUTATOR_HOOK(Scores_CountFragsRemaining, race_CountFrags, CBC_ORDER_ANY);
+ int fraglimit_override, leadlimit_override;
+ float timelimit_override, qualifying_override;
+
+ if(autocvar_g_race_teams)
+ {
+ ActivateTeamplay();
+ race_teams = bound(2, autocvar_g_race_teams, 4);
+ have_team_spawns = -1; // request team spawns
+ }
+ else
+ race_teams = 0;
+
+ qualifying_override = autocvar_g_race_qualifying_timelimit_override;
+ fraglimit_override = autocvar_g_race_laps_limit;
+ leadlimit_override = 0; // currently not supported by race
+ timelimit_override = -1; // use default if we don't set it below
+
+ // we need to find out the correct value for g_race_qualifying
+ float want_qualifying = ((qualifying_override >= 0) ? qualifying_override : autocvar_g_race_qualifying_timelimit) > 0;
+
+ if(autocvar_g_campaign)
+ {
+ g_race_qualifying = 1;
+ independent_players = 1;
+ }
+ else if(!autocvar_g_campaign && want_qualifying)
+ {
+ g_race_qualifying = 2;
+ independent_players = 1;
+ race_fraglimit = (race_fraglimit >= 0) ? fraglimit_override : autocvar_fraglimit;
+ race_leadlimit = (race_leadlimit >= 0) ? leadlimit_override : autocvar_leadlimit;
+ race_timelimit = (race_timelimit >= 0) ? timelimit_override : autocvar_timelimit;
+ fraglimit_override = 0;
+ leadlimit_override = 0;
+ timelimit_override = autocvar_g_race_qualifying_timelimit;
+ }
+ else
+ g_race_qualifying = 0;
+
+ SetLimits(fraglimit_override, leadlimit_override, timelimit_override, qualifying_override);
+}
+
+REGISTER_MUTATOR(rc, g_race)
+{
+ rc_SetLimits();
MUTATOR_ONADD
{
}
}
-MUTATOR_HOOKFUNCTION(tdm_GetTeamCount)
+MUTATOR_HOOKFUNCTION(tdm, GetTeamCount, CBC_ORDER_EXCLUSIVE)
{
ret_string = "tdm_team";
return true;
}
-MUTATOR_HOOKFUNCTION(tdm_CountFrags)
+MUTATOR_HOOKFUNCTION(tdm, Scores_CountFragsRemaining)
{
// announce remaining frags
return true;
}
-MUTATOR_DEFINITION(gamemode_tdm)
+REGISTER_MUTATOR(tdm, g_tdm)
{
- MUTATOR_HOOK(GetTeamCount, tdm_GetTeamCount, CBC_ORDER_ANY);
- MUTATOR_HOOK(Scores_CountFragsRemaining, tdm_CountFrags, CBC_ORDER_ANY);
+ ActivateTeamplay();
+ SetLimits(autocvar_g_tdm_point_limit, autocvar_g_tdm_point_leadlimit, -1, -1);
+ if(autocvar_g_tdm_team_spawns)
+ have_team_spawns = -1; // request team spawns
MUTATOR_ONADD
{
#ifndef MUTATORS_H
#define MUTATORS_H
-MUTATOR_DECLARATION(gamemode_assault);
-MUTATOR_DECLARATION(gamemode_ca);
-MUTATOR_DECLARATION(gamemode_keyhunt);
-MUTATOR_DECLARATION(gamemode_freezetag);
-MUTATOR_DECLARATION(gamemode_keepaway);
-MUTATOR_DECLARATION(gamemode_ctf);
-MUTATOR_DECLARATION(gamemode_onslaught);
-MUTATOR_DECLARATION(gamemode_domination);
-MUTATOR_DECLARATION(gamemode_lms);
-MUTATOR_DECLARATION(gamemode_invasion);
-MUTATOR_DECLARATION(gamemode_cts);
-MUTATOR_DECLARATION(gamemode_race);
-MUTATOR_DECLARATION(gamemode_tdm);
-MUTATOR_DECLARATION(gamemode_deathmatch);
-
MUTATOR_DECLARATION(mutator_dodging);
MUTATOR_DECLARATION(mutator_invincibleprojectiles);
MUTATOR_DECLARATION(mutator_new_toys);
cvar_set("teamplay", "2"); // DP needs this for sending proper getstatus replies.
}
-void InitGameplayMode()
+void SetLimits(int fraglimit_override, int leadlimit_override, float timelimit_override, float qualifying_override)
{
- float fraglimit_override, timelimit_override, leadlimit_override, qualifying_override;
-
- qualifying_override = -1;
+ // enforce the server's universal frag/time limits
+ // set to -1 to not change value
+ if(!autocvar_g_campaign)
+ {
+ if(fraglimit_override >= 0)
+ cvar_set("fraglimit", ftos(fraglimit_override));
+ if(timelimit_override >= 0)
+ cvar_set("timelimit", ftos(timelimit_override));
+ if(leadlimit_override >= 0)
+ cvar_set("leadlimit", ftos(leadlimit_override));
+ if(qualifying_override >= 0)
+ cvar_set("g_race_qualifying_timelimit", ftos(qualifying_override));
+ }
+}
+void InitGameplayMode()
+{
VoteReset();
// find out good world mins/maxs bounds, either the static bounds found by looking for solid, or the mapinfo specified bounds
MapInfo_ClearTemps();
// set both here, gamemode can override it later
- timelimit_override = autocvar_timelimit_override;
- fraglimit_override = autocvar_fraglimit_override;
- leadlimit_override = autocvar_leadlimit_override;
+ SetLimits(autocvar_fraglimit_override, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
gamemode_name = MapInfo_Type_ToText(MapInfo_LoadedGametype);
- if(g_dm)
- {
- MUTATOR_ADD(gamemode_deathmatch);
- }
-
- if(g_tdm)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_tdm_point_limit;
- leadlimit_override = autocvar_g_tdm_point_leadlimit;
- if(autocvar_g_tdm_team_spawns)
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_tdm);
- }
-
- if(g_domination)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_domination_point_limit;
- leadlimit_override = autocvar_g_domination_point_leadlimit;
- if(autocvar_g_domination_roundbased && autocvar_g_domination_roundbased_point_limit)
- fraglimit_override = autocvar_g_domination_roundbased_point_limit;
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_domination);
- }
-
- if(g_ctf)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_capturelimit_override;
- leadlimit_override = autocvar_captureleadlimit_override;
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_ctf);
- }
-
- if(g_lms)
- {
- fraglimit_override = autocvar_g_lms_lives_override;
- leadlimit_override = 0; // not supported by LMS
- if(fraglimit_override == 0)
- fraglimit_override = -1;
- MUTATOR_ADD(gamemode_lms);
- }
-
- if(g_ca)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_ca_point_limit;
- leadlimit_override = autocvar_g_ca_point_leadlimit;
- if(autocvar_g_ca_team_spawns)
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_ca);
- }
-
- if(g_keyhunt)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_keyhunt_point_limit;
- leadlimit_override = autocvar_g_keyhunt_point_leadlimit;
- if(autocvar_g_keyhunt_team_spawns)
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_keyhunt);
- }
-
- if(g_freezetag)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_freezetag_point_limit;
- leadlimit_override = autocvar_g_freezetag_point_leadlimit;
- if(autocvar_g_freezetag_team_spawns)
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_freezetag);
- }
-
- if(g_assault)
- {
- ActivateTeamplay();
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_assault);
- }
-
- if(g_onslaught)
- {
- ActivateTeamplay();
- fraglimit_override = autocvar_g_onslaught_point_limit;
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_onslaught);
- }
-
- if(g_race)
- {
- if(autocvar_g_race_teams)
- {
- ActivateTeamplay();
- race_teams = bound(2, autocvar_g_race_teams, 4);
- have_team_spawns = -1; // request team spawns
- }
- else
- race_teams = 0;
- qualifying_override = autocvar_g_race_qualifying_timelimit_override;
- fraglimit_override = autocvar_g_race_laps_limit;
- leadlimit_override = 0; // currently not supported by race
-
- // we need to find out the correct value for g_race_qualifying
- float want_qualifying = ((qualifying_override >= 0) ? qualifying_override : autocvar_g_race_qualifying_timelimit) > 0;
-
- if(autocvar_g_campaign)
- {
- g_race_qualifying = 1;
- independent_players = 1;
- }
- else if(!autocvar_g_campaign && want_qualifying)
- {
- g_race_qualifying = 2;
- independent_players = 1;
- race_fraglimit = (race_fraglimit >= 0) ? fraglimit_override : autocvar_fraglimit;
- race_leadlimit = (race_leadlimit >= 0) ? leadlimit_override : autocvar_leadlimit;
- race_timelimit = (race_timelimit >= 0) ? timelimit_override : autocvar_timelimit;
- fraglimit_override = 0;
- leadlimit_override = 0;
- timelimit_override = autocvar_g_race_qualifying_timelimit;
- }
- else
- {
- g_race_qualifying = 0;
- }
-
- MUTATOR_ADD(gamemode_race);
- }
-
- if(g_cts)
- {
- g_race_qualifying = 1;
- fraglimit_override = 0;
- leadlimit_override = 0;
- independent_players = 1;
- MUTATOR_ADD(gamemode_cts);
- }
-
- if(g_nexball)
- {
- fraglimit_override = autocvar_g_nexball_goallimit;
- leadlimit_override = autocvar_g_nexball_goalleadlimit;
- ActivateTeamplay();
- have_team_spawns = -1; // request team spawns
- MUTATOR_ADD(gamemode_nexball);
- }
-
- if(g_keepaway)
- {
- MUTATOR_ADD(gamemode_keepaway);
- }
-
- if(g_invasion)
- {
- fraglimit_override = autocvar_g_invasion_point_limit;
- if(autocvar_g_invasion_teams >= 2)
- {
- ActivateTeamplay();
- if(autocvar_g_invasion_team_spawns)
- have_team_spawns = -1; // request team spawns
- }
- MUTATOR_ADD(gamemode_invasion);
- }
-
cache_mutatormsg = strzone("");
cache_lastmutatormsg = strzone("");
- // enforce the server's universal frag/time limits
- if(!autocvar_g_campaign)
- {
- if(fraglimit_override >= 0)
- cvar_set("fraglimit", ftos(fraglimit_override));
- if(timelimit_override >= 0)
- cvar_set("timelimit", ftos(timelimit_override));
- if(leadlimit_override >= 0)
- cvar_set("leadlimit", ftos(leadlimit_override));
- if(qualifying_override >= 0)
- cvar_set("g_race_qualifying_timelimit", ftos(qualifying_override));
- }
-
InitializeEntity(world, default_delayedinit, INITPRIO_GAMETYPE_FALLBACK);
}