Xonotic
sv_buffs.qc File Reference
+ Include dependency graph for sv_buffs.qc:

Go to the source code of this file.

Functions

float buff_Available (entity buff)
 
bool buff_Customize (entity this, entity client)
 
void buff_Delete (entity this)
 
void buff_Effect (entity player, string eff)
 
entity buff_FirstFromFlags (entity actor)
 
float buff_Inferno_CalculateTime (float damg, float offset_x, float offset_y, float intersect_x, float intersect_y, float base)
 
void buff_Init (entity this)
 
void buff_Init_Compat (entity ent, entity replacement)
 
void buff_NewType (entity ent)
 
void buff_RemoveAll (entity actor, int removal_type)
 
void buff_Reset (entity this)
 
void buff_Respawn (entity this)
 
void buff_SetCooldown (entity this, float cd)
 
void buff_SpawnReplacement (entity ent, entity old)
 
void buff_Think (entity this)
 
void buff_Touch (entity this, entity toucher)
 
void buff_Vengeance_DelayedDamage (entity this)
 
void buff_Waypoint_Reset (entity this)
 
void buff_Waypoint_Spawn (entity e)
 
bool buff_Waypoint_visible_for_player (entity this, entity player, entity view)
 
bool buffs_BuffModel_Customize (entity this, entity client)
 
void buffs_BuffModel_Remove (entity player)
 
void buffs_BuffModel_Spawn (entity player)
 
void buffs_BuffModel_Think (entity this)
 
void buffs_BuffModel_Update (entity this)
 
void buffs_DelayedInit (entity this)
 
void buffs_Initialize ()
 
bool buffs_RemovePlayer (entity player)
 
 MUTATOR_HOOKFUNCTION (buffs, Damage_Calculate)
 
 MUTATOR_HOOKFUNCTION (buffs, PlayerDamage_SplitHealthArmor)
 
 MUTATOR_HOOKFUNCTION (buffs, PlayerPhysics_UpdateStats)
 
 MUTATOR_HOOKFUNCTION (buffs, PlayerPhysics)
 
 MUTATOR_HOOKFUNCTION (buffs, MonsterMove)
 
 MUTATOR_HOOKFUNCTION (buffs, PlayerUseKey, CBC_ORDER_FIRST)
 
 MUTATOR_HOOKFUNCTION (buffs, ForbidThrowCurrentWeapon)
 
 MUTATOR_HOOKFUNCTION (buffs, MakePlayerObserver)
 
 MUTATOR_HOOKFUNCTION (buffs, ClientDisconnect)
 
 MUTATOR_HOOKFUNCTION (buffs, FilterItem)
 
 MUTATOR_HOOKFUNCTION (buffs, WeaponRateFactor)
 
 MUTATOR_HOOKFUNCTION (buffs, WeaponSpeedFactor)
 
 MUTATOR_HOOKFUNCTION (buffs, Freeze)
 
 MUTATOR_HOOKFUNCTION (buffs, PlayerPreThink)
 
 MUTATOR_HOOKFUNCTION (buffs, PlayerRegen)
 
 MUTATOR_HOOKFUNCTION (buffs, BuildMutatorsString)
 
 MUTATOR_HOOKFUNCTION (buffs, BuildMutatorsPrettyString)
 

Variables

int buff_seencount
 

Function Documentation

◆ buff_Available()

float buff_Available ( entity  buff)

Definition at line 257 of file sv_buffs.qc.

References cvar(), start_items, and strcat().

Referenced by buff_Init(), buff_NewType(), and GiveItems().

258 {
259  if (!buff)
260  return false;
261  if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_AMMO) || cvar("g_melee_only")))
262  return false;
263  if (buff == BUFF_VAMPIRE && cvar("g_vampire"))
264  return false;
265  return cvar(strcat("g_buffs_", buff.netname));
266 }
int start_items
Definition: world.qh:84
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Customize()

bool buff_Customize ( entity  this,
entity  client 
)

Definition at line 399 of file sv_buffs.qc.

References alpha, buff_active, EF_FULLBRIGHT, effects, entity(), light_lev, pflags, PFLAGS_FULLDYNAMIC, sin(), team_forced, and time.

Referenced by buff_Init().

400 {
401  entity player = WaypointSprite_getviewentity(client);
402  if((!this.buff_active || !this.buffdef) || (this.team_forced && player.team != this.team_forced))
403  {
404  this.alpha = 0.3;
405  if(this.effects & EF_FULLBRIGHT) { this.effects &= ~(EF_FULLBRIGHT); }
406  this.pflags = 0;
407  }
408  else
409  {
410  this.alpha = 1;
411  if(!(this.effects & EF_FULLBRIGHT)) { this.effects |= EF_FULLBRIGHT; }
412  this.light_lev = 220 + 36 * sin(time);
413  this.pflags = PFLAGS_FULLDYNAMIC;
414  }
415  return true;
416 }
float alpha
Definition: items.qc:14
bool buff_active
Definition: sv_buffs.qh:69
entity() spawn
float effects
Definition: csprogsdefs.qc:111
const float EF_FULLBRIGHT
Definition: csprogsdefs.qc:303
int team_forced
Definition: teamplay.qh:15
float light_lev
const float PFLAGS_FULLDYNAMIC
Definition: csprogsdefs.qc:298
float pflags
float time
Definition: csprogsdefs.qc:16
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Delete()

void buff_Delete ( entity  this)

Definition at line 418 of file sv_buffs.qc.

References buff_waypoint, and delete_fn().

Referenced by buff_Init().

419 {
420  WaypointSprite_Kill(this.buff_waypoint);
421  delete_fn(this);
422 }
entity buff_waypoint
Definition: sv_buffs.qh:72
var void delete_fn(entity e)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Effect()

void buff_Effect ( entity  player,
string  eff 
)

Definition at line 101 of file sv_buffs.qc.

References autocvar_g_buffs_effects, and time.

102 {
103  if(!autocvar_g_buffs_effects) { return; }
104 
105  if(time >= player.buff_effect_delay)
106  {
107  Send_Effect_(eff, player.origin + ((player.mins + player.maxs) * 0.5), '0 0 0', 1);
108  player.buff_effect_delay = time + 0.05; // prevent spam
109  }
110 }
bool autocvar_g_buffs_effects
Definition: sv_buffs.qh:19
float time
Definition: csprogsdefs.qc:16

◆ buff_FirstFromFlags()

entity buff_FirstFromFlags ( entity  actor)

Definition at line 296 of file sv_buffs.qc.

References FOREACH, and NULL.

Referenced by buff_Think(), buff_Touch(), buff_Waypoint_visible_for_player(), buffs_BuffModel_Customize(), buffs_BuffModel_Think(), MUTATOR_HOOKFUNCTION(), Obituary(), and target_init_use().

297 {
298  if(!actor.statuseffects)
299  return NULL;
300  FOREACH(StatusEffect, it.instanceOfBuff && it.m_active(it, actor), { return it; });
301  return NULL;
302 }
#define NULL
Definition: post.qh:17
#define FOREACH(list, cond, body)
Definition: iter.qh:19
+ Here is the caller graph for this function:

◆ buff_Inferno_CalculateTime()

float buff_Inferno_CalculateTime ( float  damg,
float  offset_x,
float  offset_y,
float  intersect_x,
float  intersect_y,
float  base 
)

Definition at line 507 of file sv_buffs.qc.

References ATTN_NORM, autocvar_g_buffs_pickup_delay, BITSET, buff_ammo_prev_clipload, CH_TRIGGER, clip_load, EF_NOSHADOW, entity(), g_items, IL_EACH, IS_INDEPENDENT_PLAYER, IS_PLAYER, logn(), m_id, max(), MAX_WEAPONSLOTS, METHOD, sound, STATUSEFFECT_FLAG_ACTIVE, STATUSEFFECT_REMOVE_NORMAL, STATUSEFFECT_REMOVE_TIMEOUT, SUPER, time, vector(), VOL_BASE, weapon_load, and weaponentities.

Referenced by MUTATOR_HOOKFUNCTION().

508 {
509  return offset_y + (intersect_y - offset_y) * logn(((damg - offset_x) * ((base - 1) / intersect_x)) + 1, base);
510 }
float logn(float e, float base)
Definition: mathlib.qc:102
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Init()

void buff_Init ( entity  this)

Definition at line 424 of file sv_buffs.qc.

