.entity sprite;
#define AS_ROUND_DELAY 5
-IntrusiveList g_assault_destructibles;
-IntrusiveList g_assault_objectivedecreasers;
-IntrusiveList g_assault_objectives;
-STATIC_INIT(g_assault)
-{
- g_assault_destructibles = IL_NEW();
- g_assault_objectivedecreasers = IL_NEW();
- g_assault_objectives = IL_NEW();
-}
-
// random functions
void assault_objective_use(entity this, entity actor, entity trigger)
{
const int ST_ASSAULT_OBJECTIVES = 1;
+IntrusiveList g_assault_destructibles;
+IntrusiveList g_assault_objectivedecreasers;
+IntrusiveList g_assault_objectives;
+
REGISTER_MUTATOR(as, false)
{
MUTATOR_STATIC();
MUTATOR_ONADD
{
+ g_assault_destructibles = IL_NEW();
+ g_assault_objectivedecreasers = IL_NEW();
+ g_assault_objectives = IL_NEW();
GameRules_teams(true);
int teams = BITS(2); // always red vs blue
GameRules_scoring(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, {
#include "ctf.qh"
+CLASS(Flag, Pickup)
+ ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned
+ ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4);
+ENDCLASS(Flag)
+Flag CTF_FLAG;
void ctf_Initialize();
REGISTER_MUTATOR(ctf, false)
MUTATOR_STATIC();
MUTATOR_ONADD
{
+ CTF_FLAG = NEW(Flag);
GameRules_teams(true);
GameRules_limit_score(autocvar_capturelimit_override);
GameRules_limit_lead(autocvar_captureleadlimit_override);
// score rule declarations
const int ST_CTF_CAPS = 1;
-CLASS(Flag, Pickup)
- ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned
- ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4);
-ENDCLASS(Flag)
-Flag CTF_FLAG;
-STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); }
void ctf_FlagTouch(entity this, entity toucher) { ITEM_HANDLE(Pickup, CTF_FLAG, this, toucher); }
// flag constants // for most of these, there is just one question to be asked: WHYYYYY?
int autocvar_g_domination_roundbased_point_limit;
int autocvar_g_domination_point_leadlimit;
+IntrusiveList g_dompoints;
void dom_Initialize();
REGISTER_MUTATOR(dom, false)
MUTATOR_STATIC();
MUTATOR_ONADD
{
+ g_dompoints = IL_NEW();
+
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;
float domination_teams;
void AnimateDomPoint(entity this);
-
-IntrusiveList g_dompoints;
-STATIC_INIT(g_dompoints) { g_dompoints = IL_NEW(); }
#include <server/teamplay.qh>
-IntrusiveList g_invasion_roundends;
-IntrusiveList g_invasion_waves;
-IntrusiveList g_invasion_spawns;
-STATIC_INIT(g_invasion)
-{
- g_invasion_roundends = IL_NEW();
- g_invasion_waves = IL_NEW();
- g_invasion_spawns = IL_NEW();
-}
-
float autocvar_g_invasion_round_timelimit;
float autocvar_g_invasion_spawnpoint_spawn_delay;
float autocvar_g_invasion_warmup;
int autocvar_g_invasion_type;
bool autocvar_g_invasion_team_spawns;
bool g_invasion;
+IntrusiveList g_invasion_roundends;
+IntrusiveList g_invasion_waves;
+IntrusiveList g_invasion_spawns;
void invasion_Initialize();
REGISTER_MUTATOR(inv, false)
MUTATOR_STATIC();
MUTATOR_ONADD
{
+ g_invasion_roundends = IL_NEW();
+ g_invasion_waves = IL_NEW();
+ g_invasion_spawns = IL_NEW();
if (autocvar_g_invasion_teams >= 2) {
GameRules_teams(true);
GameRules_spawning_teams(autocvar_g_invasion_team_spawns);
REGISTER_NET_LINKED(ENT_CLIENT_CONTROLPOINT_ICON)
#endif
-#ifdef SVQC
-IntrusiveList g_onsshields;
-STATIC_INIT(g_onsshields) { g_onsshields = IL_NEW(); }
-#endif
-
#ifdef CSQC
IntrusiveList g_onsgenerators;
STATIC_INIT(g_onsgenerators) { g_onsgenerators = IL_NEW(); }
#pragma once
float autocvar_g_onslaught_point_limit;
+IntrusiveList g_onsshields;
void ons_Initialize();
REGISTER_MUTATOR(ons, false)
MUTATOR_STATIC();
MUTATOR_ONADD
{
+ g_onsshields = IL_NEW();
GameRules_teams(true);
GameRules_limit_score(autocvar_g_onslaught_point_limit);
int autocvar_g_instagib_extralives;
float autocvar_g_instagib_speed_highspeed;
-IntrusiveList g_instagib_items;
-STATIC_INIT(instagib)
-{
- g_instagib_items = IL_NEW();
- IL_PUSH(g_instagib_items, ITEM_VaporizerCells);
- IL_PUSH(g_instagib_items, ITEM_ExtraLife);
- IL_PUSH(g_instagib_items, ITEM_Invisibility);
- IL_PUSH(g_instagib_items, ITEM_Speed);
-}
-
void instagib_invisibility(entity this)
{
this.strength_finished = autocvar_g_instagib_invisibility_time;
void instagib_invisibility(entity this);
void instagib_extralife(entity this);
void instagib_speed(entity this);
+IntrusiveList g_instagib_items;
REGISTER_MUTATOR(mutator_instagib, autocvar_g_instagib && !g_nexball)
{
MUTATOR_ONADD
{
+ g_instagib_items = IL_NEW();
+ IL_PUSH(g_instagib_items, ITEM_VaporizerCells);
+ IL_PUSH(g_instagib_items, ITEM_ExtraLife);
+ IL_PUSH(g_instagib_items, ITEM_Invisibility);
+ IL_PUSH(g_instagib_items, ITEM_Speed);
+
ITEM_VaporizerCells.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
ITEM_Invisibility.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
ITEM_Speed.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
#include <common/monsters/sv_spawn.qh>
#include <common/monsters/sv_monsters.qh>
-REGISTER_MUTATOR(nades, autocvar_g_nades);
-
.float nade_time_primed;
.float nade_lifetime;
}
ENDCLASS(NadeOffhand)
NadeOffhand OFFHAND_NADE;
-STATIC_INIT(OFFHAND_NADE) { OFFHAND_NADE = NEW(NadeOffhand); }
+REGISTER_MUTATOR(nades, autocvar_g_nades)
+{
+ MUTATOR_ONADD
+ {
+ OFFHAND_NADE = NEW(NadeOffhand);
+ }
+ return 0;
+}
MUTATOR_HOOKFUNCTION(nades, ForbidThrowCurrentWeapon, CBC_ORDER_LAST)
{
.Weapon ok_lastwep[MAX_WEAPONSLOTS];
-IntrusiveList g_overkill_items;
-STATIC_INIT(overkill)
-{
- g_overkill_items = IL_NEW();
- IL_PUSH(g_overkill_items, ITEM_HealthMega);
- IL_PUSH(g_overkill_items, ITEM_ArmorSmall);
- IL_PUSH(g_overkill_items, ITEM_ArmorMedium);
- IL_PUSH(g_overkill_items, ITEM_ArmorBig);
- IL_PUSH(g_overkill_items, ITEM_ArmorMega);
-}
-
/// \brief Returns a random classname of the overkill item.
/// \param[in] prefix Prefix of the cvars that hold probabilities.
/// \return Random classname of the overkill item.
bool autocvar_g_overkill_filter_armormega;
.float ok_item;
+IntrusiveList g_overkill_items;
REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !MUTATOR_IS_ENABLED(mutator_instagib) && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
{
{
ITEM_ArmorMega.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
}
+ g_overkill_items = IL_NEW();
+ IL_PUSH(g_overkill_items, ITEM_HealthMega);
+ IL_PUSH(g_overkill_items, ITEM_ArmorSmall);
+ IL_PUSH(g_overkill_items, ITEM_ArmorMedium);
+ IL_PUSH(g_overkill_items, ITEM_ArmorBig);
+ IL_PUSH(g_overkill_items, ITEM_ArmorMega);
}
MUTATOR_ONREMOVE
float autocvar_g_sandbox_object_material_velocity_min;
float autocvar_g_sandbox_object_material_velocity_factor;
+IntrusiveList g_sandbox_objects;
float autosave_time;
void sandbox_Database_Load();
{
MUTATOR_ONADD
{
+ g_sandbox_objects = IL_NEW();
autosave_time = time + autocvar_g_sandbox_storage_autosave; // don't save the first server frame
if(autocvar_g_sandbox_storage_autoload)
sandbox_Database_Load();
#pragma once
-
-IntrusiveList g_sandbox_objects;
-STATIC_INIT(g_sandbox_objects) { g_sandbox_objects = IL_NEW(); }