]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_buffs.qc
Merge branch 'master' into terencehill/hud_cleanups
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_buffs.qc
index b46c4de9ea17418f78514b2cb2de85d9c50f848f..7c24ea14f205bfc76ccee0e2213ec4fd2b5a2a21 100644 (file)
@@ -1,24 +1,24 @@
 #include "../../common/triggers/target/music.qh"
 #include "mutator_buffs.qh"
-#include "../_all.qh"
 
 #include "mutator.qh"
 
-#include "../../common/buffs.qh"
+#include "../../common/gamemodes/all.qh"
+#include "../../common/buffs/all.qh"
 
 entity buff_FirstFromFlags(int _buffs)
 {
        if (flags)
        {
-               FOREACH(BUFFS, it.m_itemid & _buffs, LAMBDA(return it));
+               FOREACH(Buffs, it.m_itemid & _buffs, LAMBDA(return it));
        }
-       return BUFF_NULL;
+       return BUFF_Null;
 }
 
-float buffs_BuffModel_Customize()
-{
+bool buffs_BuffModel_Customize()
+{SELFPARAM();
        entity player, myowner;
-       float same_team;
+       bool same_team;
 
        player = WaypointSprite_getviewentity(other);
        myowner = self.owner;
@@ -27,6 +27,9 @@ float buffs_BuffModel_Customize()
        if(myowner.alpha <= 0.5 && !same_team && myowner.alpha != 0)
                return false;
 
+       if(MUTATOR_CALLHOOK(BuffModel_Customize, self, player))
+               return false;
+
        if(player == myowner || (IS_SPEC(other) && other.enemy == myowner))
        {
                // somewhat hide the model, but keep the glow
@@ -44,7 +47,7 @@ float buffs_BuffModel_Customize()
 void buffs_BuffModel_Spawn(entity player)
 {
        player.buff_model = spawn();
-       setmodel(player.buff_model, BUFF_MODEL);
+       setmodel(player.buff_model, MDL_BUFF);
        setsize(player.buff_model, '0 0 -40', '0 0 40');
        setattachment(player.buff_model, player, "");
        setorigin(player.buff_model, '0 0 1' * (player.buff_model.maxs.z * 1));
@@ -62,19 +65,19 @@ vector buff_GlowColor(entity buff)
 }
 
 void buff_Effect(entity player, string eff)
-{
+{SELFPARAM();
        if(!autocvar_g_buffs_effects) { return; }
 
        if(time >= self.buff_effect_delay)
        {
-               pointparticles(particleeffectnum(eff), player.origin + ((player.mins + player.maxs) * 0.5), '0 0 0', 1);
+               Send_Effect_(eff, player.origin + ((player.mins + player.maxs) * 0.5), '0 0 0', 1);
                self.buff_effect_delay = time + 0.05; // prevent spam
        }
 }
 
 // buff item
 float buff_Waypoint_visible_for_player(entity plr)
-{
+{SELFPARAM();
        if(!self.owner.buff_active && !self.owner.buff_activetime)
                return false;
 
@@ -89,13 +92,14 @@ float buff_Waypoint_visible_for_player(entity plr)
 void buff_Waypoint_Spawn(entity e)
 {
        entity buff = buff_FirstFromFlags(e.buffs);
-       WaypointSprite_Spawn(buff.m_sprite, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, world, e.team, e, buff_waypoint, true, RADARICON_POWERUP, e.glowmod);
-       WaypointSprite_UpdateTeamRadar(e.buff_waypoint, RADARICON_POWERUP, e.glowmod);
+       entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, world, e.team, e, buff_waypoint, true, RADARICON_Buff);
+       wp.wp_extra = buff.m_id;
+       WaypointSprite_UpdateTeamRadar(e.buff_waypoint, RADARICON_Buff, e.glowmod);
        e.buff_waypoint.waypointsprite_visible_for_player = buff_Waypoint_visible_for_player;
 }
 
 void buff_SetCooldown(float cd)
-{
+{SELFPARAM();
        cd = max(0, cd);
 
        if(!self.buff_waypoint)
@@ -107,7 +111,7 @@ void buff_SetCooldown(float cd)
 }
 
 void buff_Respawn(entity ent)
-{
+{SELFPARAM();
        if(gameover) { return; }
 
        vector oldbufforigin = ent.origin;
@@ -131,16 +135,16 @@ void buff_Respawn(entity ent)
        if(autocvar_g_buffs_random_lifetime > 0)
                ent.lifetime = time + autocvar_g_buffs_random_lifetime;
 
-       pointparticles(particleeffectnum("electro_combo"), oldbufforigin + ((ent.mins + ent.maxs) * 0.5), '0 0 0', 1);
-       pointparticles(particleeffectnum("electro_combo"), CENTER_OR_VIEWOFS(ent), '0 0 0', 1);
+       Send_Effect(EFFECT_ELECTRO_COMBO, oldbufforigin + ((ent.mins + ent.maxs) * 0.5), '0 0 0', 1);
+       Send_Effect(EFFECT_ELECTRO_COMBO, CENTER_OR_VIEWOFS(ent), '0 0 0', 1);
 
        WaypointSprite_Ping(ent.buff_waypoint);
 
-       sound(ent, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
+       sound(ent, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
 }
 
 void buff_Touch()
-{
+{SELFPARAM();
        if(gameover) { return; }
 
        if(ITEM_TOUCH_NEEDKILL())
@@ -152,7 +156,6 @@ void buff_Touch()
        if((self.team && DIFF_TEAM(other, self))
        || (other.frozen)
        || (other.vehicle)
-       || (!IS_PLAYER(other))
        || (!self.buff_active)
        )
        {
@@ -160,6 +163,12 @@ void buff_Touch()
                return;
        }
 
+       if(MUTATOR_CALLHOOK(BuffTouch, self, other))
+               return;
+
+       if(!IS_PLAYER(other))
+               return; // incase mutator changed other
+
        if (other.buffs)
        {
                if (other.cvar_cl_buffs_autoreplace && other.buffs != self.buffs)
@@ -169,7 +178,7 @@ void buff_Touch()
                        Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ITEM_BUFF_LOST, other.netname, buffid);
 
                        other.buffs = 0;
-                       //sound(other, CH_TRIGGER, "relics/relic_effect.wav", VOL_BASE, ATTN_NORM);
+                       //sound(other, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
                }
                else { return; } // do nothing
        }
@@ -181,14 +190,14 @@ void buff_Touch()
        Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_GOT, buffid);
        Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_INFO, INFO_ITEM_BUFF, other.netname, buffid);
 
-       pointparticles(particleeffectnum("item_pickup"), CENTER_OR_VIEWOFS(self), '0 0 0', 1);
-       sound(other, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM);
+       Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1);
+       sound(other, CH_TRIGGER, SND_SHIELD_RESPAWN, VOL_BASE, ATTN_NORM);
        other.buffs |= (self.buffs);
 }
 
 float buff_Available(entity buff)
 {
-       if (buff == BUFF_NULL)
+       if (buff == BUFF_Null)
                return false;
        if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_WEAPON_AMMO) || (start_items & IT_UNLIMITED_AMMO) || (cvar("g_melee_only"))))
                return false;
@@ -202,7 +211,7 @@ float buff_Available(entity buff)
 void buff_NewType(entity ent, float cb)
 {
        RandomSelection_Init();
-       FOREACH(BUFFS, buff_Available(it), LAMBDA(
+       FOREACH(Buffs, buff_Available(it), LAMBDA(
                it.buff_seencount += 1;
                // if it's already been chosen, give it a lower priority
                RandomSelection_Add(world, it.m_itemid, string_null, 1, max(0.2, 1 / it.buff_seencount));
@@ -211,7 +220,7 @@ void buff_NewType(entity ent, float cb)
 }
 
 void buff_Think()
-{
+{SELFPARAM();
        if(self.buffs != self.oldbuffs)
        {
                entity buff = buff_FirstFromFlags(self.buffs);
@@ -219,7 +228,7 @@ void buff_Think()
                self.glowmod = buff_GlowColor(buff);
                self.skin = buff.m_skin;
 
-               setmodel(self, BUFF_MODEL);
+               setmodel(self, MDL_BUFF);
 
                if(self.buff_waypoint)
                {
@@ -262,8 +271,8 @@ void buff_Think()
                if(!self.buff_activetime)
                {
                        self.buff_active = true;
-                       sound(self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM);
-                       pointparticles(particleeffectnum("item_respawn"), CENTER_OR_VIEWOFS(self), '0 0 0', 1);
+                       sound(self, CH_TRIGGER, SND_STRENGTH_RESPAWN, VOL_BASE, ATTN_NORM);
+                       Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(self), '0 0 0', 1);
                }
        }
 
@@ -282,14 +291,14 @@ void buff_Think()
 }
 
 void buff_Waypoint_Reset()
-{
+{SELFPARAM();
        WaypointSprite_Kill(self.buff_waypoint);
 
        if(self.buff_activetime) { buff_Waypoint_Spawn(self); }
 }
 
 void buff_Reset()
-{
+{SELFPARAM();
        if(autocvar_g_buffs_randomize)
                buff_NewType(self, self.buffs);
        self.owner = world;
@@ -302,7 +311,7 @@ void buff_Reset()
 }
 
 float buff_Customize()
-{
+{SELFPARAM();
        entity player = WaypointSprite_getviewentity(other);
        if(!self.buff_active || (self.team && DIFF_TEAM(player, self)))
        {
@@ -321,15 +330,14 @@ float buff_Customize()
 }
 
 void buff_Init(entity ent)
-{
+{SELFPARAM();
        if(!cvar("g_buffs")) { remove(ent); return; }
 
        if(!teamplay && ent.team) { ent.team = 0; }
 
        entity buff = buff_FirstFromFlags(self.buffs);
 
-       entity oldself = self;
-       self = ent;
+       setself(ent);
        if(!self.buffs || buff_Available(buff))
                buff_NewType(self, 0);
 
@@ -360,13 +368,13 @@ void buff_Init(entity ent)
        if(self.noalign)
                self.movetype = MOVETYPE_NONE; // reset by random location
 
-       setmodel(self, BUFF_MODEL);
+       setmodel(self, MDL_BUFF);
        setsize(self, BUFF_MIN, BUFF_MAX);
 
        if(cvar("g_buffs_random_location") || (self.spawnflags & 64))
                buff_Respawn(self);
 
-       self = oldself;
+       setself(this);
 }
 
 void buff_Init_Compat(entity ent, entity replacement)
@@ -391,9 +399,9 @@ void buff_SpawnReplacement(entity ent, entity old)
 }
 
 void buff_Vengeance_DelayedDamage()
-{
+{SELFPARAM();
        if(self.enemy)
-               Damage(self.enemy, self.owner, self.owner, self.dmg, DEATH_BUFF, self.enemy.origin, '0 0 0');
+               Damage(self.enemy, self.owner, self.owner, self.dmg, DEATH_BUFF.m_id, self.enemy.origin, '0 0 0');
 
        remove(self);
        return;
@@ -407,7 +415,7 @@ float buff_Inferno_CalculateTime(float x, float offset_x, float offset_y, float
 // mutator hooks
 MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_SplitHealthArmor)
 {
-       if(frag_deathtype == DEATH_BUFF) { return false; }
+       if(frag_deathtype == DEATH_BUFF.m_id) { return false; }
 
        if(frag_target.buffs & BUFF_RESISTANCE.m_itemid)
        {
@@ -421,7 +429,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_SplitHealthArmor)
 
 MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
 {
-       if(frag_deathtype == DEATH_BUFF) { return false; }
+       if(frag_deathtype == DEATH_BUFF.m_id) { return false; }
 
        if(frag_target.buffs & BUFF_SPEED.m_itemid)
        if(frag_target != frag_attacker)
@@ -435,7 +443,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
                frag_damage = max(5, frag_target.health - autocvar_g_buffs_medic_survive_health);
 
        if(frag_target.buffs & BUFF_JUMP.m_itemid)
-       if(frag_deathtype == DEATH_FALL)
+       if(frag_deathtype == DEATH_FALL.m_id)
                frag_damage = 0;
 
        if(frag_target.buffs & BUFF_VENGEANCE.m_itemid)
@@ -487,7 +495,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
                        autocvar_g_buffs_inferno_burntime_target_time,
                        autocvar_g_buffs_inferno_burntime_factor
                );
-               Fire_AddDamage(frag_target, frag_attacker, (frag_damage * autocvar_g_buffs_inferno_damagemultiplier) * time, time, DEATH_BUFF);
+               Fire_AddDamage(frag_target, frag_attacker, (frag_damage * autocvar_g_buffs_inferno_damagemultiplier) * time, time, DEATH_BUFF.m_id);
        }
 
        // this... is ridiculous (TODO: fix!)
@@ -511,7 +519,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_PlayerSpawn)
-{
+{SELFPARAM();
        self.buffs = 0;
        // reset timers here to prevent them continuing after re-spawn
        self.buff_disability_time = 0;
@@ -519,8 +527,12 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerSpawn)
        return false;
 }
 
+.float stat_sv_maxspeed;
+.float stat_sv_airspeedlimit_nonqw;
+.float stat_sv_jumpvelocity;
+
 MUTATOR_HOOKFUNCTION(buffs_PlayerPhysics)
-{
+{SELFPARAM();
        if(self.buffs & BUFF_SPEED.m_itemid)
        {
                self.stat_sv_maxspeed *= autocvar_g_buffs_speed_speed;
@@ -543,7 +555,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerPhysics)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_PlayerJump)
-{
+{SELFPARAM();
        if(self.buffs & BUFF_JUMP.m_itemid)
                player_jumpheight = autocvar_g_buffs_jump_height;
 
@@ -551,7 +563,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerJump)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_MonsterMove)
-{
+{SELFPARAM();
        if(time < self.buff_disability_time)
        {
                monster_speed_walk *= autocvar_g_buffs_disability_speed;
@@ -562,7 +574,7 @@ MUTATOR_HOOKFUNCTION(buffs_MonsterMove)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_PlayerDies)
-{
+{SELFPARAM();
        if(self.buffs)
        {
                int buffid = buff_FirstFromFlags(self.buffs).m_id;
@@ -579,7 +591,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerDies)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_PlayerUseKey)
-{
+{SELFPARAM();
        if(MUTATOR_RETURNVALUE || gameover) { return false; }
        if(self.buffs)
        {
@@ -588,14 +600,14 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerUseKey)
                Send_Notification(NOTIF_ALL_EXCEPT, self, MSG_INFO, INFO_ITEM_BUFF_LOST, self.netname, buffid);
 
                self.buffs = 0;
-               sound(self, CH_TRIGGER, "relics/relic_effect.wav", VOL_BASE, ATTN_NORM);
+               sound(self, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
                return true;
        }
        return false;
 }
 
 MUTATOR_HOOKFUNCTION(buffs_PlayerThrowKey)
-{
+{SELFPARAM();
        if(MUTATOR_RETURNVALUE || gameover) { return false; }
 
        if(self.buffs & BUFF_SWAPPER.m_itemid)
@@ -629,7 +641,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThrowKey)
                        if(closest.flagcarried) { ctf_Handle_Throw(closest, world, DROP_THROW); }
                        if(closest.nade) { toss_nade(closest, '0 0 0', time + 0.05); }
 
-                       MUTATOR_CALLHOOK(PortalTeleport); // initiate flag dropper
+                       MUTATOR_CALLHOOK(PortalTeleport, self); // initiate flag dropper
 
                        setorigin(self, their_org);
                        setorigin(closest, my_org);
@@ -650,11 +662,11 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThrowKey)
                        closest.pushltime = time + autocvar_g_maxpushtime;
                        closest.istypefrag = closest.BUTTON_CHAT;
 
-                       pointparticles(particleeffectnum("electro_combo"), their_org, '0 0 0', 1);
-                       pointparticles(particleeffectnum("electro_combo"), my_org, '0 0 0', 1);
+                       Send_Effect(EFFECT_ELECTRO_COMBO, their_org, '0 0 0', 1);
+                       Send_Effect(EFFECT_ELECTRO_COMBO, my_org, '0 0 0', 1);
 
-                       sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NORM);
-                       sound(closest, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NORM);
+                       sound(self, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NORM);
+                       sound(closest, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NORM);
 
                        // TODO: add a counter to handle how many times one can teleport, and a delay to prevent spam
                        self.buffs = 0;
@@ -665,7 +677,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThrowKey)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_RemovePlayer)
-{
+{SELFPARAM();
        if(self.buff_model)
        {
                remove(self.buff_model);
@@ -680,7 +692,7 @@ MUTATOR_HOOKFUNCTION(buffs_RemovePlayer)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_CustomizeWaypoint)
-{
+{SELFPARAM();
        entity e = WaypointSprite_getviewentity(other);
 
        // if you have the invisibility powerup, sprites ALWAYS are restricted to your team
@@ -693,7 +705,7 @@ MUTATOR_HOOKFUNCTION(buffs_CustomizeWaypoint)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_OnEntityPreSpawn)
-{
+{SELFPARAM();
        if(autocvar_g_buffs_replace_powerups)
        switch(self.classname)
        {
@@ -709,7 +721,7 @@ MUTATOR_HOOKFUNCTION(buffs_OnEntityPreSpawn)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_WeaponRate)
-{
+{SELFPARAM();
        if(self.buffs & BUFF_SPEED.m_itemid)
                weapon_rate *= autocvar_g_buffs_speed_rate;
 
@@ -720,7 +732,7 @@ MUTATOR_HOOKFUNCTION(buffs_WeaponRate)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_WeaponSpeed)
-{
+{SELFPARAM();
        if(self.buffs & BUFF_SPEED.m_itemid)
                ret_float *= autocvar_g_buffs_speed_weaponspeed;
 
@@ -733,13 +745,13 @@ MUTATOR_HOOKFUNCTION(buffs_WeaponSpeed)
 .float buff_time;
 
 MUTATOR_HOOKFUNCTION(buffs_PlayerThink)
-{
+{SELFPARAM();
        if(gameover || self.deadflag != DEAD_NO) { return false; }
 
        if(time < self.buff_disability_time)
        if(time >= self.buff_disability_effect_time)
        {
-               pointparticles(particleeffectnum("smoking"), self.origin + ((self.mins + self.maxs) * 0.5), '0 0 0', 1);
+               Send_Effect(EFFECT_SMOKING, self.origin + ((self.mins + self.maxs) * 0.5), '0 0 0', 1);
                self.buff_disability_effect_time = time + 0.5;
        }
 
@@ -763,7 +775,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThink)
                        if(buff_lost >= 2)
                        {
                                Send_Notification(NOTIF_ONE, self, MSG_MULTI, ITEM_BUFF_DROP, buffid); // TODO: special timeout message?
-                               sound(self, CH_TRIGGER, "relics/relic_effect.wav", VOL_BASE, ATTN_NORM);
+                               sound(self, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
                        }
                        self.buffs = 0;
                }
@@ -775,13 +787,12 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThink)
                for(other = world; (other = findflags(other, flags, FL_ITEM)); )
                if(boxesoverlap(self.absmin - pickup_size, self.absmax + pickup_size, other.absmin, other.absmax))
                {
-                       entity oldself = self;
-                       self = other;
-                       other = oldself;
+                       setself(other);
+                       other = this;
                        if(self.touch)
                                self.touch();
                        other = self;
-                       self = oldself;
+                       setself(this);
                }
        }
 
@@ -799,7 +810,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThink)
        if(self.buffs != self.oldbuffs)
        {
                entity buff = buff_FirstFromFlags(self.buffs);
-               float bufftime = buff != BUFF_NULL ? buff.m_time(buff) : 0;
+               float bufftime = buff != BUFF_Null ? buff.m_time(buff) : 0;
                self.buff_time = (bufftime) ? time + bufftime : 0;
 
                BUFF_ONADD(BUFF_AMMO)
@@ -880,7 +891,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThink)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_SpectateCopy)
-{
+{SELFPARAM();
        self.buffs = other.buffs;
        return false;
 }
@@ -900,7 +911,7 @@ MUTATOR_HOOKFUNCTION(buffs_VehicleExit)
 }
 
 MUTATOR_HOOKFUNCTION(buffs_PlayerRegen)
-{
+{SELFPARAM();
        if(self.buffs & BUFF_MEDIC.m_itemid)
        {
                regen_mod_rot = autocvar_g_buffs_medic_rot;
@@ -950,13 +961,6 @@ void buffs_DelayedInit()
 
 void buffs_Initialize()
 {
-       precache_model(BUFF_MODEL);
-       precache_sound("misc/strength_respawn.wav");
-       precache_sound("misc/shield_respawn.wav");
-       precache_sound("relics/relic_effect.wav");
-       precache_sound("weapons/rocket_impact.wav");
-       precache_sound("keepaway/respawn.wav");
-
        addstat(STAT_BUFFS, AS_INT, buffs);
        addstat(STAT_BUFF_TIME, AS_FLOAT, buff_time);