References autocvar_g_buffs_cooldown_activate, bot_pickup, bot_pickupbasevalue, buff_active, buff_activetime, buff_Available(), buff_Customize(), buff_Delete(), BUFF_MAX, BUFF_MIN, buff_NewType(), buff_Reset(), buff_Respawn(), buff_SetCooldown(), buff_Think(), buff_Touch(), classname, color, count, cvar(), DPCONTENTS_BODY, DPCONTENTS_SOLID, dphitcontentsmask, EF_FULLBRIGHT, EF_NOSHADOW, EF_STARDUST, effects, entity(), FL_ITEM, flags, g_items, generic_pickupevalfunc(), glowmod, gravity, IL_PUSH(), max(), MOVETYPE_NONE, MOVETYPE_TOSS, nextthink, noalign, pflags, PFLAGS_FULLDYNAMIC, scale, set_movetype(), setmodel, setthink, skin, solid, SOLID_TRIGGER, spawnflags, and time.

Referenced by buff_Init_Compat(), buff_SpawnReplacement(), buffs_DelayedInit(), and STATIC_INIT().

425 {
426  if(!cvar("g_buffs")) { delete(this); return; }
427 
428  entity buff = this.buffdef;
429 
430  if(!buff || !buff_Available(buff))
431  buff_NewType(this);
432 
433  this.classname = "item_buff";
434  this.solid = SOLID_TRIGGER;
435  this.flags = FL_ITEM;
436  this.bot_pickup = true;
437  this.bot_pickupevalfunc = generic_pickupevalfunc;
438  this.bot_pickupbasevalue = 1000;
439  IL_PUSH(g_items, this);
440  setthink(this, buff_Think);
441  settouch(this, buff_Touch);
442  setmodel(this, MDL_BUFF);
443  setsize(this, BUFF_MIN, BUFF_MAX);
444  this.reset = buff_Reset;
445  this.nextthink = time + 0.1;
446  this.gravity = 1;
448  this.scale = 1;
449  this.skin = buff.m_skin;
452  setcefc(this, buff_Customize);
453  //this.gravity = 100;
454  this.color = buff.m_color;
455  this.glowmod = buff.m_color;
456  buff_SetCooldown(this, autocvar_g_buffs_cooldown_activate + max(0, game_starttime - time));
457  this.buff_active = !this.buff_activetime;
458  this.pflags = PFLAGS_FULLDYNAMIC;
459  this.dtor = buff_Delete;
460 
461  if(!this.buffs_finished)
462  this.buffs_finished = this.count; // legacy support
463 
464  if(this.spawnflags & 1)
465  this.noalign = true;
466 
467  if(this.noalign)
468  set_movetype(this, MOVETYPE_NONE); // reset by random location
469 
470  if(cvar("g_buffs_random_location") || (this.spawnflags & 64))
471  buff_Respawn(this);
472 }
vector color
float MOVETYPE_NONE
Definition: progsdefs.qc:246
bool buff_active
Definition: sv_buffs.qh:69
skin
Definition: ent_cs.qc:143
float MOVETYPE_TOSS
Definition: progsdefs.qc:252
entity() spawn
const vector BUFF_MIN
Definition: sv_buffs.qh:77
const vector BUFF_MAX
Definition: sv_buffs.qh:78
float bot_pickupbasevalue
Definition: bot.qh:66
float generic_pickupevalfunc(entity player, entity item)
Definition: items.qc:797
string classname
Definition: csprogsdefs.qc:107
float noalign
Definition: items.qh:42
float FL_ITEM
Definition: progsdefs.qc:239
float effects
Definition: csprogsdefs.qc:111
const float EF_NOSHADOW
Definition: csprogsdefs.qc:306
float spawnflags
Definition: progsdefs.qc:191
float buff_activetime
Definition: sv_buffs.qh:70
#define setmodel(this, m)
Definition: model.qh:26
bool buff_Customize(entity this, entity client)
Definition: sv_buffs.qc:399
void buff_Reset(entity this)
Definition: sv_buffs.qc:386
const float EF_FULLBRIGHT
Definition: csprogsdefs.qc:303
void buff_Touch(entity this, entity toucher)
Definition: sv_buffs.qc:187
void buff_SetCooldown(entity this, float cd)
Definition: sv_buffs.qc:138
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
IntrusiveList g_items
Definition: items.qh:126
float bot_pickup
Definition: api.qh:43
float DPCONTENTS_SOLID
float autocvar_g_buffs_cooldown_activate
Definition: sv_buffs.qh:31
float nextthink
Definition: csprogsdefs.qc:121
void buff_Think(entity this)
Definition: sv_buffs.qc:304
float scale
Definition: projectile.qc:14
float gravity
Definition: items.qh:16
const float PFLAGS_FULLDYNAMIC
Definition: csprogsdefs.qc:298
float DPCONTENTS_BODY
float flags
Definition: csprogsdefs.qc:129
float pflags
float count
Definition: powerups.qc:22
const float SOLID_TRIGGER
Definition: csprogsdefs.qc:245
float dphitcontentsmask
#define setthink(e, f)
float buff_Available(entity buff)
Definition: sv_buffs.qc:257
vector glowmod
float time
Definition: csprogsdefs.qc:16
void buff_Respawn(entity this)
Definition: sv_buffs.qc:152
void buff_Delete(entity this)
Definition: sv_buffs.qc:418
void set_movetype(entity this, int mt)
const float EF_STARDUST
Definition: csprogsdefs.qc:308
float solid
Definition: csprogsdefs.qc:99
void buff_NewType(entity ent)
Definition: sv_buffs.qc:270
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Init_Compat()

void buff_Init_Compat ( entity  ent,
entity  replacement 
)

Definition at line 474 of file sv_buffs.qc.

References buff_Init(), NUM_TEAM_1, NUM_TEAM_2, and teamplay.

Referenced by STATIC_INIT().

475 {
476  if (teamplay)
477  {
478  if (ent.spawnflags & 2)
479  ent.team_forced = NUM_TEAM_1;
480  else if (ent.spawnflags & 4)
481  ent.team_forced = NUM_TEAM_2;
482  }
483 
484  ent.buffdef = replacement;
485 
486  buff_Init(ent);
487 }
const int NUM_TEAM_2
Definition: teams.qh:19
void buff_Init(entity this)
Definition: sv_buffs.qc:424
float teamplay
Definition: progsdefs.qc:31
const int NUM_TEAM_1
Definition: teams.qh:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_NewType()

void buff_NewType ( entity  ent)

Definition at line 270 of file sv_buffs.qc.

References buff_Available(), entity(), FOREACH, max(), RandomSelection_AddEnt, RandomSelection_chosen_ent, and RandomSelection_Init().

Referenced by buff_Init(), buff_Reset(), and buff_Think().

271 {
273  FOREACH(StatusEffect, it.instanceOfBuff && buff_Available(it),
274  {
275  // if it's already been chosen, give it a lower priority
276  float myseencount = (it.buff_seencount > 0) ? it.buff_seencount : 1; // no division by zero please!
277  RandomSelection_AddEnt(it, max(0.2, 1 / myseencount), 1);
278  });
280  if(!newbuff)
281  return;
282  newbuff.buff_seencount += 1; // lower chances of seeing this buff again soon
283  ent.buffdef = newbuff;
284 }
ERASEABLE void RandomSelection_Init()
Definition: random.qc:4
entity() spawn
#define RandomSelection_AddEnt(e, weight, priority)
Definition: random.qh:14
entity RandomSelection_chosen_ent
Definition: random.qh:5
float buff_Available(entity buff)
Definition: sv_buffs.qc:257
#define FOREACH(list, cond, body)
Definition: iter.qh:19
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_RemoveAll()

void buff_RemoveAll ( entity  actor,
int  removal_type 
)

Definition at line 286 of file sv_buffs.qc.

References FOREACH.

Referenced by buff_Touch(), GiveBuff(), MUTATOR_HOOKFUNCTION(), and target_init_use().

287 {
288  if(!actor.statuseffects)
289  return;
290  FOREACH(StatusEffect, it.instanceOfBuff,
291  {
292  it.m_remove(it, actor, removal_type);
293  });
294 }
#define FOREACH(list, cond, body)
Definition: iter.qh:19
+ Here is the caller graph for this function:

◆ buff_Reset()

void buff_Reset ( entity  this)

Definition at line 386 of file sv_buffs.qc.

References autocvar_g_buffs_cooldown_activate, autocvar_g_buffs_random_location, autocvar_g_buffs_randomize, autocvar_g_buffs_randomize_teamplay, buff_activetime_updated, buff_NewType(), buff_Respawn(), buff_SetCooldown(), buff_Waypoint_Reset(), NULL, owner, spawnflags, and teamplay.

Referenced by buff_Init().

