float sv_taunt;
string GetGametype(); // g_world.qc
-void mutators_add(); // mutators.qc
void readlevelcvars(void)
{
- // load mutators
- mutators_add();
-
if(cvar("sv_allow_fullbright"))
serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
#include "mutator.qh"
+REGISTER_MUTATOR(bloodloss, cvar("g_bloodloss"));
+
.float bloodloss_timer;
-MUTATOR_HOOKFUNCTION(bloodloss_PlayerThink)
+MUTATOR_HOOKFUNCTION(bloodloss, PlayerPreThink)
{SELFPARAM();
if(IS_PLAYER(self))
if(self.health <= autocvar_g_bloodloss && self.deadflag == DEAD_NO)
return false;
}
-MUTATOR_HOOKFUNCTION(bloodloss_PlayerJump)
+MUTATOR_HOOKFUNCTION(bloodloss, PlayerJump)
{SELFPARAM();
if(self.health <= autocvar_g_bloodloss)
return true;
return false;
}
-MUTATOR_HOOKFUNCTION(bloodloss_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(bloodloss, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":bloodloss");
return false;
}
-MUTATOR_HOOKFUNCTION(bloodloss_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(bloodloss, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Blood loss");
return false;
}
-
-MUTATOR_DEFINITION(mutator_bloodloss)
-{
- MUTATOR_HOOK(PlayerPreThink, bloodloss_PlayerThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerJump, bloodloss_PlayerJump, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, bloodloss_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, bloodloss_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
- return false;
-}
#include "../../common/deathtypes/all.qh"
#include "../g_hook.qh"
-REGISTER_MUTATOR(bh, cvar("g_breakablehook"));
+REGISTER_MUTATOR(breakablehook, cvar("g_breakablehook"));
bool autocvar_g_breakablehook; // allow toggling mid match?
bool autocvar_g_breakablehook_owner;
-MUTATOR_HOOKFUNCTION(bh, PlayerDamage_Calculate)
+MUTATOR_HOOKFUNCTION(breakablehook, PlayerDamage_Calculate)
{
if(frag_target.classname == "grapplinghook")
{
#include "../../common/gamemodes/all.qh"
#include "../../common/buffs/all.qh"
+.float buff_time;
+void buffs_DelayedInit();
+
+REGISTER_MUTATOR(buffs, cvar("g_buffs"))
+{
+ MUTATOR_ONADD
+ {
+ addstat(STAT_BUFFS, AS_INT, buffs);
+ addstat(STAT_BUFF_TIME, AS_FLOAT, buff_time);
+
+ InitializeEntity(world, buffs_DelayedInit, INITPRIO_FINDTARGET);
+ }
+}
+
entity buff_FirstFromFlags(int _buffs)
{
if (flags)
}
// mutator hooks
-MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_SplitHealthArmor)
+MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_SplitHealthArmor)
{
if(frag_deathtype == DEATH_BUFF.m_id) { return false; }
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
+MUTATOR_HOOKFUNCTION(buffs, PlayerDamage_Calculate)
{
if(frag_deathtype == DEATH_BUFF.m_id) { return false; }
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(buffs,PlayerSpawn)
{SELFPARAM();
self.buffs = 0;
// reset timers here to prevent them continuing after re-spawn
.float stat_sv_airspeedlimit_nonqw;
.float stat_sv_jumpvelocity;
-MUTATOR_HOOKFUNCTION(buffs_PlayerPhysics)
+MUTATOR_HOOKFUNCTION(buffs, PlayerPhysics)
{SELFPARAM();
if(self.buffs & BUFF_SPEED.m_itemid)
{
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_PlayerJump)
+MUTATOR_HOOKFUNCTION(buffs, PlayerJump)
{SELFPARAM();
if(self.buffs & BUFF_JUMP.m_itemid)
player_jumpheight = autocvar_g_buffs_jump_height;
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_MonsterMove)
+MUTATOR_HOOKFUNCTION(buffs, MonsterMove)
{SELFPARAM();
if(time < self.buff_disability_time)
{
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_PlayerDies)
+MUTATOR_HOOKFUNCTION(buffs, PlayerDies)
{SELFPARAM();
if(self.buffs)
{
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_PlayerUseKey)
+MUTATOR_HOOKFUNCTION(buffs, PlayerUseKey, CBC_ORDER_FIRST)
{SELFPARAM();
if(MUTATOR_RETURNVALUE || gameover) { return false; }
if(self.buffs)
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_PlayerThrowKey)
+MUTATOR_HOOKFUNCTION(buffs, ForbidThrowCurrentWeapon)
{SELFPARAM();
if(MUTATOR_RETURNVALUE || gameover) { return false; }
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_RemovePlayer)
-{SELFPARAM();
- if(self.buff_model)
+bool buffs_RemovePlayer(entity player)
+{
+ if(player.buff_model)
{
- remove(self.buff_model);
- self.buff_model = world;
+ remove(player.buff_model);
+ player.buff_model = world;
}
// also reset timers here to prevent them continuing after spectating
- self.buff_disability_time = 0;
- self.buff_disability_effect_time = 0;
+ player.buff_disability_time = 0;
+ player.buff_disability_effect_time = 0;
return false;
}
+MUTATOR_HOOKFUNCTION(buffs, MakePlayerObserver) { return buffs_RemovePlayer(self); }
+MUTATOR_HOOKFUNCTION(buffs, ClientDisconnect) { return buffs_RemovePlayer(self); }
-MUTATOR_HOOKFUNCTION(buffs_CustomizeWaypoint)
+MUTATOR_HOOKFUNCTION(buffs, CustomizeWaypoint)
{SELFPARAM();
entity e = WaypointSprite_getviewentity(other);
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_OnEntityPreSpawn)
+MUTATOR_HOOKFUNCTION(buffs, OnEntityPreSpawn, CBC_ORDER_LAST)
{SELFPARAM();
if(autocvar_g_buffs_replace_powerups)
switch(self.classname)
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_WeaponRate)
+MUTATOR_HOOKFUNCTION(buffs, WeaponRateFactor)
{SELFPARAM();
if(self.buffs & BUFF_SPEED.m_itemid)
weapon_rate *= autocvar_g_buffs_speed_rate;
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_WeaponSpeed)
+MUTATOR_HOOKFUNCTION(buffs, WeaponSpeedFactor)
{SELFPARAM();
if(self.buffs & BUFF_SPEED.m_itemid)
ret_float *= autocvar_g_buffs_speed_weaponspeed;
return false;
}
-.float buff_time;
-
-MUTATOR_HOOKFUNCTION(buffs_PlayerThink)
+MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink)
{SELFPARAM();
if(gameover || self.deadflag != DEAD_NO) { return false; }
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_SpectateCopy)
+MUTATOR_HOOKFUNCTION(buffs, SpectateCopy)
{SELFPARAM();
self.buffs = other.buffs;
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_VehicleEnter)
+MUTATOR_HOOKFUNCTION(buffs, VehicleEnter)
{
vh_vehicle.buffs = vh_player.buffs;
vh_player.buffs = 0;
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_VehicleExit)
+MUTATOR_HOOKFUNCTION(buffs, VehicleExit)
{
vh_player.buffs = vh_vehicle.buffs;
vh_vehicle.buffs = 0;
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_PlayerRegen)
+MUTATOR_HOOKFUNCTION(buffs, PlayerRegen)
{SELFPARAM();
if(self.buffs & BUFF_MEDIC.m_itemid)
{
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_GetCvars)
+MUTATOR_HOOKFUNCTION(buffs, GetCvars)
{
GetCvars_handleFloat(get_cvars_s, get_cvars_f, cvar_cl_buffs_autoreplace, "cl_buffs_autoreplace");
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(buffs, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":Buffs");
return false;
}
-MUTATOR_HOOKFUNCTION(buffs_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(buffs, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Buffs");
return false;
}
}
}
-
-void buffs_Initialize()
-{
- addstat(STAT_BUFFS, AS_INT, buffs);
- addstat(STAT_BUFF_TIME, AS_FLOAT, buff_time);
-
- InitializeEntity(world, buffs_DelayedInit, INITPRIO_FINDTARGET);
-}
-
-MUTATOR_DEFINITION(mutator_buffs)
-{
- MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, buffs_PlayerDamage_SplitHealthArmor, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDamage_Calculate, buffs_PlayerDamage_Calculate, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, buffs_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPhysics, buffs_PlayerPhysics, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerJump, buffs_PlayerJump, CBC_ORDER_ANY);
- MUTATOR_HOOK(MonsterMove, buffs_MonsterMove, CBC_ORDER_ANY);
- MUTATOR_HOOK(SpectateCopy, buffs_SpectateCopy, CBC_ORDER_ANY);
- MUTATOR_HOOK(VehicleEnter, buffs_VehicleEnter, CBC_ORDER_ANY);
- MUTATOR_HOOK(VehicleExit, buffs_VehicleExit, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerRegen, buffs_PlayerRegen, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, buffs_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerUseKey, buffs_PlayerUseKey, CBC_ORDER_FIRST);
- MUTATOR_HOOK(ForbidThrowCurrentWeapon, buffs_PlayerThrowKey, CBC_ORDER_ANY);
- MUTATOR_HOOK(MakePlayerObserver, buffs_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, buffs_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(OnEntityPreSpawn, buffs_OnEntityPreSpawn, CBC_ORDER_LAST);
- MUTATOR_HOOK(CustomizeWaypoint, buffs_CustomizeWaypoint, CBC_ORDER_ANY);
- MUTATOR_HOOK(WeaponRateFactor, buffs_WeaponRate, CBC_ORDER_ANY);
- MUTATOR_HOOK(WeaponSpeedFactor, buffs_WeaponSpeed, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPreThink, buffs_PlayerThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetCvars, buffs_GetCvars, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, buffs_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, buffs_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
- MUTATOR_ONADD
- {
- buffs_Initialize();
- }
-
- return false;
-}
#include "../campaign.qh"
+REGISTER_MUTATOR(campcheck, cvar("g_campcheck"));
+
.float campcheck_nextcheck;
.float campcheck_traveled_distance;
-MUTATOR_HOOKFUNCTION(campcheck_PlayerDies)
+MUTATOR_HOOKFUNCTION(campcheck, PlayerDies)
{SELFPARAM();
Kill_Notification(NOTIF_ONE, self, MSG_CENTER_CPID, CPID_CAMPCHECK);
return false;
}
-MUTATOR_HOOKFUNCTION(campcheck_PlayerDamage)
+MUTATOR_HOOKFUNCTION(campcheck, PlayerDamage_Calculate)
{
if(IS_PLAYER(frag_target))
if(IS_PLAYER(frag_attacker))
return false;
}
-MUTATOR_HOOKFUNCTION(campcheck_PlayerThink)
+MUTATOR_HOOKFUNCTION(campcheck, PlayerPreThink)
{SELFPARAM();
if(!gameover)
if(!warmup_stage) // don't consider it camping during warmup?
return false;
}
-MUTATOR_HOOKFUNCTION(campcheck_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(campcheck, PlayerSpawn)
{SELFPARAM();
self.campcheck_nextcheck = time + autocvar_g_campcheck_interval * 2;
self.campcheck_traveled_distance = 0;
return false;
}
-MUTATOR_HOOKFUNCTION(campcheck_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(campcheck, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":CampCheck");
return false;
}
-
-MUTATOR_DEFINITION(mutator_campcheck)
-{
- MUTATOR_HOOK(PlayerDies, campcheck_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDamage_Calculate, campcheck_PlayerDamage, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPreThink, campcheck_PlayerThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, campcheck_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, campcheck_BuildMutatorsString, CBC_ORDER_ANY);
-
- return false;
-}
.float stat_dodging_up_speed;
.float stat_dodging_wall;
+REGISTER_MUTATOR(dodging, cvar("g_dodging"))
+{
+ // this just turns on the cvar.
+ MUTATOR_ONADD
+ {
+ g_dodging = cvar("g_dodging");
+ addstat(STAT_DODGING, AS_INT, stat_dodging);
+ addstat(STAT_DODGING_DELAY, AS_FLOAT, stat_dodging_delay);
+ addstat(STAT_DODGING_TIMEOUT, AS_FLOAT, cvar_cl_dodging_timeout); // we stat this, so it is updated on the client when updated on server (otherwise, chaos)
+ addstat(STAT_DODGING_FROZEN_NO_DOUBLETAP, AS_INT, stat_dodging_frozen_nodoubletap);
+ addstat(STAT_DODGING_HORIZ_SPEED_FROZEN, AS_FLOAT, stat_dodging_horiz_speed_frozen);
+ addstat(STAT_DODGING_FROZEN, AS_INT, stat_dodging_frozen);
+ addstat(STAT_DODGING_HORIZ_SPEED, AS_FLOAT, stat_dodging_horiz_speed);
+ addstat(STAT_DODGING_HEIGHT_THRESHOLD, AS_FLOAT, stat_dodging_height_threshold);
+ addstat(STAT_DODGING_DISTANCE_THRESHOLD, AS_FLOAT, stat_dodging_distance_threshold);
+ addstat(STAT_DODGING_RAMP_TIME, AS_FLOAT, stat_dodging_ramp_time);
+ addstat(STAT_DODGING_UP_SPEED, AS_FLOAT, stat_dodging_up_speed);
+ addstat(STAT_DODGING_WALL, AS_FLOAT, stat_dodging_wall);
+ }
+
+ // this just turns off the cvar.
+ MUTATOR_ONROLLBACK_OR_REMOVE
+ {
+ g_dodging = 0;
+ }
+
+ return false;
+}
+
#endif
// set to 1 to indicate dodging has started.. reset by physics hook after dodge has been done..
self.stat_dodging_wall = PHYS_DODGING_WALL;
}
-void dodging_Initialize()
-{
- addstat(STAT_DODGING, AS_INT, stat_dodging);
- addstat(STAT_DODGING_DELAY, AS_FLOAT, stat_dodging_delay);
- addstat(STAT_DODGING_TIMEOUT, AS_FLOAT, cvar_cl_dodging_timeout); // we stat this, so it is updated on the client when updated on server (otherwise, chaos)
- addstat(STAT_DODGING_FROZEN_NO_DOUBLETAP, AS_INT, stat_dodging_frozen_nodoubletap);
- addstat(STAT_DODGING_HORIZ_SPEED_FROZEN, AS_FLOAT, stat_dodging_horiz_speed_frozen);
- addstat(STAT_DODGING_FROZEN, AS_INT, stat_dodging_frozen);
- addstat(STAT_DODGING_HORIZ_SPEED, AS_FLOAT, stat_dodging_horiz_speed);
- addstat(STAT_DODGING_HEIGHT_THRESHOLD, AS_FLOAT, stat_dodging_height_threshold);
- addstat(STAT_DODGING_DISTANCE_THRESHOLD, AS_FLOAT, stat_dodging_distance_threshold);
- addstat(STAT_DODGING_RAMP_TIME, AS_FLOAT, stat_dodging_ramp_time);
- addstat(STAT_DODGING_UP_SPEED, AS_FLOAT, stat_dodging_up_speed);
- addstat(STAT_DODGING_WALL, AS_FLOAT, stat_dodging_wall);
-}
-
#endif
// returns 1 if the player is close to a wall
#ifdef SVQC
-MUTATOR_HOOKFUNCTION(dodging_GetCvars)
+MUTATOR_HOOKFUNCTION(dodging, GetCvars)
{
GetCvars_handleFloat(get_cvars_s, get_cvars_f, cvar_cl_dodging_timeout, "cl_dodging_timeout");
return false;
}
-MUTATOR_HOOKFUNCTION(dodging_PlayerPhysics)
+MUTATOR_HOOKFUNCTION(dodging, PlayerPhysics)
{
// print("dodging_PlayerPhysics\n");
PM_dodging();
return false;
}
-MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys)
+MUTATOR_HOOKFUNCTION(dodging, GetPressedKeys)
{
PM_dodging_checkpressedkeys();
return false;
}
-MUTATOR_DEFINITION(mutator_dodging)
-{
- // we need to be called before GetPressedKey does its thing so we can
- // detect state changes and therefore dodging actions..
- MUTATOR_HOOK(GetPressedKeys, dodging_GetPressedKeys, CBC_ORDER_ANY);
-
- // in the physics hook we actually implement the dodge..
- MUTATOR_HOOK(PlayerPhysics, dodging_PlayerPhysics, CBC_ORDER_ANY);
-
- // get timeout information from the client, so the client can configure it..
- MUTATOR_HOOK(GetCvars, dodging_GetCvars, CBC_ORDER_ANY);
-
- // this just turns on the cvar.
- MUTATOR_ONADD
- {
- g_dodging = cvar("g_dodging");
- dodging_Initialize();
- }
-
- // this just turns off the cvar.
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- g_dodging = 0;
- }
-
- return false;
-}
#endif
#include "mutator.qh"
-MUTATOR_HOOKFUNCTION(invincibleprojectiles_EditProjectile)
+REGISTER_MUTATOR(invincibleprojectiles, cvar("g_invincible_projectiles"));
+
+MUTATOR_HOOKFUNCTION(invincibleprojectiles, EditProjectile)
{
if(other.health)
{
return 0;
}
-MUTATOR_HOOKFUNCTION(invincibleprojectiles_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(invincibleprojectiles, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":InvincibleProjectiles");
return 0;
}
-MUTATOR_HOOKFUNCTION(invincibleprojectiles_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(invincibleprojectiles, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Invincible Projectiles");
return 0;
}
-
-MUTATOR_DEFINITION(mutator_invincibleprojectiles)
-{
- MUTATOR_HOOK(EditProjectile, invincibleprojectiles_EditProjectile, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, invincibleprojectiles_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, invincibleprojectiles_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
- return 0;
-}
#include "mutator.qh"
-MUTATOR_HOOKFUNCTION(melee_SetStartItems)
+REGISTER_MUTATOR(melee_only, cvar("g_melee_only") && !cvar("g_instagib") && !g_nexball);
+
+MUTATOR_HOOKFUNCTION(melee_only, SetStartItems)
{
start_ammo_shells = warmup_start_ammo_shells = 0;
start_weapons = warmup_start_weapons = WEPSET(SHOTGUN);
return false;
}
-MUTATOR_HOOKFUNCTION(melee_ForbidThrowing)
+MUTATOR_HOOKFUNCTION(melee_only, ForbidThrowCurrentWeapon)
{
return true;
}
-MUTATOR_HOOKFUNCTION(melee_FilterItem)
+MUTATOR_HOOKFUNCTION(melee_only, FilterItem)
{SELFPARAM();
switch (self.items)
{
return true;
}
-MUTATOR_HOOKFUNCTION(melee_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(melee_only, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":MeleeOnly");
return false;
}
-MUTATOR_HOOKFUNCTION(melee_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(melee_only, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Melee Only Arena");
return false;
}
-
-MUTATOR_DEFINITION(mutator_melee_only)
-{
- MUTATOR_HOOK(SetStartItems, melee_SetStartItems, CBC_ORDER_ANY);
- MUTATOR_HOOK(ForbidThrowCurrentWeapon, melee_ForbidThrowing, CBC_ORDER_ANY);
- MUTATOR_HOOK(FilterItem, melee_FilterItem, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, melee_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, melee_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
- return false;
-}
#include "mutator.qh"
+REGISTER_MUTATOR(midair, cvar("g_midair"));
+
.float midair_shieldtime;
-MUTATOR_HOOKFUNCTION(midair_PlayerDamage)
+MUTATOR_HOOKFUNCTION(midair, PlayerDamage_Calculate)
{SELFPARAM();
if(IS_PLAYER(frag_attacker))
if(IS_PLAYER(frag_target))
return false;
}
-MUTATOR_HOOKFUNCTION(midair_PlayerPowerups)
+MUTATOR_HOOKFUNCTION(midair, PlayerPowerups)
{SELFPARAM();
if(time >= game_starttime)
if(self.flags & FL_ONGROUND)
return false;
}
-MUTATOR_HOOKFUNCTION(midair_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(midair, PlayerSpawn)
{SELFPARAM();
if(IS_BOT_CLIENT(self))
self.bot_moveskill = 0; // disable bunnyhopping
return false;
}
-MUTATOR_HOOKFUNCTION(midair_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(midair, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":midair");
return false;
}
-MUTATOR_HOOKFUNCTION(midair_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(midair, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Midair");
return false;
}
-
-MUTATOR_DEFINITION(mutator_midair)
-{
- MUTATOR_HOOK(PlayerDamage_Calculate, midair_PlayerDamage, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPowerups, midair_PlayerPowerups, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, midair_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, midair_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, midair_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
- return false;
-}
}
#ifdef SVQC
-MUTATOR_HOOKFUNCTION(multijump_PlayerPhysics)
+REGISTER_MUTATOR(multijump, cvar("g_multijump"))
+{
+ MUTATOR_ONADD
+ {
+ multijump_AddStats();
+ }
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(multijump, PlayerPhysics)
{
multijump_UpdateStats();
PM_multijump();
return false;
}
-MUTATOR_HOOKFUNCTION(multijump_PlayerJump)
+MUTATOR_HOOKFUNCTION(multijump, PlayerJump)
{
return PM_multijump_checkjump();
}
-MUTATOR_HOOKFUNCTION(multijump_GetCvars)
+MUTATOR_HOOKFUNCTION(multijump, GetCvars)
{
GetCvars_handleFloat(get_cvars_s, get_cvars_f, cvar_cl_multijump, "cl_multijump");
return false;
}
-MUTATOR_HOOKFUNCTION(multijump_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(multijump, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":multijump");
return false;
}
-MUTATOR_HOOKFUNCTION(multijump_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(multijump, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Multi jump");
return false;
}
-MUTATOR_DEFINITION(mutator_multijump)
-{
- MUTATOR_HOOK(PlayerPhysics, multijump_PlayerPhysics, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerJump, multijump_PlayerJump, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetCvars, multijump_GetCvars, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, multijump_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, multijump_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
- MUTATOR_ONADD
- {
- multijump_AddStats();
- }
-
- return false;
-}
#endif
#include "../../common/monsters/sv_monsters.qh"
#include "../g_subs.qh"
+REGISTER_MUTATOR(nades, cvar("g_nades"))
+{
+ MUTATOR_ONADD
+ {
+ addstat(STAT_NADE_TIMER, AS_FLOAT, nade_timer);
+ addstat(STAT_NADE_BONUS, AS_FLOAT, bonus_nades);
+ addstat(STAT_NADE_BONUS_TYPE, AS_INT, nade_type);
+ addstat(STAT_NADE_BONUS_SCORE, AS_FLOAT, bonus_nade_score);
+ addstat(STAT_HEALING_ORB, AS_FLOAT, stat_healing_orb);
+ addstat(STAT_HEALING_ORB_ALPHA, AS_FLOAT, stat_healing_orb_alpha);
+ }
+
+ return false;
+}
+
.float nade_time_primed;
.entity nade_spawnloc;
player.nade_timer = 0;
}
-MUTATOR_HOOKFUNCTION(nades_VehicleEnter)
+MUTATOR_HOOKFUNCTION(nades, VehicleEnter)
{
if(vh_player.nade)
toss_nade(vh_player, '0 0 100', max(vh_player.nade.wait, time + 0.05));
ENDCLASS(NadeOffhand)
NadeOffhand OFFHAND_NADE; STATIC_INIT(OFFHAND_NADE) { OFFHAND_NADE = NEW(NadeOffhand); }
-MUTATOR_HOOKFUNCTION(nades_CheckThrow)
+MUTATOR_HOOKFUNCTION(nades, ForbidThrowCurrentWeapon, CBC_ORDER_LAST)
{
if (self.offhand != OFFHAND_NADE || (self.weapons & WEPSET(HOOK)) || autocvar_g_nades_override_dropweapon) {
nades_CheckThrow();
return false;
}
-MUTATOR_HOOKFUNCTION(nades_PlayerPreThink)
+MUTATOR_HOOKFUNCTION(nades, PlayerPreThink)
{SELFPARAM();
if (!IS_PLAYER(self)) { return false; }
return false;
}
-MUTATOR_HOOKFUNCTION(nades_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(nades, PlayerSpawn)
{SELFPARAM();
if(autocvar_g_nades_spawn)
self.nade_refire = time + autocvar_g_spawnshieldtime;
return false;
}
-MUTATOR_HOOKFUNCTION(nades_PlayerDies)
+MUTATOR_HOOKFUNCTION(nades, PlayerDies, CBC_ORDER_LAST)
{
if(frag_target.nade)
if(!frag_target.frozen || !autocvar_g_freezetag_revive_nade)
return false;
}
-MUTATOR_HOOKFUNCTION(nades_PlayerDamage)
+MUTATOR_HOOKFUNCTION(nades, PlayerDamage_Calculate)
{
if(frag_target.frozen)
if(autocvar_g_freezetag_revive_nade)
return false;
}
-MUTATOR_HOOKFUNCTION(nades_MonsterDies)
+MUTATOR_HOOKFUNCTION(nades, MonsterDies)
{SELFPARAM();
if(IS_PLAYER(frag_attacker))
if(DIFF_TEAM(frag_attacker, self))
return false;
}
-MUTATOR_HOOKFUNCTION(nades_RemovePlayer)
+bool nades_RemovePlayer()
{SELFPARAM();
nades_Clear(self);
nades_RemoveBonus(self);
return false;
}
-MUTATOR_HOOKFUNCTION(nades_SpectateCopy)
+MUTATOR_HOOKFUNCTION(nades, MakePlayerObserver) { nades_RemovePlayer(); }
+MUTATOR_HOOKFUNCTION(nades, ClientDisconnect) { nades_RemovePlayer(); }
+MUTATOR_HOOKFUNCTION(nades, reset_map_global) { nades_RemovePlayer(); }
+
+MUTATOR_HOOKFUNCTION(nades, SpectateCopy)
{SELFPARAM();
self.nade_timer = other.nade_timer;
self.nade_type = other.nade_type;
return false;
}
-MUTATOR_HOOKFUNCTION(nades_GetCvars)
+MUTATOR_HOOKFUNCTION(nades, GetCvars)
{
GetCvars_handleFloat(get_cvars_s, get_cvars_f, cvar_cl_nade_type, "cl_nade_type");
GetCvars_handleString(get_cvars_s, get_cvars_f, cvar_cl_pokenade_type, "cl_pokenade_type");
return false;
}
-MUTATOR_HOOKFUNCTION(nades_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(nades, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":Nades");
return false;
}
-MUTATOR_HOOKFUNCTION(nades_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(nades, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Nades");
return false;
}
-
-void nades_Initialize()
-{
- addstat(STAT_NADE_TIMER, AS_FLOAT, nade_timer);
- addstat(STAT_NADE_BONUS, AS_FLOAT, bonus_nades);
- addstat(STAT_NADE_BONUS_TYPE, AS_INT, nade_type);
- addstat(STAT_NADE_BONUS_SCORE, AS_FLOAT, bonus_nade_score);
- addstat(STAT_HEALING_ORB, AS_FLOAT, stat_healing_orb);
- addstat(STAT_HEALING_ORB_ALPHA, AS_FLOAT, stat_healing_orb_alpha);
-}
-
-MUTATOR_DEFINITION(mutator_nades)
-{
- MUTATOR_HOOK(ForbidThrowCurrentWeapon, nades_CheckThrow, CBC_ORDER_LAST);
- MUTATOR_HOOK(VehicleEnter, nades_VehicleEnter, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPreThink, nades_PlayerPreThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, nades_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, nades_PlayerDies, CBC_ORDER_LAST);
- MUTATOR_HOOK(PlayerDamage_Calculate, nades_PlayerDamage, CBC_ORDER_ANY);
- MUTATOR_HOOK(MonsterDies, nades_MonsterDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(MakePlayerObserver, nades_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, nades_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(SpectateCopy, nades_SpectateCopy, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetCvars, nades_GetCvars, CBC_ORDER_ANY);
- MUTATOR_HOOK(reset_map_global, nades_RemovePlayer, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, nades_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, nades_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
- MUTATOR_ONADD
- {
- nades_Initialize();
- }
-
- return false;
-}
*/
+bool nt_IsNewToy(int w);
+
+REGISTER_MUTATOR(nt, cvar("g_new_toys") && !cvar("g_instagib") && !cvar("g_overkill"))
+{
+ MUTATOR_ONADD
+ {
+ if(time > 1) // game loads at time 1
+ error("This cannot be added at runtime\n");
+
+ // mark the guns as ok to use by e.g. impulse 99
+ for(int i = WEP_FIRST; i <= WEP_LAST; ++i)
+ if(nt_IsNewToy(i))
+ get_weaponinfo(i).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+ }
+
+ MUTATOR_ONROLLBACK_OR_REMOVE
+ {
+ for(int i = WEP_FIRST; i <= WEP_LAST; ++i)
+ if(nt_IsNewToy(i))
+ get_weaponinfo(i).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+ }
+
+ MUTATOR_ONREMOVE
+ {
+ LOG_INFO("This cannot be removed at runtime\n");
+ return -1;
+ }
+
+ return 0;
+}
+
.string new_toys;
float autocvar_g_new_toys_autoreplace;
const float NT_AUTOREPLACE_ALWAYS = 1;
const float NT_AUTOREPLACE_RANDOM = 2;
-MUTATOR_HOOKFUNCTION(nt_SetModname)
+MUTATOR_HOOKFUNCTION(nt, SetModname)
{
modname = "NewToys";
return 0;
}
-float nt_IsNewToy(float w)
+bool nt_IsNewToy(int w)
{
switch(w)
{
return s;
}
-MUTATOR_HOOKFUNCTION(nt_SetStartItems)
+MUTATOR_HOOKFUNCTION(nt, SetStartItems)
{
// rearrange start_weapon_default
// apply those bits that are set by start_weapon_defaultmask
return 0;
}
-MUTATOR_HOOKFUNCTION(nt_SetWeaponreplace)
+MUTATOR_HOOKFUNCTION(nt, SetWeaponreplace)
{SELFPARAM();
// otherwise, we do replace
if(self.new_toys)
return 0;
}
-MUTATOR_HOOKFUNCTION(nt_FilterItem)
+MUTATOR_HOOKFUNCTION(nt, FilterItem)
{SELFPARAM();
if(nt_IsNewToy(self.weapon) && autocvar_g_new_toys_use_pickupsound) {
self.item_pickupsound = string_null;
}
return 0;
}
-
-MUTATOR_DEFINITION(mutator_new_toys)
-{
- MUTATOR_HOOK(SetModname, nt_SetModname, CBC_ORDER_ANY);
- MUTATOR_HOOK(SetStartItems, nt_SetStartItems, CBC_ORDER_ANY);
- MUTATOR_HOOK(SetWeaponreplace, nt_SetWeaponreplace, CBC_ORDER_LAST);
- MUTATOR_HOOK(FilterItem, nt_FilterItem, CBC_ORDER_ANY);
-
- MUTATOR_ONADD
- {
- if(time > 1) // game loads at time 1
- error("This cannot be added at runtime\n");
-
- // mark the guns as ok to use by e.g. impulse 99
- float i;
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- if(nt_IsNewToy(i))
- get_weaponinfo(i).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
- }
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- float i;
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- if(nt_IsNewToy(i))
- get_weaponinfo(i).spawnflags |= WEP_FLAG_MUTATORBLOCKED;
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This cannot be removed at runtime\n");
- return -1;
- }
-
- return 0;
-}
.float nix_lastinfotime;
.float nix_nextincr;
-float NIX_CanChooseWeapon(float wpn)
+bool NIX_CanChooseWeapon(int wpn);
+
+REGISTER_MUTATOR(nix, cvar("g_nix") && !cvar("g_instagib") && !cvar("g_overkill"))
+{
+ MUTATOR_ONADD
+ {
+ g_nix_with_blaster = autocvar_g_nix_with_blaster;
+
+ nix_nextchange = 0;
+ nix_nextweapon = 0;
+
+ for (int i = WEP_FIRST; i <= WEP_LAST; ++i)
+ if (NIX_CanChooseWeapon(i)) {
+ Weapon w = get_weaponinfo(i);
+ w.wr_init(w);
+ }
+ }
+
+ MUTATOR_ONROLLBACK_OR_REMOVE
+ {
+ // nothing to roll back
+ }
+
+ MUTATOR_ONREMOVE
+ {
+ // as the PlayerSpawn hook will no longer run, NIX is turned off by this!
+ entity e;
+ FOR_EACH_PLAYER(e) if(e.deadflag == DEAD_NO)
+ {
+ e.ammo_cells = start_ammo_cells;
+ e.ammo_plasma = start_ammo_plasma;
+ e.ammo_shells = start_ammo_shells;
+ e.ammo_nails = start_ammo_nails;
+ e.ammo_rockets = start_ammo_rockets;
+ e.ammo_fuel = start_ammo_fuel;
+ e.weapons = start_weapons;
+ if(!client_hasweapon(e, e.weapon, true, false))
+ e.switchweapon = w_getbestweapon(self);
+ }
+ }
+
+ return 0;
+}
+
+bool NIX_CanChooseWeapon(int wpn)
{
- entity e;
- e = get_weaponinfo(wpn);
+ entity e = get_weaponinfo(wpn);
if(!e.weapon) // skip dummies
return false;
if(g_weaponarena)
}
else
{
- if(wpn == WEP_BLASTER.m_id && g_nix_with_blaster) // WEAPONTODO: rename to g_nix_with_blaster
+ if(wpn == WEP_BLASTER.m_id && g_nix_with_blaster)
return false;
if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
return false;
W_SwitchWeapon(nix_weapon);
}
-void NIX_precache()
-{
- float i;
- for (i = WEP_FIRST; i <= WEP_LAST; ++i)
- if (NIX_CanChooseWeapon(i)) {
- Weapon w = get_weaponinfo(i);
- w.wr_init(w);
- }
-}
-
-MUTATOR_HOOKFUNCTION(nix_ForbidThrowCurrentWeapon)
+MUTATOR_HOOKFUNCTION(nix, ForbidThrowCurrentWeapon)
{
return 1; // no throwing in NIX
}
-MUTATOR_HOOKFUNCTION(nix_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(nix, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":NIX");
return 0;
}
-MUTATOR_HOOKFUNCTION(nix_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(nix, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", NIX");
return 0;
}
-MUTATOR_HOOKFUNCTION(nix_FilterItem)
+MUTATOR_HOOKFUNCTION(nix, FilterItem)
{SELFPARAM();
switch (self.items)
{
return 1; // delete all other items
}
-MUTATOR_HOOKFUNCTION(nix_OnEntityPreSpawn)
+MUTATOR_HOOKFUNCTION(nix, OnEntityPreSpawn)
{SELFPARAM();
if(self.classname == "target_items") // items triggers cannot work in nix (as they change weapons/ammo)
return 1;
return 0;
}
-MUTATOR_HOOKFUNCTION(nix_PlayerPreThink)
+MUTATOR_HOOKFUNCTION(nix, PlayerPreThink)
{SELFPARAM();
if(!intermission_running)
if(self.deadflag == DEAD_NO)
return 0;
}
-MUTATOR_HOOKFUNCTION(nix_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(nix, PlayerSpawn)
{SELFPARAM();
self.nix_lastchange_id = -1;
NIX_GiveCurrentWeapon(); // overrides the weapons you got when spawning
return 0;
}
-MUTATOR_HOOKFUNCTION(nix_SetModname)
+MUTATOR_HOOKFUNCTION(nix, SetModname, CBC_ORDER_LAST)
{
modname = "NIX";
return 0;
}
-
-MUTATOR_DEFINITION(mutator_nix)
-{SELFPARAM();
- entity e;
-
- MUTATOR_HOOK(ForbidThrowCurrentWeapon, nix_ForbidThrowCurrentWeapon, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, nix_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, nix_BuildMutatorsPrettyString, CBC_ORDER_ANY);
- MUTATOR_HOOK(FilterItem, nix_FilterItem, CBC_ORDER_ANY);
- MUTATOR_HOOK(OnEntityPreSpawn, nix_OnEntityPreSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPreThink, nix_PlayerPreThink, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, nix_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(SetModname, nix_SetModname, CBC_ORDER_LAST);
-
- MUTATOR_ONADD
- {
- g_nix_with_blaster = autocvar_g_nix_with_blaster;
-
- nix_nextchange = 0;
- nix_nextweapon = 0;
-
- NIX_precache();
- }
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // nothing to roll back
- }
-
- MUTATOR_ONREMOVE
- {
- // as the PlayerSpawn hook will no longer run, NIX is turned off by this!
-
- FOR_EACH_PLAYER(e) if(e.deadflag == DEAD_NO)
- {
- e.ammo_cells = start_ammo_cells;
- e.ammo_plasma = start_ammo_plasma;
- e.ammo_shells = start_ammo_shells;
- e.ammo_nails = start_ammo_nails;
- e.ammo_rockets = start_ammo_rockets;
- e.ammo_fuel = start_ammo_fuel;
- e.weapons = start_weapons;
- if(!client_hasweapon(e, e.weapon, true, false))
- e.switchweapon = w_getbestweapon(self);
- }
- }
-
- return 0;
-}
#include "mutator.qh"
+void ok_Initialize();
+
+REGISTER_MUTATOR(ok, cvar("g_overkill") && !cvar("g_instagib") && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
+{
+ MUTATOR_ONADD
+ {
+ ok_Initialize();
+ }
+
+ MUTATOR_ONREMOVE
+ {
+ WEP_RPC.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+ WEP_HMG.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+ }
+
+ return false;
+}
+
void W_Blaster_Attack(entity, float, float, float, float, float, float, float, float, float, float);
spawnfunc(weapon_hmg);
spawnfunc(weapon_rpc);
return (ent.ammo_charge[wep] >= cvar(sprintf("g_overkill_ammo_decharge_%s", wepent.netname)));
}
-MUTATOR_HOOKFUNCTION(ok_PlayerDamage_Calculate)
+MUTATOR_HOOKFUNCTION(ok, PlayerDamage_Calculate, CBC_ORDER_LAST)
{
if(IS_PLAYER(frag_attacker) && IS_PLAYER(frag_target))
if(DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER))
return false;
}
-MUTATOR_HOOKFUNCTION(ok_PlayerDamage_SplitHealthArmor)
+MUTATOR_HOOKFUNCTION(ok, PlayerDamage_SplitHealthArmor)
{SELFPARAM();
if(damage_take)
self.ok_pauseregen_finished = max(self.ok_pauseregen_finished, time + 2);
return false;
}
-MUTATOR_HOOKFUNCTION(ok_PlayerDies)
+MUTATOR_HOOKFUNCTION(ok, PlayerDies)
{SELFPARAM();
entity targ = ((frag_attacker) ? frag_attacker : frag_target);
return false;
}
+MUTATOR_HOOKFUNCTION(ok, MonsterDropItem) { ok_PlayerDies(); }
-MUTATOR_HOOKFUNCTION(ok_PlayerRegen)
+MUTATOR_HOOKFUNCTION(ok, PlayerRegen)
{SELFPARAM();
// overkill's values are different, so use custom regen
if(!self.frozen)
return true; // return true anyway, as frozen uses no regen
}
-MUTATOR_HOOKFUNCTION(ok_ForbidThrowCurrentWeapon)
+MUTATOR_HOOKFUNCTION(ok, ForbidThrowCurrentWeapon)
{
return true;
}
-MUTATOR_HOOKFUNCTION(ok_PlayerPreThink)
+MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
{SELFPARAM();
if(intermission_running || gameover)
return false;
return false;
}
-MUTATOR_HOOKFUNCTION(ok_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(ok, PlayerSpawn)
{SELFPARAM();
if(autocvar_g_overkill_ammo_charge)
{
void _spawnfunc_weapon_hmg() { SELFPARAM(); spawnfunc_weapon_hmg(this); }
void _spawnfunc_weapon_rpc() { SELFPARAM(); spawnfunc_weapon_rpc(this); }
-MUTATOR_HOOKFUNCTION(ok_OnEntityPreSpawn)
+MUTATOR_HOOKFUNCTION(ok, OnEntityPreSpawn)
{SELFPARAM();
if(autocvar_g_powerups)
if(autocvar_g_overkill_powerups_replace)
return false;
}
-MUTATOR_HOOKFUNCTION(ok_ItemRemove)
+MUTATOR_HOOKFUNCTION(ok, FilterItem)
{SELFPARAM();
if(self.ok_item)
return false;
return true;
}
-MUTATOR_HOOKFUNCTION(ok_SpectateCopy)
+MUTATOR_HOOKFUNCTION(ok, SpectateCopy)
{SELFPARAM();
self.ammo_charge[self.weapon] = other.ammo_charge[other.weapon];
self.ok_use_ammocharge = other.ok_use_ammocharge;
return false;
}
-MUTATOR_HOOKFUNCTION(ok_StartItems)
+MUTATOR_HOOKFUNCTION(ok, SetStartItems)
{
WepSet ok_start_items = (WEPSET(MACHINEGUN) | WEPSET(VORTEX) | WEPSET(SHOTGUN));
return false;
}
-MUTATOR_HOOKFUNCTION(ok_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(ok, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":OK");
return false;
}
-MUTATOR_HOOKFUNCTION(ok_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(ok, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Overkill");
return false;
}
-MUTATOR_HOOKFUNCTION(ok_SetModname)
+MUTATOR_HOOKFUNCTION(ok, SetModname)
{
modname = "Overkill";
return true;
WEP_MACHINEGUN.mdl = "ok_mg";
WEP_VORTEX.mdl = "ok_sniper";
}
-
-MUTATOR_DEFINITION(mutator_overkill)
-{
- MUTATOR_HOOK(ForbidThrowCurrentWeapon, ok_ForbidThrowCurrentWeapon, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerPreThink, ok_PlayerPreThink, CBC_ORDER_LAST);
- MUTATOR_HOOK(PlayerSpawn, ok_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDamage_Calculate, ok_PlayerDamage_Calculate, CBC_ORDER_LAST);
- MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, ok_PlayerDamage_SplitHealthArmor, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, ok_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerRegen, ok_PlayerRegen, CBC_ORDER_ANY);
- MUTATOR_HOOK(OnEntityPreSpawn, ok_OnEntityPreSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(FilterItem, ok_ItemRemove, CBC_ORDER_ANY);
- MUTATOR_HOOK(MonsterDropItem, ok_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(SpectateCopy, ok_SpectateCopy, CBC_ORDER_ANY);
- MUTATOR_HOOK(SetStartItems, ok_StartItems, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, ok_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, ok_BuildMutatorsPrettyString, CBC_ORDER_ANY);
- MUTATOR_HOOK(SetModname, ok_SetModname, CBC_ORDER_ANY);
-
- MUTATOR_ONADD
- {
- ok_Initialize();
- }
-
- MUTATOR_ONREMOVE
- {
- WEP_RPC.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
- WEP_HMG.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
- }
-
- return false;
-}
#include "mutator.qh"
+REGISTER_MUTATOR(physical_items, cvar("g_physical_items"))
+{
+ // check if we have a physics engine
+ MUTATOR_ONADD
+ {
+ if (!(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")))
+ {
+ LOG_TRACE("Warning: Physical items are enabled but no physics engine can be used. Reverting to old items.\n");
+ return -1;
+ }
+ }
+
+ MUTATOR_ONROLLBACK_OR_REMOVE
+ {
+ // nothing to roll back
+ }
+
+ MUTATOR_ONREMOVE
+ {
+ LOG_INFO("This cannot be removed at runtime\n");
+ return -1;
+ }
+
+ return 0;
+}
+
.vector spawn_origin, spawn_angles;
void physical_item_think()
}
}
-MUTATOR_HOOKFUNCTION(item_spawning)
+MUTATOR_HOOKFUNCTION(physical_items, Item_Spawn)
{SELFPARAM();
if(self.owner == world && autocvar_g_physical_items <= 1)
return false;
return false;
}
-
-MUTATOR_DEFINITION(mutator_physical_items)
-{
- MUTATOR_HOOK(Item_Spawn, item_spawning, CBC_ORDER_ANY);
-
- // check if we have a physics engine
- MUTATOR_ONADD
- {
- if (!(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")))
- {
- LOG_TRACE("Warning: Physical items are enabled but no physics engine can be used. Reverting to old items.\n");
- return -1;
- }
- }
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // nothing to roll back
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This cannot be removed at runtime\n");
- return -1;
- }
-
- return 0;
-}
#include "mutator.qh"
-MUTATOR_HOOKFUNCTION(pinata_PlayerDies)
+REGISTER_MUTATOR(pinata, cvar("g_pinata") && !cvar("g_instagib") && !cvar("g_overkill"));
+
+MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
{SELFPARAM();
- float j;
- for(j = WEP_FIRST; j <= WEP_LAST; ++j)
+ for(int j = WEP_FIRST; j <= WEP_LAST; ++j)
if(self.weapons & WepSet_FromWeapon(j))
if(self.switchweapon != j)
if(W_IsWeaponThrowable(j))
return true;
}
-MUTATOR_HOOKFUNCTION(pinata_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(pinata, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":Pinata");
return false;
}
-MUTATOR_HOOKFUNCTION(pinata_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(pinata, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Piñata");
return false;
}
-MUTATOR_DEFINITION(mutator_pinata)
-{
- MUTATOR_HOOK(PlayerDies, pinata_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, pinata_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, pinata_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
- return false;
-}
// Mutator by Mario
// Inspired by Player 2
+REGISTER_MUTATOR(random_gravity, cvar("g_random_gravity"))
+{
+ MUTATOR_ONADD
+ {
+ cvar_settemp("sv_gravity", cvar_string("sv_gravity")); // settemp current gravity so it's restored on match end
+ }
+
+ return false;
+}
+
float gravity_delay;
-MUTATOR_HOOKFUNCTION(gravity_StartFrame)
+MUTATOR_HOOKFUNCTION(random_gravity, SV_StartFrame)
{
if(gameover || !cvar("g_random_gravity")) return false;
if(time < gravity_delay) return false;
return false;
}
-MUTATOR_HOOKFUNCTION(gravity_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(random_gravity, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":RandomGravity");
return 0;
}
-MUTATOR_HOOKFUNCTION(gravity_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(random_gravity, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Random gravity");
return 0;
}
-
-MUTATOR_DEFINITION(mutator_random_gravity)
-{
- MUTATOR_HOOK(SV_StartFrame, gravity_StartFrame, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, gravity_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, gravity_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
- MUTATOR_ONADD
- {
- cvar_settemp("sv_gravity", cvar_string("sv_gravity")); // settemp current gravity so it's restored on match end
- }
-
- return false;
-}
#include "mutator.qh"
-MUTATOR_HOOKFUNCTION(rocketflying_EditProjectile)
+REGISTER_MUTATOR(rocketflying, cvar("g_rocket_flying"));
+
+MUTATOR_HOOKFUNCTION(rocketflying, EditProjectile)
{
if(other.classname == "rocket" || other.classname == "mine")
{
return 0;
}
-MUTATOR_HOOKFUNCTION(rocketflying_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(rocketflying, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":RocketFlying");
return 0;
}
-MUTATOR_HOOKFUNCTION(rocketflying_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(rocketflying, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Rocket Flying");
return 0;
}
-
-MUTATOR_DEFINITION(mutator_rocketflying)
-{
- MUTATOR_HOOK(EditProjectile, rocketflying_EditProjectile, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, rocketflying_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, rocketflying_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
- return 0;
-}
#include "mutator.qh"
+REGISTER_MUTATOR(spawn_near_teammate, cvar("g_spawn_near_teammate") && teamplay);
+
.entity msnt_lookat;
.float msnt_timer;
.float cvar_cl_spawn_near_teammate;
-MUTATOR_HOOKFUNCTION(msnt_Spawn_Score)
+MUTATOR_HOOKFUNCTION(spawn_near_teammate, Spawn_Score)
{SELFPARAM();
if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && self.cvar_cl_spawn_near_teammate))
return 0;
return 0;
}
-MUTATOR_HOOKFUNCTION(msnt_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn)
{SELFPARAM();
// Note: when entering this, fixangle is already set.
if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && self.cvar_cl_spawn_near_teammate))
return 0;
}
-MUTATOR_HOOKFUNCTION(msnt_PlayerDies)
+MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerDies)
{SELFPARAM();
self.msnt_deathloc = self.origin;
return 0;
}
-MUTATOR_HOOKFUNCTION(msnt_GetCvars)
+MUTATOR_HOOKFUNCTION(spawn_near_teammate, GetCvars)
{
GetCvars_handleFloat(get_cvars_s, get_cvars_f, cvar_cl_spawn_near_teammate, "cl_spawn_near_teammate");
return false;
}
-
-MUTATOR_DEFINITION(mutator_spawn_near_teammate)
-{
- MUTATOR_HOOK(Spawn_Score, msnt_Spawn_Score, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerSpawn, msnt_PlayerSpawn, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, msnt_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(GetCvars, msnt_GetCvars, CBC_ORDER_ANY);
-
- return 0;
-}
-
#include "mutator.qh"
+REGISTER_MUTATOR(superspec, cvar("g_superspectate"));
+
#define _SSMAGIX "SUPERSPEC_OPTIONSFILE_V1"
#define _ISLOCAL ((edict_num(1) == self) ? true : false)
return false;
}
-MUTATOR_HOOKFUNCTION(superspec_ItemTouch)
+MUTATOR_HOOKFUNCTION(superspec, ItemTouch)
{SELFPARAM();
entity _item = self;
return MUT_ITEMTOUCH_CONTINUE;
}
-MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand)
+MUTATOR_HOOKFUNCTION(superspec, SV_ParseClientCommand)
{SELFPARAM();
#define OPTIONINFO(flag,var,test,text,long,short) \
var = strcat(var, ((flag & test) ? "^2[ON] ^7" : "^1[OFF] ^7")); \
#undef OPTIONINFO
}
-MUTATOR_HOOKFUNCTION(superspec_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(superspec, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":SS");
return 0;
}
-MUTATOR_HOOKFUNCTION(superspec_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(superspec, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Super Spectators");
return 0;
remove(self);
}
-MUTATOR_HOOKFUNCTION(superspec_ClientConnect)
+MUTATOR_HOOKFUNCTION(superspec, ClientConnect)
{SELFPARAM();
if(!IS_REAL_CLIENT(self))
return false;
return false;
}
-MUTATOR_HOOKFUNCTION(superspec_PlayerDies)
+MUTATOR_HOOKFUNCTION(superspec, PlayerDies)
{SELFPARAM();
entity e;
FOR_EACH_SPEC(e)
return false;
}
-MUTATOR_HOOKFUNCTION(superspec_ClientDisconnect)
+MUTATOR_HOOKFUNCTION(superspec, ClientDisconnect)
{
superspec_save_client_conf();
return false;
}
-
-MUTATOR_DEFINITION(mutator_superspec)
-{
-
- MUTATOR_HOOK(BuildMutatorsString, superspec_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, superspec_BuildMutatorsPrettyString, CBC_ORDER_ANY);
- MUTATOR_HOOK(SV_ParseClientCommand, superspec_SV_ParseClientCommand, CBC_ORDER_ANY);
- MUTATOR_HOOK(ItemTouch, superspec_ItemTouch, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientConnect, superspec_ClientConnect, CBC_ORDER_ANY);
- MUTATOR_HOOK(ClientDisconnect, superspec_ClientDisconnect, CBC_ORDER_ANY);
- MUTATOR_HOOK(PlayerDies, superspec_PlayerDies, CBC_ORDER_ANY);
-
- return 0;
-}
-
#include "mutator.qh"
+REGISTER_MUTATOR(touchexplode, cvar("g_touchexplode"));
+
.float touchexplode_time;
void PlayerTouchExplode(entity p1, entity p2)
{SELFPARAM();
- vector org;
- org = (p1.origin + p2.origin) * 0.5;
+ vector org = (p1.origin + p2.origin) * 0.5;
org.z += (p1.mins.z + p2.mins.z) * 0.5;
sound(self, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM);
Send_Effect(EFFECT_EXPLOSION_SMALL, org, '0 0 0', 1);
- entity e;
- e = spawn();
+ entity e = spawn();
setorigin(e, org);
RadiusDamage(e, world, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, world, world, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE.m_id, world);
remove(e);
}
-MUTATOR_HOOKFUNCTION(touchexplode_PlayerThink)
+MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink)
{SELFPARAM();
if(time > self.touchexplode_time)
if(!gameover)
return false;
}
-
-MUTATOR_DEFINITION(mutator_touchexplode)
-{
- MUTATOR_HOOK(PlayerPreThink, touchexplode_PlayerThink, CBC_ORDER_ANY);
-
- return false;
-}
-
#include "mutator.qh"
-MUTATOR_HOOKFUNCTION(vampire_PlayerDamage)
+REGISTER_MUTATOR(vampire, cvar("g_vampire") && !cvar("g_instagib"));
+
+MUTATOR_HOOKFUNCTION(vampire, PlayerDamage_SplitHealthArmor)
{
if(time >= frag_target.spawnshieldtime)
if(frag_target != frag_attacker)
return false;
}
-MUTATOR_HOOKFUNCTION(vampire_BuildMutatorsString)
+MUTATOR_HOOKFUNCTION(vampire, BuildMutatorsString)
{
ret_string = strcat(ret_string, ":Vampire");
return 0;
}
-MUTATOR_HOOKFUNCTION(vampire_BuildMutatorsPrettyString)
+MUTATOR_HOOKFUNCTION(vampire, BuildMutatorsPrettyString)
{
ret_string = strcat(ret_string, ", Vampire");
return 0;
}
-
-MUTATOR_DEFINITION(mutator_vampire)
-{
- MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, vampire_PlayerDamage, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsString, vampire_BuildMutatorsString, CBC_ORDER_ANY);
- MUTATOR_HOOK(BuildMutatorsPrettyString, vampire_BuildMutatorsPrettyString, CBC_ORDER_ANY);
-
- return 0;
-}
+++ /dev/null
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "mutators_include.qh"
- #include "../../common/mapinfo.qh"
-#endif
-
-void mutators_add()
-{
- #define CHECK_MUTATOR_ADD(mut_cvar,mut_name,dependence) \
- { if(cvar(mut_cvar) && dependence) { MUTATOR_ADD(mut_name); } }
-
- CHECK_MUTATOR_ADD("g_dodging", mutator_dodging, 1);
- CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, teamplay);
- CHECK_MUTATOR_ADD("g_physical_items", mutator_physical_items, 1);
- CHECK_MUTATOR_ADD("g_touchexplode", mutator_touchexplode, 1);
- CHECK_MUTATOR_ADD("g_invincible_projectiles", mutator_invincibleprojectiles, 1);
- CHECK_MUTATOR_ADD("g_new_toys", mutator_new_toys, !cvar("g_instagib") && !cvar("g_overkill"));
- CHECK_MUTATOR_ADD("g_nix", mutator_nix, !cvar("g_instagib") && !cvar("g_overkill"));
- CHECK_MUTATOR_ADD("g_rocket_flying", mutator_rocketflying, 1);
- CHECK_MUTATOR_ADD("g_vampire", mutator_vampire, !cvar("g_instagib"));
- CHECK_MUTATOR_ADD("g_superspectate", mutator_superspec, 1);
- CHECK_MUTATOR_ADD("g_pinata", mutator_pinata, !cvar("g_instagib") && !cvar("g_overkill"));
- CHECK_MUTATOR_ADD("g_midair", mutator_midair, 1);
- CHECK_MUTATOR_ADD("g_bloodloss", mutator_bloodloss, 1);
- CHECK_MUTATOR_ADD("g_random_gravity", mutator_random_gravity, 1);
- CHECK_MUTATOR_ADD("g_multijump", mutator_multijump, 1);
- CHECK_MUTATOR_ADD("g_melee_only", mutator_melee_only, !cvar("g_instagib") && !g_nexball);
- CHECK_MUTATOR_ADD("g_nades", mutator_nades, 1);
- CHECK_MUTATOR_ADD("g_sandbox", sandbox, 1);
- CHECK_MUTATOR_ADD("g_campcheck", mutator_campcheck, 1);
- CHECK_MUTATOR_ADD("g_overkill", mutator_overkill, !cvar("g_instagib") && !g_nexball && cvar_string("g_mod_balance") == "Overkill");
- CHECK_MUTATOR_ADD("g_buffs", mutator_buffs, 1);
-
- #undef CHECK_MUTATOR_ADD
-}
+++ /dev/null
-#ifndef MUTATORS_H
-#define MUTATORS_H
-
-MUTATOR_DECLARATION(mutator_dodging);
-MUTATOR_DECLARATION(mutator_invincibleprojectiles);
-MUTATOR_DECLARATION(mutator_new_toys);
-MUTATOR_DECLARATION(mutator_nix);
-MUTATOR_DECLARATION(mutator_rocketflying);
-MUTATOR_DECLARATION(mutator_spawn_near_teammate);
-MUTATOR_DECLARATION(mutator_physical_items);
-MUTATOR_DECLARATION(mutator_vampire);
-MUTATOR_DECLARATION(mutator_superspec);
-MUTATOR_DECLARATION(mutator_touchexplode);
-MUTATOR_DECLARATION(mutator_pinata);
-MUTATOR_DECLARATION(mutator_midair);
-MUTATOR_DECLARATION(mutator_bloodloss);
-MUTATOR_DECLARATION(mutator_random_gravity);
-MUTATOR_DECLARATION(mutator_multijump);
-MUTATOR_DECLARATION(mutator_melee_only);
-MUTATOR_DECLARATION(mutator_nades);
-MUTATOR_DECLARATION(mutator_campcheck);
-MUTATOR_DECLARATION(mutator_buffs);
-
-MUTATOR_DECLARATION(sandbox);
-MUTATOR_DECLARATION(mutator_overkill);
-
-#endif
#define MUTATORS_INCLUDE_H
#include "../../common/mutators/base.qh"
-#include "mutators.qh"
#include "gamemode_assault.qh"
#include "gamemode_ca.qh"
-
#include "mutator.qh"
+float autosave_time;
+void sandbox_Database_Load();
+
+REGISTER_MUTATOR(sandbox, cvar("g_sandbox"))
+{
+ MUTATOR_ONADD
+ {
+ autosave_time = time + autocvar_g_sandbox_storage_autosave; // don't save the first server frame
+ if(autocvar_g_sandbox_storage_autoload)
+ sandbox_Database_Load();
+ }
+
+ MUTATOR_ONROLLBACK_OR_REMOVE
+ {
+ // nothing to roll back
+ }
+
+ MUTATOR_ONREMOVE
+ {
+ // nothing to remove
+ }
+
+ return false;
+}
+
const float MAX_STORAGE_ATTACHMENTS = 16;
float object_count;
.float object_flood;
fclose(file_get);
}
-MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand)
+MUTATOR_HOOKFUNCTION(sandbox, SV_ParseClientCommand)
{SELFPARAM();
if(MUTATOR_RETURNVALUE) // command was already handled?
return false;
return false;
}
-float autosave_time;
-MUTATOR_HOOKFUNCTION(sandbox_StartFrame)
+MUTATOR_HOOKFUNCTION(sandbox, SV_StartFrame)
{
if(!autocvar_g_sandbox_storage_autosave)
return false;
return true;
}
-MUTATOR_HOOKFUNCTION(sandbox_SetModname)
+MUTATOR_HOOKFUNCTION(sandbox, SetModname)
{
modname = "Sandbox";
return true;
}
-
-MUTATOR_DEFINITION(sandbox)
-{
- MUTATOR_HOOK(SV_ParseClientCommand, sandbox_PlayerCommand, CBC_ORDER_ANY);
- MUTATOR_HOOK(SV_StartFrame, sandbox_StartFrame, CBC_ORDER_ANY);
- MUTATOR_HOOK(SetModname, sandbox_SetModname, CBC_ORDER_ANY);
-
- MUTATOR_ONADD
- {
- autosave_time = time + autocvar_g_sandbox_storage_autosave; // don't save the first server frame
- if(autocvar_g_sandbox_storage_autoload)
- sandbox_Database_Load();
- }
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // nothing to roll back
- }
-
- MUTATOR_ONREMOVE
- {
- // nothing to remove
- }
-
- return false;
-}
-
#include "command/all.qc"
#include "mutators/mutators_include.qc"
-#include "mutators/mutators.qc"
#include "pathlib/_all.inc"