bool mutator_log = false;
.bool m_added;
+#define MUTATOR_IS_ENABLED(this) MUTATOR_##this.mutatorcheck()
+
#ifdef GAMEQC
/** server mutators activate corresponding client mutators for all clients */
REGISTER_NET_LINKED(Mutator)
BUFF_ONADD(BUFF_INVISIBLE)
{
- if(time < player.strength_finished && autocvar_g_instagib)
+ if(time < player.strength_finished && MUTATOR_IS_ENABLED(mutator_instagib))
player.buff_invisible_prev_alpha = default_player_alpha; // we don't want to save the powerup's alpha, as player may lose the powerup while holding the buff
else
player.buff_invisible_prev_alpha = player.alpha;
BUFF_ONREM(BUFF_INVISIBLE)
{
- if(time < player.strength_finished && autocvar_g_instagib)
+ if(time < player.strength_finished && MUTATOR_IS_ENABLED(mutator_instagib))
player.alpha = autocvar_g_instagib_invis_alpha;
else
player.alpha = player.buff_invisible_prev_alpha;
REGISTER_MUTATOR(damagetext, true);
-#define SV_DAMAGETEXT_DISABLED() (autocvar_sv_damagetext <= 0 || autocvar_g_instagib)
+#define SV_DAMAGETEXT_DISABLED() (autocvar_sv_damagetext <= 0 || MUTATOR_IS_ENABLED(mutator_instagib))
#define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1)
#define SV_DAMAGETEXT_PLAYERS() (autocvar_sv_damagetext >= 2)
#define SV_DAMAGETEXT_ALL() (autocvar_sv_damagetext >= 3)
#include <common/items/_mod.qh>
-REGISTER_MUTATOR(mutator_instagib, autocvar_g_instagib && !g_nexball)
-{
- MUTATOR_ONADD
- {
- ITEM_VaporizerCells.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
- ITEM_Invisibility.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
- ITEM_Speed.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
- }
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- ITEM_VaporizerCells.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
- ITEM_Invisibility.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
- ITEM_Speed.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
- }
-}
-
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);
+
+REGISTER_MUTATOR(mutator_instagib, autocvar_g_instagib && !g_nexball)
+{
+ MUTATOR_ONADD
+ {
+ ITEM_VaporizerCells.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
+ ITEM_Invisibility.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
+ ITEM_Speed.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
+ }
+ MUTATOR_ONROLLBACK_OR_REMOVE
+ {
+ ITEM_VaporizerCells.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
+ ITEM_Invisibility.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
+ ITEM_Speed.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
+ }
+}
#include "sv_melee_only.qh"
+#include "../overkill/sv_overkill.qh"
+
string autocvar_g_melee_only;
-REGISTER_MUTATOR(melee_only, expr_evaluate(autocvar_g_melee_only) && !autocvar_g_instagib && !cvar("g_overkill") && !g_nexball);
+REGISTER_MUTATOR(melee_only, expr_evaluate(autocvar_g_melee_only) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok) && !g_nexball);
MUTATOR_HOOKFUNCTION(melee_only, SetStartItems, CBC_ORDER_LAST)
{
bool nt_IsNewToy(int w);
-REGISTER_MUTATOR(nt, expr_evaluate(cvar_string("g_new_toys")) && !autocvar_g_instagib && !cvar("g_overkill"))
+REGISTER_MUTATOR(nt, expr_evaluate(cvar_string("g_new_toys")) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok))
{
MUTATOR_ONADD
{
bool NIX_CanChooseWeapon(int wpn);
-REGISTER_MUTATOR(nix, expr_evaluate(cvar_string("g_nix")) && !autocvar_g_instagib && !cvar("g_overkill"))
+REGISTER_MUTATOR(nix, expr_evaluate(cvar_string("g_nix")) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok))
{
MUTATOR_ONADD
{
#include "sv_overkill.qh"
-#include "okshotgun.qh"
-#include "okhmg.qh"
-#include "okrpc.qh"
-
-string autocvar_g_overkill;
-
bool autocvar_g_overkill_powerups_replace;
bool autocvar_g_overkill_itemwaypoints = true;
.Weapon ok_lastwep[MAX_WEAPONSLOTS];
-REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !autocvar_g_instagib && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
-{
- MUTATOR_ONADD
- {
- precache_all_playermodels("models/ok_player/*.dpm");
-
- if (autocvar_g_overkill_filter_healthmega)
- {
- ITEM_HealthMega.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
- }
- if (autocvar_g_overkill_filter_armormedium)
- {
- ITEM_ArmorMedium.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
- }
- if (autocvar_g_overkill_filter_armorbig)
- {
- ITEM_ArmorBig.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
- }
- if (autocvar_g_overkill_filter_armormega)
- {
- ITEM_ArmorMega.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
- }
-
- WEP_OVERKILL_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
- WEP_OVERKILL_HMG.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-
- WEP_OVERKILL_SHOTGUN.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
- WEP_OVERKILL_MACHINEGUN.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
- WEP_OVERKILL_NEX.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-
- //WEP_SHOTGUN.mdl = "ok_shotgun";
- //WEP_MACHINEGUN.mdl = "ok_mg";
- //WEP_VORTEX.mdl = "ok_sniper";
- }
-
- MUTATOR_ONREMOVE
- {
- ITEM_HealthMega.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
- ITEM_ArmorMedium.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
- ITEM_ArmorBig.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
- ITEM_ArmorMega.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
-
- WEP_OVERKILL_RPC.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
- WEP_OVERKILL_HMG.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
-
- WEP_OVERKILL_SHOTGUN.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
- WEP_OVERKILL_MACHINEGUN.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
- WEP_OVERKILL_NEX.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
- }
-}
-
-void W_Blaster_Attack(entity, .entity, float, float, float, float, float, float, float, float, float, float);
-
MUTATOR_HOOKFUNCTION(ok, Damage_Calculate, CBC_ORDER_LAST)
{
entity frag_attacker = M_ARGV(1, entity);
#pragma once
+#include "okshotgun.qh"
+#include "okmachinegun.qh"
+#include "okhmg.qh"
+#include "okrpc.qh"
+
+string autocvar_g_overkill;
bool autocvar_g_overkill_filter_healthmega;
bool autocvar_g_overkill_filter_armormedium;
bool autocvar_g_overkill_filter_armorbig;
bool autocvar_g_overkill_filter_armormega;
.float ok_item;
+
+REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !MUTATOR_IS_ENABLED(mutator_instagib) && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
+{
+ MUTATOR_ONADD
+ {
+ precache_all_playermodels("models/ok_player/*.dpm");
+
+ if (autocvar_g_overkill_filter_healthmega)
+ {
+ ITEM_HealthMega.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
+ }
+ if (autocvar_g_overkill_filter_armormedium)
+ {
+ ITEM_ArmorMedium.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
+ }
+ if (autocvar_g_overkill_filter_armorbig)
+ {
+ ITEM_ArmorBig.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
+ }
+ if (autocvar_g_overkill_filter_armormega)
+ {
+ ITEM_ArmorMega.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
+ }
+
+ WEP_OVERKILL_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+ WEP_OVERKILL_HMG.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+
+ WEP_OVERKILL_SHOTGUN.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+ WEP_OVERKILL_MACHINEGUN.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+ WEP_OVERKILL_NEX.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+ }
+
+ MUTATOR_ONREMOVE
+ {
+ ITEM_HealthMega.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
+ ITEM_ArmorMedium.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
+ ITEM_ArmorBig.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
+ ITEM_ArmorMega.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
+
+ WEP_OVERKILL_RPC.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+ WEP_OVERKILL_HMG.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+
+ WEP_OVERKILL_SHOTGUN.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+ WEP_OVERKILL_MACHINEGUN.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+ WEP_OVERKILL_NEX.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+ }
+}
#include "sv_pinata.qh"
string autocvar_g_pinata;
-REGISTER_MUTATOR(pinata, expr_evaluate(autocvar_g_pinata) && !autocvar_g_instagib && !cvar("g_overkill"));
+REGISTER_MUTATOR(pinata, expr_evaluate(autocvar_g_pinata) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok));
MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
{
string RandomItems_GetRandomItemClassName(string prefix)
{
- if (autocvar_g_instagib)
+ if (MUTATOR_IS_ENABLED(mutator_instagib))
{
return RandomItems_GetRandomInstagibItemClassName(prefix);
}
- if (expr_evaluate(autocvar_g_overkill))
+ if (MUTATOR_IS_ENABLED(ok))
{
return RandomItems_GetRandomOverkillItemClassName(prefix);
}
}
random_items_is_spawning = true;
entity new_item;
- if (!expr_evaluate(autocvar_g_overkill))
+ if (!MUTATOR_IS_ENABLED(ok))
{
new_item = Item_Create(strzone(new_classname), item.origin,
Item_ShouldKeepPosition(item));
spread.z = autocvar_g_random_loot_spread / 2;
spread += randomvec() * autocvar_g_random_loot_spread;
random_items_is_spawning = true;
- if (!expr_evaluate(autocvar_g_overkill))
+ if (!MUTATOR_IS_ENABLED(ok))
{
Item_CreateLoot(class_name, position, spread,
autocvar_g_random_loot_time);
#include "sv_vampire.qh"
string autocvar_g_vampire;
-REGISTER_MUTATOR(vampire, expr_evaluate(autocvar_g_vampire) && !autocvar_g_instagib);
+REGISTER_MUTATOR(vampire, expr_evaluate(autocvar_g_vampire) && !MUTATOR_IS_ENABLED(mutator_instagib));
MUTATOR_HOOKFUNCTION(vampire, PlayerDamage_SplitHealthArmor)
{
METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this, entity it))
{
- if(autocvar_g_instagib)
+ if(MUTATOR_IS_ENABLED(mutator_instagib))
{
.entity weaponentity = weaponentities[0]; // TODO: unhardcode
FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance, 10000000000,
METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret thistur, entity it))
{
- if (autocvar_g_instagib) {
+ if (MUTATOR_IS_ENABLED(mutator_instagib)) {
.entity weaponentity = weaponentities[0]; // TODO: unhardcode
FireRailgunBullet (it, weaponentity, it.tur_shotorg, it.tur_shotorg + it.tur_shotdir_updated * max_shot_distance, 10000000000,
800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id);
#include "../common/items/_mod.qh"
#include "../common/mutators/mutator/waypoints/all.qh"
+#include "../common/mutators/mutator/instagib/sv_instagib.qh"
#include "../common/triggers/subs.qh"
#include "../common/triggers/triggers.qh"
Fire_ApplyDamage(this);
Fire_ApplyEffect(this);
- if (!autocvar_g_instagib)
+ if (!MUTATOR_IS_ENABLED(mutator_instagib))
{
if (this.items & ITEM_Strength.m_itemid)
{
}
}
- if(!autocvar_g_instagib)
+ if(!MUTATOR_IS_ENABLED(mutator_instagib))
{
// apply strength multiplier
if (attacker.items & ITEM_Strength.m_itemid)