387 {
389  buff_NewType(this);
390  this.owner = NULL;
392  buff_Waypoint_Reset(this);
393  this.buff_activetime_updated = false;
394 
396  buff_Respawn(this);
397 }
bool buff_activetime_updated
Definition: sv_buffs.qh:71
bool autocvar_g_buffs_random_location
Definition: sv_buffs.qh:26
float spawnflags
Definition: progsdefs.qc:191
entity owner
Definition: main.qh:73
void buff_SetCooldown(entity this, float cd)
Definition: sv_buffs.qc:138
bool autocvar_g_buffs_randomize
Definition: sv_buffs.qh:23
#define NULL
Definition: post.qh:17
void buff_Waypoint_Reset(entity this)
Definition: sv_buffs.qc:379
float autocvar_g_buffs_cooldown_activate
Definition: sv_buffs.qh:31
float teamplay
Definition: progsdefs.qc:31
bool autocvar_g_buffs_randomize_teamplay
Definition: sv_buffs.qh:24
void buff_Respawn(entity this)
Definition: sv_buffs.qc:152
void buff_NewType(entity ent)
Definition: sv_buffs.qc:270
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Respawn()

void buff_Respawn ( entity  this)

Definition at line 152 of file sv_buffs.qc.

References angles, ATTEN_NONE, autocvar_g_buffs_random_lifetime, autocvar_g_buffs_random_location_attempts, buff_waypoint, CENTER_OR_VIEWOFS, CH_TRIGGER, DPCONTENTS_BODY, DPCONTENTS_CORPSE, DPCONTENTS_DONOTENTER, DPCONTENTS_LAVA, DPCONTENTS_PLAYERCLIP, DPCONTENTS_SKY, DPCONTENTS_SLIME, DPCONTENTS_SOLID, entity(), lifetime, makevectors, maxs, mins, MOVE_NOMONSTERS, MoveToRandomMapLocation(), MOVETYPE_TOSS, origin, Q3SURFACEFLAG_SKY, randomvec(), SelectSpawnPoint(), set_movetype(), setorigin(), sound, time, trace_endpos, vector(), velocity, and VOL_BASE.

Referenced by buff_Init(), buff_Reset(), buff_Think(), and buff_Touch().

