boxparticles(particleeffectnum(EFFECT_EF_FLAME), this, this.absmin, this.absmax, this.velocity, this.velocity, bound(0, frametime, 0.1), 0);
//pointparticles(EFFECT_EF_FLAME, this.origin, '0 0 0', bound(0, frametime, 0.1));
}
+ if(eff & EF_SHOCK)
+ {
+ boxparticles(particleeffectnum(EFFECT_ARC_LIGHTNING), this, this.absmin, this.absmax, '0 0 0', '0 0 0', bound(0, frametime, 0.1), 0);
+ //pointparticles(EFFECT_ARC_LIGHTNING, this.origin, '0 0 0', bound(0, frametime, 0.1));
+ }
if(eff & EF_STARDUST)
{
boxparticles(particleeffectnum(EFFECT_EF_STARDUST), this, this.absmin, this.absmax, this.velocity, this.velocity, bound(0, frametime, 0.1), 0);
const int INITPRIO_SETLOCATION = 90;
const int INITPRIO_LINKDOORS = 91;
const int INITPRIO_LAST = 99;
+
+// effects
+const int EF_SHOCK = 262144;
#endif
#if defined(SVQC)
EFFECT(0, JUMPPAD, "jumppad_activate")
EFFECT(1, BULLET, "tr_bullet")
EFFECT(1, BULLET_WEAK, "tr_bullet_weak")
+EFFECT(0, EF_SHOCK, "arc_lightning")
EFFECT(0, EF_FLAME, "EF_FLAME")
EFFECT(0, EF_STARDUST, "EF_STARDUST")
EFFECT(0, TE_EXPLOSION, "TE_EXPLOSION")
ENDCLASS(DisabilityBuff)
REGISTER_BUFF(DISABILITY, NEW(DisabilityBuff));
BUFF_SPAWNFUNCS(disability, BUFF_DISABILITY)
-// status effect applied to targets by the disability buff
-CLASS(Disabled, StatusEffects)
- ATTRIB(Disabled, netname, string, "disabled");
-#if 0
- // NOTE: status effect name and icon disabled as they are not displayed
- // re-enable if status effects are given a visual element
- ATTRIB(Disabled, m_name, string, _("Disabled"));
- ATTRIB(Disabled, m_icon, string, "buff_disability");
-#endif
- ATTRIB(Disabled, m_color, vector, '0.94 0.3 1');
- ATTRIB(Disabled, m_hidden, bool, true);
- ATTRIB(Disabled, m_lifetime, float, 10);
- ATTRIB(Disabled, disabled_effect_time, float, 0); // TODO: handle this effect client side like EF_FLAME!
-ENDCLASS(Disabled)
-REGISTER_STATUSEFFECT(Disabled, NEW(Disabled));
CLASS(VengeanceBuff, Buff)
ATTRIB(VengeanceBuff, m_name, string, _("Vengeance"));
SUPER(Buff).m_remove(this, actor, removal_type);
}
-METHOD(Disabled, m_tick, void(StatusEffects this, entity actor))
-{
- if(time >= actor.disabled_effect_time)
- {
- Send_Effect(EFFECT_SMOKING, actor.origin + ((actor.mins + actor.maxs) * 0.5), '0 0 0', 1);
- actor.disabled_effect_time = time + 0.5;
- }
- SUPER(Disabled).m_tick(this, actor);
-}
-METHOD(Disabled, m_remove, void(StatusEffects this, entity actor, int removal_type))
-{
- actor.disabled_effect_time = 0;
- SUPER(Disabled).m_remove(this, actor, removal_type);
-}
-
METHOD(AmmoBuff, m_apply, void(StatusEffects this, entity actor, float eff_time, float eff_flags))
{
bool wasactive = (actor.statuseffects && (actor.statuseffects.statuseffect_flags[this.m_id] & STATUSEFFECT_FLAG_ACTIVE));
if(StatusEffects_active(BUFF_DISABILITY, frag_attacker))
if(frag_target != frag_attacker)
- StatusEffects_apply(STATUSEFFECT_Disabled, frag_target, time + autocvar_g_buffs_disability_slowtime, 0);
+ StatusEffects_apply(STATUSEFFECT_Stunned, frag_target, time + autocvar_g_buffs_disability_slowtime, 0);
if(StatusEffects_active(BUFF_INFERNO, frag_target))
{
entity player = M_ARGV(0, entity);
// these automatically reset, no need to worry
- if(StatusEffects_active(STATUSEFFECT_Disabled, player))
+ if(StatusEffects_active(STATUSEFFECT_Stunned, player))
STAT(MOVEVARS_HIGHSPEED, player) *= autocvar_g_buffs_disability_speed;
}
{
entity mon = M_ARGV(0, entity);
- if(StatusEffects_active(STATUSEFFECT_Disabled, mon))
+ if(StatusEffects_active(STATUSEFFECT_Stunned, mon))
{
M_ARGV(1, float) *= autocvar_g_buffs_disability_speed; // run speed
M_ARGV(2, float) *= autocvar_g_buffs_disability_speed; // walk speed
{
entity player = M_ARGV(1, entity);
- if(StatusEffects_active(STATUSEFFECT_Disabled, player))
+ if(StatusEffects_active(STATUSEFFECT_Stunned, player))
M_ARGV(0, float) *= autocvar_g_buffs_disability_rate;
}
{
entity player = M_ARGV(1, entity);
- if(StatusEffects_active(STATUSEFFECT_Disabled, player))
+ if(StatusEffects_active(STATUSEFFECT_Stunned, player))
M_ARGV(0, float) *= autocvar_g_buffs_disability_weaponspeed;
}
// generated file; do not modify
#include <common/mutators/mutator/status_effects/status_effect/burning.qc>
#include <common/mutators/mutator/status_effects/status_effect/spawnshield.qc>
+#include <common/mutators/mutator/status_effects/status_effect/stunned.qc>
#include <common/mutators/mutator/status_effects/status_effect/superweapons.qc>
// generated file; do not modify
#include <common/mutators/mutator/status_effects/status_effect/burning.qh>
#include <common/mutators/mutator/status_effects/status_effect/spawnshield.qh>
+#include <common/mutators/mutator/status_effects/status_effect/stunned.qh>
#include <common/mutators/mutator/status_effects/status_effect/superweapons.qh>
--- /dev/null
+#include "stunned.qh"
+
+#ifdef SVQC
+METHOD(Stunned, m_remove, void(StatusEffects this, entity actor, int removal_type))
+{
+ actor.effects &= ~EF_SHOCK;
+ SUPER(Stunned).m_remove(this, actor, removal_type);
+}
+#if 0
+// TODO: some infinite source of stunning? e.g. some electric current
+METHOD(Stunned, m_persistent, bool(StatusEffects this, entity actor))
+{
+ return true;
+}
+#endif
+METHOD(Stunned, m_tick, void(StatusEffects this, entity actor))
+{
+ if(STAT(FROZEN, actor))
+ {
+ this.m_remove(this, actor, STATUSEFFECT_REMOVE_NORMAL);
+ return;
+ }
+ //Shock_ApplyDamage(actor);
+ actor.effects |= EF_SHOCK;
+ SUPER(Stunned).m_tick(this, actor);
+}
+#endif
--- /dev/null
+#pragma once
+
+#include <common/mutators/mutator/status_effects/all.qh>
+
+#ifdef SVQC
+//void Shock_ApplyDamage(entity e);
+#endif
+#ifdef GAMEQC
+SOUND(Stunned_Remove, "onslaught/ons_spark1");
+#endif
+CLASS(Stunned, StatusEffects)
+ ATTRIB(Stunned, netname, string, "stunned");
+#if 0
+ // NOTE: status effect name and icon disabled as they are not displayed
+ // re-enable if status effects are given a visual element
+ ATTRIB(Stunned, m_name, string, _("Stunned"));
+ ATTRIB(Stunned, m_icon, string, "buff_disability");
+#endif
+ ATTRIB(Stunned, m_color, vector, '0.67 0.84 1');
+ ATTRIB(Stunned, m_hidden, bool, true);
+ ATTRIB(Stunned, m_lifetime, float, 10);
+#ifdef GAMEQC
+ ATTRIB(Stunned, m_sound_rm, Sound, SND_Stunned_Remove);
+#endif
+ENDCLASS(Stunned)
+REGISTER_STATUSEFFECT(Stunned, NEW(Stunned));