#include "mutator.qh"
-#include "../../common/buffs.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;
}
bool 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));
void buff_Waypoint_Spawn(entity e)
{
entity buff = buff_FirstFromFlags(e.buffs);
- 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_POWERUP);
+ 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_POWERUP, e.glowmod);
+ WaypointSprite_UpdateTeamRadar(e.buff_waypoint, RADARICON_Buff, e.glowmod);
e.buff_waypoint.waypointsprite_visible_for_player = buff_Waypoint_visible_for_player;
}
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()
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
}
Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_INFO, INFO_ITEM_BUFF, other.netname, buffid);
Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1);
- sound(other, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM);
+ 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;
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));
self.glowmod = buff_GlowColor(buff);
self.skin = buff.m_skin;
- setmodel(self, BUFF_MODEL);
+ setmodel(self, MDL_BUFF);
if(self.buff_waypoint)
{
if(!self.buff_activetime)
{
self.buff_active = true;
- sound(self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, SND_STRENGTH_RESPAWN, VOL_BASE, ATTN_NORM);
Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(self), '0 0 0', 1);
}
}
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))
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;
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;
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;
}
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)
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(W_Sound("rocket_impact"));
- precache_sound("keepaway/respawn.wav");
-
addstat(STAT_BUFFS, AS_INT, buffs);
addstat(STAT_BUFF_TIME, AS_FLOAT, buff_time);