153 {
154  if(game_stopped) return;
155 
156  vector oldbufforigin = this.origin;
157  this.velocity = '0 0 200';
158 
161  {
162  entity spot = SelectSpawnPoint(this, true);
163  setorigin(this, spot.origin);
164  this.velocity = ((randomvec() * 100) + '0 0 200');
165  this.angles = spot.angles;
166  }
167 
168  tracebox(this.origin, this.mins * 1.5, this.maxs * 1.5, this.origin, MOVE_NOMONSTERS, this);
169 
170  setorigin(this, trace_endpos); // attempt to unstick
171 
173 
174  makevectors(this.angles);
175  this.angles = '0 0 0';
178 
179  Send_Effect(EFFECT_ELECTRO_COMBO, oldbufforigin + ((this.mins + this.maxs) * 0.5), '0 0 0', 1);
180  Send_Effect(EFFECT_ELECTRO_COMBO, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
181 
182  WaypointSprite_Ping(this.buff_waypoint);
183 
184  sound(this, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
185 }
entity SelectSpawnPoint(entity this, bool anypoint)
Definition: spawnpoints.qc:329
entity buff_waypoint
Definition: sv_buffs.qh:72
float autocvar_g_buffs_random_lifetime
Definition: sv_buffs.qh:25
float MOVETYPE_TOSS
Definition: progsdefs.qc:252
entity() spawn
const float ATTEN_NONE
Definition: sound.qh:27
vector maxs
Definition: csprogsdefs.qc:113
float DPCONTENTS_SKY
float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)
Definition: world.qc:1157
float DPCONTENTS_PLAYERCLIP
origin
Definition: ent_cs.qc:114
int autocvar_g_buffs_random_location_attempts
Definition: sv_buffs.qh:27
float lifetime
Definition: powerups.qc:23
float Q3SURFACEFLAG_SKY
const float MOVE_NOMONSTERS
Definition: csprogsdefs.qc:253
vector mins
Definition: csprogsdefs.qc:113
const int CH_TRIGGER
Definition: sound.qh:12
float DPCONTENTS_SOLID
const float VOL_BASE
Definition: sound.qh:36
vector trace_endpos
Definition: csprogsdefs.qc:37
#define CENTER_OR_VIEWOFS(ent)
Definition: utils.qh:28
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float DPCONTENTS_BODY
setorigin(ent, v)
float DPCONTENTS_SLIME
vector angles
Definition: csprogsdefs.qc:104
#define sound(e, c, s, v, a)
Definition: sound.qh:52
float DPCONTENTS_DONOTENTER
float time
Definition: csprogsdefs.qc:16
vector velocity
Definition: csprogsdefs.qc:103
#define makevectors
Definition: post.qh:21
void set_movetype(entity this, int mt)
float DPCONTENTS_CORPSE
float DPCONTENTS_LAVA
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_SetCooldown()

void buff_SetCooldown ( entity  this,
float  cd 
)

Definition at line 138 of file sv_buffs.qc.

References buff_active, buff_activetime, buff_waypoint, buff_Waypoint_Spawn(), max(), and time.

Referenced by buff_Init(), buff_Reset(), and buff_Think().

139 {
140  cd = max(0, cd);
141 
142  if(!this.buff_waypoint)
143  buff_Waypoint_Spawn(this);
144 
145  if(this.buff_waypoint)
146  WaypointSprite_UpdateBuildFinished(this.buff_waypoint, time + cd);
147 
148  this.buff_activetime = cd;
149  this.buff_active = !cd;
150 }
bool buff_active
Definition: sv_buffs.qh:69
entity buff_waypoint
Definition: sv_buffs.qh:72
float buff_activetime
Definition: sv_buffs.qh:70
void buff_Waypoint_Spawn(entity e)
Definition: sv_buffs.qc:127
float time
Definition: csprogsdefs.qc:16
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_SpawnReplacement()

void buff_SpawnReplacement ( entity  ent,
entity  old 
)

Definition at line 489 of file sv_buffs.qc.

References buff_Init(), Item_ShouldKeepPosition(), and setorigin().

Referenced by MUTATOR_HOOKFUNCTION().

490 {
491  setorigin(ent, old.origin);
492  ent.angles = old.angles;
493  ent.noalign = Item_ShouldKeepPosition(old);
494 
495  buff_Init(ent);
496 }
void buff_Init(entity this)
Definition: sv_buffs.qc:424
bool Item_ShouldKeepPosition(entity item)
Returns whether item should keep its position or be dropped to the ground.
Definition: spawning.qc:131
setorigin(ent, v)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Think()

void buff_Think ( entity  this)

Definition at line 304 of file sv_buffs.qc.

References ATTN_NORM, autocvar_g_buffs_cooldown_respawn, autocvar_g_buffs_pickup_anyway, autocvar_g_buffs_random_location, autocvar_g_buffs_randomize, autocvar_g_buffs_randomize_teamplay, autocvar_g_buffs_waypoint_distance, buff_active, buff_activetime, buff_activetime_updated, buff_FirstFromFlags(), BUFF_MAX, BUFF_MIN, buff_NewType(), buff_Respawn(), buff_SetCooldown(), buff_waypoint, buff_Waypoint_Spawn(), CENTER_OR_VIEWOFS, CH_TRIGGER, color, entity(), frametime, glowmod, IS_DEAD, lifetime, max(), nextthink, NULL, oldbuffs, owner, round_handler_IsActive, round_handler_IsRoundStarted, setmodel, skin, sound, spawnflags, team_forced, teamplay, time, and VOL_BASE.

Referenced by buff_Init().

305 {
307  WaypointSprite_Kill(this.buff_waypoint);
308 
309  if(this.buffdef != this.oldbuffs)
310  {
311  entity buff = this.buffdef;
312  this.color = buff.m_color;
313  this.glowmod = buff.m_color;
314  this.skin = buff.m_skin;
315 
316  setmodel(this, MDL_BUFF);
317  setsize(this, BUFF_MIN, BUFF_MAX);
318 
319  if(this.buff_waypoint)
320  {
321  //WaypointSprite_Disown(this.buff_waypoint, 1);
322  WaypointSprite_Kill(this.buff_waypoint);
323  buff_Waypoint_Spawn(this);
324  if(this.buff_activetime)
325  WaypointSprite_UpdateBuildFinished(this.buff_waypoint, time + this.buff_activetime - frametime);
326  }
327 
328  this.oldbuffs = this.buffdef;
329  }
330 
331  if(!game_stopped)
332  if((round_handler_IsActive() && round_handler_IsRoundStarted()) || time >= game_starttime)
333  if(!this.buff_activetime_updated)
334  {
335  buff_SetCooldown(this, this.buff_activetime);
336  this.buff_activetime_updated = true;
337  }
338 
339  if(!this.buff_active && !this.buff_activetime)
340  if(!this.owner || STAT(FROZEN, this.owner) || IS_DEAD(this.owner) || !this.owner.iscreature || this.owner.vehicle
341  || this.pickup_anyway > 0 || (this.pickup_anyway >= 0 && autocvar_g_buffs_pickup_anyway) || this.buffdef != buff_FirstFromFlags(this.owner))
342  {
344  this.owner = NULL;
346  buff_NewType(this);
347 
349  buff_Respawn(this);
350  }
351 
352  if(this.buff_activetime)
353  if(!game_stopped)
354  if((round_handler_IsActive() && round_handler_IsRoundStarted()) || time >= game_starttime)
355  {
356  this.buff_activetime = max(0, this.buff_activetime - frametime);
357 
358  if(!this.buff_activetime)
359  {
360  this.buff_active = true;
361  sound(this, CH_TRIGGER, SND_STRENGTH_RESPAWN, VOL_BASE, ATTN_NORM);
362  Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
363  }
364  }
365 
366  if(this.buff_active)
367  {
368  if(this.team_forced && !this.buff_waypoint)
369  buff_Waypoint_Spawn(this);
370 
371  if(this.lifetime && time >= this.lifetime)
372  buff_Respawn(this);
373  }
374 
375  this.nextthink = time;
376  //this.angles_y = time * 110.1;
377 }
vector color
#define round_handler_IsActive()
bool buff_active
Definition: sv_buffs.qh:69
entity buff_waypoint
Definition: sv_buffs.qh:72
skin
Definition: ent_cs.qc:143
float autocvar_g_buffs_waypoint_distance
Definition: sv_buffs.qh:20
bool buff_activetime_updated
Definition: sv_buffs.qh:71
entity() spawn
const vector BUFF_MIN
Definition: sv_buffs.qh:77
bool autocvar_g_buffs_random_location
Definition: sv_buffs.qh:26
const vector BUFF_MAX
Definition: sv_buffs.qh:78
#define round_handler_IsRoundStarted()
entity buff_FirstFromFlags(entity actor)
Definition: sv_buffs.qc:296
float spawnflags
Definition: progsdefs.qc:191
entity owner
Definition: main.qh:73
float buff_activetime
Definition: sv_buffs.qh:70
#define setmodel(this, m)
Definition: model.qh:26
const float ATTN_NORM
Definition: csprogsdefs.qc:226
void buff_Waypoint_Spawn(entity e)
Definition: sv_buffs.qc:127
void buff_SetCooldown(entity this, float cd)
Definition: sv_buffs.qc:138
float lifetime
Definition: powerups.qc:23
bool autocvar_g_buffs_randomize
Definition: sv_buffs.qh:23
const int CH_TRIGGER
Definition: sound.qh:12
int team_forced
Definition: teamplay.qh:15
#define NULL
Definition: post.qh:17
float frametime
Definition: csprogsdefs.qc:17
const float VOL_BASE
Definition: sound.qh:36
bool autocvar_g_buffs_pickup_anyway
Definition: sv_buffs.qh:21
float teamplay
Definition: progsdefs.qc:31
#define IS_DEAD(s)
Definition: utils.qh:26
float nextthink
Definition: csprogsdefs.qc:121
#define CENTER_OR_VIEWOFS(ent)
Definition: utils.qh:28
bool autocvar_g_buffs_randomize_teamplay
Definition: sv_buffs.qh:24
float autocvar_g_buffs_cooldown_respawn
Definition: sv_buffs.qh:32
#define sound(e, c, s, v, a)
Definition: sound.qh:52
vector glowmod
float time
Definition: csprogsdefs.qc:16
void buff_Respawn(entity this)
Definition: sv_buffs.qc:152
entity oldbuffs
Definition: sv_buffs.qh:73
void buff_NewType(entity ent)
Definition: sv_buffs.qc:270
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Touch()

void buff_Touch ( entity  this,
entity  toucher 
)

Definition at line 187 of file sv_buffs.qc.

References ATTN_NORM, buff_active, buff_FirstFromFlags(), buff_RemoveAll(), buff_Respawn(), CENTER_OR_VIEWOFS, CH_TRIGGER, CS_CVAR, entity(), IS_INDEPENDENT_PLAYER, IS_PLAYER, ITEM_TOUCH_NEEDKILL, lifetime, M_ARGV, max(), min(), MUTATOR_CALLHOOK, owner, sound, STATUSEFFECT_REMOVE_NORMAL, team_forced, time, and VOL_BASE.

Referenced by buff_Init().

188 {
189  if(game_stopped) return;
190 
191  if(ITEM_TOUCH_NEEDKILL())
192  {
193  buff_Respawn(this);
194  return;
195  }
196 
197  if(!this.buff_active)
198  return;
199 
200  if(MUTATOR_CALLHOOK(BuffTouch, this, toucher))
201  return;
202  toucher = M_ARGV(1, entity);
203 
204  if(!IS_PLAYER(toucher))
205  return; // incase mutator changed toucher
206 
207  if((this.team_forced && toucher.team != this.team_forced)
208  || (STAT(FROZEN, toucher))
209  || (toucher.vehicle)
210  || (!this.buffdef) // TODO: error out or maybe reset type if this occurs?
211  || (time < toucher.buff_shield)
212  )
213  {
214  // can't touch this
215  return;
216  }
217 
218  entity heldbuff = buff_FirstFromFlags(toucher);
219  entity thebuff = this.buffdef;
220 
221  if (heldbuff)
222  {
223  if (CS_CVAR(toucher).cvar_cl_buffs_autoreplace && heldbuff != thebuff)
224  {
225  // TODO: lost-gained notification for this case
226  int buffid = heldbuff.m_id;
227  Send_Notification(NOTIF_ONE, toucher, MSG_INFO, INFO_ITEM_BUFF_LOST, toucher.netname, buffid);
228  if(!IS_INDEPENDENT_PLAYER(toucher))
229  Send_Notification(NOTIF_ALL_EXCEPT, toucher, MSG_INFO, INFO_ITEM_BUFF_LOST, toucher.netname, buffid);
230 
231  //sound(toucher, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
232  }
233  else { return; } // do nothing
234  }
235 
236  this.owner = toucher;
237  this.buff_active = false;
238  this.lifetime = 0;
239  Send_Notification(NOTIF_ONE, toucher, MSG_MULTI, ITEM_BUFF_GOT, thebuff.m_id);
240  if(!IS_INDEPENDENT_PLAYER(toucher))
241  Send_Notification(NOTIF_ALL_EXCEPT, toucher, MSG_INFO, INFO_ITEM_BUFF, toucher.netname, thebuff.m_id);
242 
243  Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
244  sound(toucher, CH_TRIGGER, SND_SHIELD_RESPAWN, VOL_BASE, ATTN_NORM);
245  float oldtime = StatusEffects_gettime(thebuff, toucher);
246  float bufftime = ((this.buffs_finished) ? this.buffs_finished : thebuff.m_time(thebuff));
247 
248  buff_RemoveAll(toucher, STATUSEFFECT_REMOVE_NORMAL); // remove previous buffs so that a new one may be added
249  if(bufftime)
250  StatusEffects_apply(thebuff, toucher, min(time + bufftime, max(oldtime, time) + bufftime), 0);
251  else
252  StatusEffects_apply(thebuff, toucher, time + 999, 0); // HACK: zero timer means "infinite"!
253 
254  STAT(LAST_PICKUP, toucher) = time;
255 }
void buff_RemoveAll(entity actor, int removal_type)
Definition: sv_buffs.qc:286
bool buff_active
Definition: sv_buffs.qh:69
#define IS_INDEPENDENT_PLAYER(e)
Definition: client.qh:314
entity() spawn
#define CS_CVAR(this)
Definition: state.qh:51
Effect is being removed by a function, calls regular removal mechanics.
Definition: all.qh:25
entity buff_FirstFromFlags(entity actor)
Definition: sv_buffs.qc:296
entity owner
Definition: main.qh:73
const float ATTN_NORM
Definition: csprogsdefs.qc:226
float lifetime
Definition: powerups.qc:23
const int CH_TRIGGER
Definition: sound.qh:12
int team_forced
Definition: teamplay.qh:15
const float VOL_BASE
Definition: sound.qh:36
#define M_ARGV(x, type)
Definition: events.qh:17
#define CENTER_OR_VIEWOFS(ent)
Definition: utils.qh:28
#define ITEM_TOUCH_NEEDKILL()
Definition: items.qh:129
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
#define sound(e, c, s, v, a)
Definition: sound.qh:52
float time
Definition: csprogsdefs.qc:16
void buff_Respawn(entity this)
Definition: sv_buffs.qc:152
#define IS_PLAYER(v)
Definition: utils.qh:9
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Vengeance_DelayedDamage()

void buff_Vengeance_DelayedDamage ( entity  this)

Definition at line 498 of file sv_buffs.qc.

References Damage(), dmg, DMG_NOWEP, enemy, and owner.

Referenced by MUTATOR_HOOKFUNCTION().

499 {
500  if(this.enemy)
501  Damage(this.enemy, this.owner, this.owner, this.dmg, DEATH_BUFF.m_id, DMG_NOWEP, this.enemy.origin, '0 0 0');
502 
503  delete(this);
504  return;
505 }
float dmg
Definition: platforms.qh:6
#define DMG_NOWEP
Definition: damage.qh:126
entity owner
Definition: main.qh:73
entity enemy
Definition: sv_ctf.qh:143
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition: damage.qc:583
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Waypoint_Reset()

void buff_Waypoint_Reset ( entity  this)

Definition at line 379 of file sv_buffs.qc.

References buff_activetime, buff_waypoint, and buff_Waypoint_Spawn().

Referenced by buff_Reset().

380 {
381  WaypointSprite_Kill(this.buff_waypoint);
382 
383  if(this.buff_activetime) { buff_Waypoint_Spawn(this); }
384 }
entity buff_waypoint
Definition: sv_buffs.qh:72
float buff_activetime
Definition: sv_buffs.qh:70
void buff_Waypoint_Spawn(entity e)
Definition: sv_buffs.qc:127
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Waypoint_Spawn()

void buff_Waypoint_Spawn ( entity  e)

Definition at line 127 of file sv_buffs.qc.

References autocvar_g_buffs_waypoint_distance, buff_waypoint, buff_Waypoint_visible_for_player(), entity(), and NULL.

Referenced by buff_SetCooldown(), buff_Think(), and buff_Waypoint_Reset().

128 {
129  if(autocvar_g_buffs_waypoint_distance <= 0) return;
130 
131  entity buff = e.buffdef;
132  entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, NULL, e.team_forced, e, buff_waypoint, true, RADARICON_Buff);
133  wp.wp_extra = buff.m_id;
134  WaypointSprite_UpdateTeamRadar(e.buff_waypoint, RADARICON_Buff, e.glowmod);
135  e.buff_waypoint.waypointsprite_visible_for_player = buff_Waypoint_visible_for_player;
136 }
entity buff_waypoint
Definition: sv_buffs.qh:72
float autocvar_g_buffs_waypoint_distance
Definition: sv_buffs.qh:20
entity() spawn
#define NULL
Definition: post.qh:17
bool buff_Waypoint_visible_for_player(entity this, entity player, entity view)
Definition: sv_buffs.qc:113
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buff_Waypoint_visible_for_player()

bool buff_Waypoint_visible_for_player ( entity  this,
entity  player,
entity  view 
)

Definition at line 113 of file sv_buffs.qc.

References buff_FirstFromFlags(), CS_CVAR, entity(), and owner.

Referenced by buff_Waypoint_Spawn().

114 {
115  if(!this.owner.buff_active && !this.owner.buff_activetime || !this.owner.buffdef)
116  return false;
117 
118  entity heldbuff = buff_FirstFromFlags(view); // TODO: cache this information so it isn't performing a loop every frame
119  if (heldbuff)
120  {
121  return CS_CVAR(view).cvar_cl_buffs_autoreplace == false || heldbuff != this.owner.buffdef;
122  }
123 
124  return WaypointSprite_visible_for_player(this, player, view);
125 }
entity() spawn
#define CS_CVAR(this)
Definition: state.qh:51
entity buff_FirstFromFlags(entity actor)
Definition: sv_buffs.qc:296
entity owner
Definition: main.qh:73
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buffs_BuffModel_Customize()

bool buffs_BuffModel_Customize ( entity  this,
entity  client 
)

Definition at line 8 of file sv_buffs.qc.

References alpha, buff_FirstFromFlags(), DIFF_TEAM, EF_FULLBRIGHT, EF_LOWPRECISION, effects, entity(), MUTATOR_CALLHOOK, and owner.

Referenced by buffs_BuffModel_Spawn().

9 {
10  entity player = WaypointSprite_getviewentity(client);
11  entity myowner = this.owner;
12  entity heldbuff = buff_FirstFromFlags(myowner);
13 
14  if(!heldbuff)
15  return false;
16 
17  if(myowner.alpha <= 0.5 && DIFF_TEAM(player, myowner) && myowner.alpha != 0)
18  return false;
19 
20  if(MUTATOR_CALLHOOK(BuffModel_Customize, this, player))
21  return false;
22 
23  if(player == myowner)
24  {
25  // somewhat hide the model, but keep the glow
26  this.effects = 0;
27  this.alpha = -1;
28  }
29  else
30  {
32  this.alpha = myowner.alpha;
33  }
34  return true;
35 }
float alpha
Definition: items.qc:14
entity() spawn
entity buff_FirstFromFlags(entity actor)
Definition: sv_buffs.qc:296
#define DIFF_TEAM(a, b)
Definition: teams.qh:240
float effects
Definition: csprogsdefs.qc:111
entity owner
Definition: main.qh:73
const float EF_FULLBRIGHT
Definition: csprogsdefs.qc:303
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
float EF_LOWPRECISION
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buffs_BuffModel_Remove()

void buffs_BuffModel_Remove ( entity  player)

Definition at line 68 of file sv_buffs.qc.

References NULL.

Referenced by buffs_RemovePlayer().

69 {
70  if(player.buff_model)
71  delete(player.buff_model);
72  player.buff_model = NULL;
73 }
#define NULL
Definition: post.qh:17
+ Here is the caller graph for this function:

◆ buffs_BuffModel_Spawn()

void buffs_BuffModel_Spawn ( entity  player)

Definition at line 75 of file sv_buffs.qc.

References buff_model, buffs_BuffModel_Customize(), buffs_BuffModel_Think(), PFLAGS_FULLDYNAMIC, setmodel, setorigin(), setthink, and time.

Referenced by buffs_BuffModel_Update().

76 {
77  player.buff_model = new(buff_model);
78  setmodel(player.buff_model, MDL_BUFF);
79  setsize(player.buff_model, '0 0 -40', '0 0 40');
80  setattachment(player.buff_model, player, "");
81  setorigin(player.buff_model, '0 0 1' * (player.buff_model.maxs.z * 1));
82  player.buff_model.owner = player;
83  player.buff_model.exteriormodeltoclient = player;
84  player.buff_model.scale = 0.7;
85  player.buff_model.pflags = PFLAGS_FULLDYNAMIC;
86  player.buff_model.light_lev = 200;
87  setthink(player.buff_model, buffs_BuffModel_Think);
88  player.buff_model.nextthink = time;
89  setcefc(player.buff_model, buffs_BuffModel_Customize);
90 }
entity buff_model
Definition: sv_buffs.qh:75
#define setmodel(this, m)
Definition: model.qh:26
const float PFLAGS_FULLDYNAMIC
Definition: csprogsdefs.qc:298
void buffs_BuffModel_Think(entity this)
Definition: sv_buffs.qc:37
bool buffs_BuffModel_Customize(entity this, entity client)
Definition: sv_buffs.qc:8
setorigin(ent, v)
#define setthink(e, f)
float time
Definition: csprogsdefs.qc:16
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buffs_BuffModel_Think()

void buffs_BuffModel_Think ( entity  this)

Definition at line 37 of file sv_buffs.qc.

References alpha, buff_FirstFromFlags(), color, EF_LOWPRECISION, EF_NODRAW, effects, entity(), glowmod, nextthink, NULL, owner, skin, and time.

Referenced by buffs_BuffModel_Spawn().

38 {
39  this.nextthink = time;
40  entity player = this.owner;
41  if(player.alpha < 0 || player.buff_model != this)
42  {
43  if(player) // remnant from ChatBubbleThink, same question... WHY?!
44  player.buff_model = NULL;
45  delete(this);
46  return;
47  }
48 
49  entity heldbuff = buff_FirstFromFlags(player);
50 
51  if(!heldbuff)
52  {
53  this.effects = EF_NODRAW;
54  return;
55  }
56 
57  this.color = heldbuff.m_color;
58  this.glowmod = heldbuff.m_color;
59  this.skin = heldbuff.m_skin;
60 
61  this.effects = player.effects;
62  this.effects |= EF_LOWPRECISION;
63  this.effects = this.effects & EFMASK_CHEAP; // eat performance
64 
65  this.alpha = player.alpha;
66 }
vector color
float alpha
Definition: items.qc:14
skin
Definition: ent_cs.qc:143
entity() spawn
entity buff_FirstFromFlags(entity actor)
Definition: sv_buffs.qc:296
float effects
Definition: csprogsdefs.qc:111
entity owner
Definition: main.qh:73
const float EF_NODRAW
Definition: csprogsdefs.qc:305
#define NULL
Definition: post.qh:17
float nextthink
Definition: csprogsdefs.qc:121
vector glowmod
float time
Definition: csprogsdefs.qc:16
float EF_LOWPRECISION
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buffs_BuffModel_Update()

void buffs_BuffModel_Update ( entity  this)

Definition at line 92 of file sv_buffs.qc.

References alpha, buff_model, and buffs_BuffModel_Spawn().

Referenced by MUTATOR_HOOKFUNCTION().

93 {
94  if (this.alpha < 0)
95  return;
96  // spawn a buff model entity if needed
97  if (!this.buff_model)
99 }
float alpha
Definition: items.qc:14
entity buff_model
Definition: sv_buffs.qh:75
void buffs_BuffModel_Spawn(entity player)
Definition: sv_buffs.qc:75
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buffs_DelayedInit()

void buffs_DelayedInit ( entity  this)

Definition at line 984 of file sv_buffs.qc.

References autocvar_g_buffs_spawn_count, buff_Init(), classname, entity(), find(), NULL, randomvec(), and spawn().

Referenced by buffs_Initialize().

985 {
987  if(find(NULL, classname, "item_buff") == NULL)
988  {
989  float i;
990  for(i = 0; i < autocvar_g_buffs_spawn_count; ++i)
991  {
992  entity e = spawn();
993  e.spawnflags |= 64; // always randomize
994  e.velocity = randomvec() * 250; // this gets reset anyway if random location works
995  buff_Init(e);
996  }
997  }
998 }
int autocvar_g_buffs_spawn_count
Definition: sv_buffs.qh:28
entity() spawn
string classname
Definition: csprogsdefs.qc:107
void buff_Init(entity this)
Definition: sv_buffs.qc:424
#define NULL
Definition: post.qh:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buffs_Initialize()

void buffs_Initialize ( )

Definition at line 1000 of file sv_buffs.qc.

References autocvar_g_buffs_spawn_count, buffs_DelayedInit(), InitializeEntity(), and NULL.

Referenced by REGISTER_MUTATOR().

1001 {
1002  // if buffs are above 0, allow random spawning
1003  if(autocvar_g_buffs > 0 && autocvar_g_buffs_spawn_count > 0)
1004  InitializeEntity(NULL, buffs_DelayedInit, INITPRIO_FINDTARGET);
1005 }
int autocvar_g_buffs_spawn_count
Definition: sv_buffs.qh:28
void buffs_DelayedInit(entity this)
Definition: sv_buffs.qc:984
#define NULL
Definition: post.qh:17
void InitializeEntity(entity e, void(entity this) func, int order)
Definition: world.qc:2146
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buffs_RemovePlayer()

bool buffs_RemovePlayer ( entity  player)

Definition at line 890 of file sv_buffs.qc.

References buffs_BuffModel_Remove().

Referenced by MUTATOR_HOOKFUNCTION().

891 {
892  buffs_BuffModel_Remove(player);
893 
894  return false;
895 }
void buffs_BuffModel_Remove(entity player)
Definition: sv_buffs.qc:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MUTATOR_HOOKFUNCTION() [1/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
Damage_Calculate   
)

Definition at line 656 of file sv_buffs.qc.

References autocvar_g_buffs_bash_force, autocvar_g_buffs_bash_force_self, autocvar_g_buffs_disability_slowtime, autocvar_g_buffs_inferno_burntime_factor, autocvar_g_buffs_inferno_burntime_min_time, autocvar_g_buffs_inferno_burntime_target_damage, autocvar_g_buffs_inferno_burntime_target_time, autocvar_g_buffs_inferno_damagemultiplier, autocvar_g_buffs_luck_chance, autocvar_g_buffs_luck_damagemultiplier, autocvar_g_buffs_medic_survive_chance, autocvar_g_buffs_medic_survive_health, autocvar_g_buffs_resistance_blockpercent, autocvar_g_buffs_vengeance_damage_multiplier, bound(), buff_Inferno_CalculateTime(), buff_Vengeance_DelayedDamage(), entity(), Fire_AddDamage(), GetResource(), ITEM_DAMAGE_NEEDKILL, M_ARGV, max(), new_pure, random(), RES_HEALTH, setthink, time, and vector().

657 {
658  entity frag_attacker = M_ARGV(1, entity);
659  entity frag_target = M_ARGV(2, entity);
660  float frag_deathtype = M_ARGV(3, float);
661  float frag_damage = M_ARGV(4, float);
662  vector frag_force = M_ARGV(6, vector);
663 
664  if(frag_deathtype == DEATH_BUFF.m_id) { return; }
665 
666  if(StatusEffects_active(BUFF_RESISTANCE, frag_target))
667  {
668  float reduced = frag_damage * autocvar_g_buffs_resistance_blockpercent;
669  frag_damage = bound(0, frag_damage - reduced, frag_damage);
670  }
671 
672  if(StatusEffects_active(BUFF_MEDIC, frag_target))
673  if((GetResource(frag_target, RES_HEALTH) - frag_damage) <= 0)
674  if(!ITEM_DAMAGE_NEEDKILL(frag_deathtype))
675  if(frag_attacker)
677  frag_damage = max(5, GetResource(frag_target, RES_HEALTH) - autocvar_g_buffs_medic_survive_health);
678 
679  if(StatusEffects_active(BUFF_JUMP, frag_target))
680  if(frag_deathtype == DEATH_FALL.m_id)
681  frag_damage = 0;
682 
683  if(StatusEffects_active(BUFF_VENGEANCE, frag_target))
684  if(frag_attacker)
685  if(frag_attacker != frag_target)
686  if(!ITEM_DAMAGE_NEEDKILL(frag_deathtype))
687  {
688  entity dmgent = new_pure(dmgent);
689 
690  dmgent.dmg = frag_damage * autocvar_g_buffs_vengeance_damage_multiplier;
691  dmgent.enemy = frag_attacker;
692  dmgent.owner = frag_target;
694  dmgent.nextthink = time + 0.1;
695  }
696 
697  if(StatusEffects_active(BUFF_BASH, frag_target))
698  if(frag_attacker != frag_target)
699  frag_force = '0 0 0';
700 
701  if(StatusEffects_active(BUFF_BASH, frag_attacker))
702  if(frag_force)
703  {
704  if(frag_attacker == frag_target)
705  frag_force *= autocvar_g_buffs_bash_force_self;
706  else
707  frag_force *= autocvar_g_buffs_bash_force;
708  }
709 
710  if(StatusEffects_active(BUFF_DISABILITY, frag_attacker))
711  if(frag_target != frag_attacker)
712  StatusEffects_apply(STATUSEFFECT_Disabled, frag_target, time + autocvar_g_buffs_disability_slowtime, 0);
713 
714  if(StatusEffects_active(BUFF_INFERNO, frag_target))
715  {
716  if(frag_deathtype == DEATH_FIRE.m_id)
717  frag_damage = 0;
718  if(frag_deathtype == DEATH_LAVA.m_id)
719  frag_damage *= 0.5; // TODO: cvarize?
720  }
721 
722  if(StatusEffects_active(BUFF_LUCK, frag_attacker))
723  if(frag_attacker != frag_target)
727 
728  if(StatusEffects_active(BUFF_INFERNO, frag_attacker))
729  if(frag_target != frag_attacker) {
730  float btime = buff_Inferno_CalculateTime(
731  frag_damage,
732  0,
737  );
738  Fire_AddDamage(frag_target, frag_attacker, (frag_damage * autocvar_g_buffs_inferno_damagemultiplier), btime, DEATH_BUFF.m_id);
739  }
740 
741  M_ARGV(4, float) = frag_damage;
742  M_ARGV(6, vector) = frag_force;
743 }
float autocvar_g_buffs_medic_survive_health
Definition: sv_buffs.qh:35
float autocvar_g_buffs_inferno_burntime_factor
Definition: sv_buffs.qh:48
float autocvar_g_buffs_disability_slowtime
Definition: sv_buffs.qh:42
float autocvar_g_buffs_inferno_damagemultiplier
Definition: sv_buffs.qh:52
float buff_Inferno_CalculateTime(float damg, float offset_x, float offset_y, float intersect_x, float intersect_y, float base)
Definition: sv_buffs.qc:507
entity() spawn
float autocvar_g_buffs_inferno_burntime_target_time
Definition: sv_buffs.qh:51
float autocvar_g_buffs_luck_damagemultiplier
Definition: sv_buffs.qh:57
float autocvar_g_buffs_bash_force
Definition: sv_buffs.qh:40
float autocvar_g_buffs_medic_survive_chance
Definition: sv_buffs.qh:34
float autocvar_g_buffs_bash_force_self
Definition: sv_buffs.qh:41
RES_HEALTH
Definition: ent_cs.qc:126
float autocvar_g_buffs_vengeance_damage_multiplier
Definition: sv_buffs.qh:39
float autocvar_g_buffs_luck_chance
Definition: sv_buffs.qh:56
#define M_ARGV(x, type)
Definition: events.qh:17
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define ITEM_DAMAGE_NEEDKILL(dt)
Definition: items.qh:130
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
Definition: cl_resources.qc:10
float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
Definition: damage.qc:1077
float autocvar_g_buffs_inferno_burntime_min_time
Definition: sv_buffs.qh:49
float autocvar_g_buffs_resistance_blockpercent
Definition: sv_buffs.qh:33
#define new_pure(class)
purely logical entities (.origin doesn&#39;t work)
Definition: oo.qh:62
#define setthink(e, f)
void buff_Vengeance_DelayedDamage(entity this)
Definition: sv_buffs.qc:498
float time
Definition: csprogsdefs.qc:16
float autocvar_g_buffs_inferno_burntime_target_damage
Definition: sv_buffs.qh:50
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [2/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
PlayerDamage_SplitHealthArmor   
)

Definition at line 745 of file sv_buffs.qc.

References autocvar_g_buffs_vampire_damage_steal, bound(), entity(), GetResource(), GiveResource(), IS_DEAD, IS_PLAYER, M_ARGV, and RES_HEALTH.

746 {
747  // NOTE: vampire PlayerDamage_SplitHealthArmor code is similar
748  entity frag_attacker = M_ARGV(1, entity);
749  entity frag_target = M_ARGV(2, entity);
750  if(!StatusEffects_active(BUFF_VAMPIRE, frag_attacker))
751  return;
752  float health_take = bound(0, M_ARGV(4, float), GetResource(frag_target, RES_HEALTH));
753 
754  if (!StatusEffects_active(STATUSEFFECT_SpawnShield, frag_target) && frag_target != frag_attacker
755  && IS_PLAYER(frag_attacker) && !IS_DEAD(frag_target) && !STAT(FROZEN, frag_target))
756  {
757  GiveResource(frag_attacker, RES_HEALTH, autocvar_g_buffs_vampire_damage_steal * health_take);
758  }
759 }
entity() spawn
RES_HEALTH
Definition: ent_cs.qc:126
#define M_ARGV(x, type)
Definition: events.qh:17
#define IS_DEAD(s)
Definition: utils.qh:26
void GiveResource(entity receiver, Resource res_type, float amount)
Gives an entity some resource.
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
Definition: cl_resources.qc:10
#define IS_PLAYER(v)
Definition: utils.qh:9
float autocvar_g_buffs_vampire_damage_steal
Definition: sv_buffs.qh:46
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [3/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
PlayerPhysics_UpdateStats   
)

Definition at line 761 of file sv_buffs.qc.

References autocvar_g_buffs_disability_speed, entity(), and M_ARGV.

762 {
763  entity player = M_ARGV(0, entity);
764  // these automatically reset, no need to worry
765 
766  if(StatusEffects_active(STATUSEFFECT_Disabled, player))
767  STAT(MOVEVARS_HIGHSPEED, player) *= autocvar_g_buffs_disability_speed;
768 }
entity() spawn
float autocvar_g_buffs_disability_speed
Definition: sv_buffs.qh:43
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [4/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
PlayerPhysics   
)

Definition at line 770 of file sv_buffs.qc.

References autocvar_g_buffs_jump_height, entity(), and M_ARGV.

771 {
772  entity player = M_ARGV(0, entity);
773  // these automatically reset, no need to worry
774 
775  if(StatusEffects_active(BUFF_JUMP, player))
776  STAT(MOVEVARS_JUMPVELOCITY, player) = autocvar_g_buffs_jump_height;
777 }
entity() spawn
float autocvar_g_buffs_jump_height
Definition: sv_buffs.qh:47
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [5/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
MonsterMove   
)

Definition at line 779 of file sv_buffs.qc.

References autocvar_g_buffs_disability_speed, entity(), and M_ARGV.

780 {
781  entity mon = M_ARGV(0, entity);
782 
783  if(StatusEffects_active(STATUSEFFECT_Disabled, mon))
784  {
785  M_ARGV(1, float) *= autocvar_g_buffs_disability_speed; // run speed
786  M_ARGV(2, float) *= autocvar_g_buffs_disability_speed; // walk speed
787  }
788 }
entity() spawn
float autocvar_g_buffs_disability_speed
Definition: sv_buffs.qh:43
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [6/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
PlayerUseKey  ,
CBC_ORDER_FIRST   
)

Definition at line 790 of file sv_buffs.qc.

References ATTN_NORM, autocvar_g_buffs_drop, autocvar_g_buffs_pickup_delay, buff_FirstFromFlags(), buff_RemoveAll(), CH_TRIGGER, entity(), IS_INDEPENDENT_PLAYER, M_ARGV, max(), MUTATOR_RETURNVALUE, sound, STATUSEFFECT_REMOVE_NORMAL, time, and VOL_BASE.

791 {
792  if(MUTATOR_RETURNVALUE || game_stopped || !autocvar_g_buffs_drop) return;
793 
794  entity player = M_ARGV(0, entity);
795 
796  entity heldbuff = buff_FirstFromFlags(player);
797  if(heldbuff)
798  {
799  int buffid = heldbuff.m_id;
800  Send_Notification(NOTIF_ONE, player, MSG_MULTI, ITEM_BUFF_DROP, buffid);
801  if(!IS_INDEPENDENT_PLAYER(player))
802  Send_Notification(NOTIF_ALL_EXCEPT, player, MSG_INFO, INFO_ITEM_BUFF_LOST, player.netname, buffid);
803 
805  player.buff_shield = time + max(0, autocvar_g_buffs_pickup_delay);
806  sound(player, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
807  return true;
808  }
809 }
void buff_RemoveAll(entity actor, int removal_type)
Definition: sv_buffs.qc:286
#define IS_INDEPENDENT_PLAYER(e)
Definition: client.qh:314
bool autocvar_g_buffs_drop
Definition: sv_buffs.qh:30
entity() spawn
Effect is being removed by a function, calls regular removal mechanics.
Definition: all.qh:25
entity buff_FirstFromFlags(entity actor)
Definition: sv_buffs.qc:296
const float ATTN_NORM
Definition: csprogsdefs.qc:226
float autocvar_g_buffs_pickup_delay
Definition: sv_buffs.qh:22
const int CH_TRIGGER
Definition: sound.qh:12
const float VOL_BASE
Definition: sound.qh:36
#define MUTATOR_RETURNVALUE
Definition: base.qh:303
#define M_ARGV(x, type)
Definition: events.qh:17
#define sound(e, c, s, v, a)
Definition: sound.qh:52
float time
Definition: csprogsdefs.qc:16
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [7/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
ForbidThrowCurrentWeapon   
)

Definition at line 811 of file sv_buffs.qc.

References ATTEN_NORM, autocvar_g_buffs_swapper_range, autocvar_g_maxpushtime, bot_aim_reset(), buff_RemoveAll(), CH_TRIGGER, DIFF_TEAM, Drop_Special_Items(), entity(), FOREACH_CLIENT, IS_BOT_CLIENT, IS_DEAD, IS_PLAYER, M_ARGV, MUTATOR_CALLHOOK, MUTATOR_RETURNVALUE, NULL, PHYS_INPUT_BUTTON_CHAT, setorigin(), sound, sqrt(), STATUSEFFECT_REMOVE_NORMAL, time, vector(), vlen2, and VOL_BASE.

812 {
813  if(MUTATOR_RETURNVALUE || game_stopped) return;
814  entity player = M_ARGV(0, entity);
815 
816  if(StatusEffects_active(BUFF_SWAPPER, player))
817  {
818  float best_distance = autocvar_g_buffs_swapper_range;
819  entity closest = NULL;
821  if(!IS_DEAD(it) && !STAT(FROZEN, it) && !it.vehicle)
822  if(DIFF_TEAM(it, player))
823  {
824  float test = vlen2(player.origin - it.origin);
825  if(test <= best_distance * best_distance)
826  {
827  best_distance = sqrt(test);
828  closest = it;
829  }
830  }
831  });
832 
833  if(closest)
834  {
835  vector my_org, my_vel, my_ang, their_org, their_vel, their_ang;
836 
837  my_org = player.origin;
838  my_vel = player.velocity;
839  my_ang = player.angles;
840  their_org = closest.origin;
841  their_vel = closest.velocity;
842  their_ang = closest.angles;
843 
844  Drop_Special_Items(closest);
845 
846  MUTATOR_CALLHOOK(PortalTeleport, player); // initiate flag dropper
847 
848  setorigin(player, their_org);
849  setorigin(closest, my_org);
850 
851  closest.velocity = my_vel;
852  closest.angles = my_ang;
853  if (IS_BOT_CLIENT(closest))
854  {
855  closest.v_angle = closest.angles;
856  bot_aim_reset(closest);
857  }
858  closest.fixangle = true;
859  closest.oldorigin = my_org;
860  closest.oldvelocity = my_vel;
861  player.velocity = their_vel;
862  player.angles = their_ang;
863  if (IS_BOT_CLIENT(player))
864  {
865  player.v_angle = player.angles;
866  bot_aim_reset(player);
867  }
868  player.fixangle = true;
869  player.oldorigin = their_org;
870  player.oldvelocity = their_vel;
871 
872  // set pusher so player gets the kill if they fall into void
873  closest.pusher = player;
874  closest.pushltime = time + autocvar_g_maxpushtime;
875  closest.istypefrag = PHYS_INPUT_BUTTON_CHAT(closest);
876 
877  Send_Effect(EFFECT_ELECTRO_COMBO, their_org, '0 0 0', 1);
878  Send_Effect(EFFECT_ELECTRO_COMBO, my_org, '0 0 0', 1);
879 
880  sound(player, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NORM);
881  sound(closest, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NORM);
882 
883  // TODO: add a counter to handle how many times one can teleport, and a delay to prevent spam
885  return true;
886  }
887  }
888 }
void buff_RemoveAll(entity actor, int removal_type)
Definition: sv_buffs.qc:286
#define PHYS_INPUT_BUTTON_CHAT(s)
Definition: player.qh:155
float autocvar_g_buffs_swapper_range
Definition: sv_buffs.qh:53
void bot_aim_reset(entity this)
Definition: aim.qc:170
entity() spawn
#define FOREACH_CLIENT(cond, body)
Definition: utils.qh:49
Effect is being removed by a function, calls regular removal mechanics.
Definition: all.qh:25
#define DIFF_TEAM(a, b)
Definition: teams.qh:240
float autocvar_g_maxpushtime
Definition: damage.qh:17
#define vlen2(v)
Definition: vector.qh:4
const int CH_TRIGGER
Definition: sound.qh:12
#define NULL
Definition: post.qh:17
const float VOL_BASE
Definition: sound.qh:36
#define MUTATOR_RETURNVALUE
Definition: base.qh:303
#define M_ARGV(x, type)
Definition: events.qh:17
#define IS_DEAD(s)
Definition: utils.qh:26
const float ATTEN_NORM
Definition: sound.qh:30
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
Definition: utils.qh:15
void Drop_Special_Items(entity player)
Definition: player.qc:42
setorigin(ent, v)
#define sound(e, c, s, v, a)
Definition: sound.qh:52
float time
Definition: csprogsdefs.qc:16
#define IS_PLAYER(v)
Definition: utils.qh:9
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [8/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
MakePlayerObserver   
)

Definition at line 896 of file sv_buffs.qc.

References buffs_RemovePlayer(), entity(), and M_ARGV.

896 { entity player = M_ARGV(0, entity); return buffs_RemovePlayer(player); }
entity() spawn
bool buffs_RemovePlayer(entity player)
Definition: sv_buffs.qc:890
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [9/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
ClientDisconnect   
)

Definition at line 897 of file sv_buffs.qc.

References buffs_RemovePlayer(), entity(), and M_ARGV.

897 { entity player = M_ARGV(0, entity); return buffs_RemovePlayer(player); }
entity() spawn
bool buffs_RemovePlayer(entity player)
Definition: sv_buffs.qc:890
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [10/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
FilterItem   
)

Definition at line 899 of file sv_buffs.qc.

References autocvar_g_buffs_replace_powerups, buff_SpawnReplacement(), entity(), M_ARGV, and spawn().

900 {
901  if(autocvar_g_buffs < 0)
902  return false; // no auto replacing of entities in this mode
903 
904  entity item = M_ARGV(0, entity);
905 
906  if(autocvar_g_buffs_replace_powerups && item.itemdef.instanceOfPowerup)
907  {
908  entity e = spawn();
909  buff_SpawnReplacement(e, item);
910  return true;
911  }
912 
913  return false;
914 }
bool autocvar_g_buffs_replace_powerups
Definition: sv_buffs.qh:29
entity() spawn
void buff_SpawnReplacement(entity ent, entity old)
Definition: sv_buffs.qc:489
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [11/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
WeaponRateFactor   
)

Definition at line 916 of file sv_buffs.qc.

References autocvar_g_buffs_disability_rate, entity(), and M_ARGV.

917 {
918  entity player = M_ARGV(1, entity);
919 
920  if(StatusEffects_active(STATUSEFFECT_Disabled, player))
922 }
entity() spawn
float autocvar_g_buffs_disability_rate
Definition: sv_buffs.qh:44
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [12/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
WeaponSpeedFactor   
)

Definition at line 924 of file sv_buffs.qc.

References autocvar_g_buffs_disability_weaponspeed, entity(), and M_ARGV.

925 {
926  entity player = M_ARGV(1, entity);
927 
928  if(StatusEffects_active(STATUSEFFECT_Disabled, player))
930 }
entity() spawn
float autocvar_g_buffs_disability_weaponspeed
Definition: sv_buffs.qh:45
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [13/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
Freeze   
)

Definition at line 932 of file sv_buffs.qc.

References buff_RemoveAll(), entity(), M_ARGV, and STATUSEFFECT_REMOVE_NORMAL.

933 {
934  entity targ = M_ARGV(0, entity);
936 }
void buff_RemoveAll(entity actor, int removal_type)
Definition: sv_buffs.qc:286
entity() spawn
Effect is being removed by a function, calls regular removal mechanics.
Definition: all.qh:25
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [14/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
PlayerPreThink   
)

Definition at line 938 of file sv_buffs.qc.

References buffs_BuffModel_Update(), entity(), IS_DEAD, IS_PLAYER, M_ARGV, and PHYS_INPUT_BUTTON_CROUCH.

939 {
940  entity player = M_ARGV(0, entity);
941 
942  if(game_stopped || IS_DEAD(player) || !IS_PLAYER(player)) return;
943 
944  // NOTE: this is kept here to ensure crouches are picked up each player movement frame
945  if(StatusEffects_active(BUFF_FLIGHT, player))
946  {
947  if(!PHYS_INPUT_BUTTON_CROUCH(player))
948  player.buff_flight_crouchheld = false;
949  else if(!player.buff_flight_crouchheld)
950  {
951  player.buff_flight_crouchheld = true;
952  player.gravity *= -1;
953  }
954  }
955 
956  if(IS_PLAYER(player))
957  buffs_BuffModel_Update(player);
958 }
#define PHYS_INPUT_BUTTON_CROUCH(s)
Definition: player.qh:150
entity() spawn
#define M_ARGV(x, type)
Definition: events.qh:17
#define IS_DEAD(s)
Definition: utils.qh:26
#define IS_PLAYER(v)
Definition: utils.qh:9
void buffs_BuffModel_Update(entity this)
Definition: sv_buffs.qc:92
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [15/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
PlayerRegen   
)

Definition at line 960 of file sv_buffs.qc.

References autocvar_g_buffs_medic_max, autocvar_g_buffs_medic_regen, autocvar_g_buffs_medic_rot, entity(), and M_ARGV.

961 {
962  entity player = M_ARGV(0, entity);
963 
964  if(StatusEffects_active(BUFF_MEDIC, player))
965  {
966  M_ARGV(3, float) = autocvar_g_buffs_medic_rot; // rot_mod
967  M_ARGV(4, float) = M_ARGV(1, float) = autocvar_g_buffs_medic_max; // limit_mod = max_mod
968  M_ARGV(2, float) = autocvar_g_buffs_medic_regen; // regen_mod
969  }
970 }
float autocvar_g_buffs_medic_rot
Definition: sv_buffs.qh:36
entity() spawn
float autocvar_g_buffs_medic_regen
Definition: sv_buffs.qh:38
float autocvar_g_buffs_medic_max
Definition: sv_buffs.qh:37
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [16/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
BuildMutatorsString   
)

Definition at line 972 of file sv_buffs.qc.

References M_ARGV, and strcat().

973 {
974  if(autocvar_g_buffs > 0) // only report as a mutator if they're enabled
975  M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Buffs");
976 }
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

◆ MUTATOR_HOOKFUNCTION() [17/17]

MUTATOR_HOOKFUNCTION ( buffs  ,
BuildMutatorsPrettyString   
)

Definition at line 978 of file sv_buffs.qc.

References M_ARGV, and strcat().

979 {
980  if(autocvar_g_buffs > 0)
981  M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Buffs");
982 }
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
#define M_ARGV(x, type)
Definition: events.qh:17
+ Here is the call graph for this function:

Variable Documentation

◆ buff_seencount

int buff_seencount

Definition at line 268 of file sv_buffs.qc.