Xonotic
sv_buffs.qh File Reference
#include <common/mutators/base.qh>
#include "buffs.qh"
+ Include dependency graph for sv_buffs.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 AUTOCVAR (g_buffs, int, -1, "Enable buffs, -1: enabled but no auto location or replacing powerups, 1: enabled and can replace them")
 
float buff_Available (entity buff)
 
entity buff_FirstFromFlags (entity actor)
 
void buff_RemoveAll (entity actor, int removal_type)
 
void buffs_Initialize ()
 
 REGISTER_MUTATOR (buffs, autocvar_g_buffs)
 

Variables

float autocvar_g_buffs_bash_force
 
float autocvar_g_buffs_bash_force_self
 
float autocvar_g_buffs_cooldown_activate
 
float autocvar_g_buffs_cooldown_respawn
 
float autocvar_g_buffs_disability_rate
 
float autocvar_g_buffs_disability_slowtime
 
float autocvar_g_buffs_disability_speed
 
float autocvar_g_buffs_disability_weaponspeed
 
bool autocvar_g_buffs_drop = false
 
bool autocvar_g_buffs_effects
 
float autocvar_g_buffs_inferno_burntime_factor
 
float autocvar_g_buffs_inferno_burntime_min_time
 
float autocvar_g_buffs_inferno_burntime_target_damage
 
float autocvar_g_buffs_inferno_burntime_target_time
 
float autocvar_g_buffs_inferno_damagemultiplier
 
float autocvar_g_buffs_jump_height
 
float autocvar_g_buffs_luck_chance = 0.15
 
float autocvar_g_buffs_luck_damagemultiplier = 3
 
float autocvar_g_buffs_magnet_range_buff = 200
 
float autocvar_g_buffs_magnet_range_item
 
float autocvar_g_buffs_medic_max
 
float autocvar_g_buffs_medic_regen
 
float autocvar_g_buffs_medic_rot
 
float autocvar_g_buffs_medic_survive_chance
 
float autocvar_g_buffs_medic_survive_health
 
bool autocvar_g_buffs_pickup_anyway = false
 
float autocvar_g_buffs_pickup_delay = 0.7
 
float autocvar_g_buffs_random_lifetime
 
bool autocvar_g_buffs_random_location
 
int autocvar_g_buffs_random_location_attempts
 
bool autocvar_g_buffs_randomize
 
bool autocvar_g_buffs_randomize_teamplay = true
 
bool autocvar_g_buffs_replace_powerups
 
float autocvar_g_buffs_resistance_blockpercent
 
int autocvar_g_buffs_spawn_count
 
float autocvar_g_buffs_swapper_range
 
float autocvar_g_buffs_vampire_damage_steal
 
float autocvar_g_buffs_vengeance_damage_multiplier
 
float autocvar_g_buffs_waypoint_distance
 
bool buff_active
 
float buff_activetime
 
bool buff_activetime_updated
 
int buff_ammo_prev_clipload
 
float buff_ammo_prev_infitems
 
float buff_effect_delay
 
bool buff_flight_crouchheld
 
float buff_flight_oldgravity
 
const vector BUFF_MAX = ('16 16 60')
 
const vector BUFF_MIN = ('-16 -16 0')
 
entity buff_model
 
float buff_shield
 
entity buff_waypoint
 
entity oldbuffs
 

Function Documentation

◆ AUTOCVAR()

AUTOCVAR ( g_buffs  ,
int  ,
1,
"Enable  buffs,
-1:enabled but no auto location or replacing  powerups,
1:enabled and can replace them"   
)

◆ 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_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_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:

◆ 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:

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( buffs  ,
autocvar_g_buffs   
)

Definition at line 11 of file sv_buffs.qh.

References buffs_Initialize(), and MUTATOR_ONADD.

12 {
14  {
16  }
17 }
void buffs_Initialize()
Definition: sv_buffs.qc:1000
#define MUTATOR_ONADD
Definition: base.qh:284
+ Here is the call graph for this function:

Variable Documentation

◆ autocvar_g_buffs_bash_force

float autocvar_g_buffs_bash_force

Definition at line 40 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_bash_force_self

float autocvar_g_buffs_bash_force_self

Definition at line 41 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_cooldown_activate

float autocvar_g_buffs_cooldown_activate

Definition at line 31 of file sv_buffs.qh.

Referenced by buff_Init(), and buff_Reset().

◆ autocvar_g_buffs_cooldown_respawn

float autocvar_g_buffs_cooldown_respawn

Definition at line 32 of file sv_buffs.qh.

Referenced by buff_Think().

◆ autocvar_g_buffs_disability_rate

float autocvar_g_buffs_disability_rate

Definition at line 44 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_disability_slowtime

float autocvar_g_buffs_disability_slowtime

Definition at line 42 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_disability_speed

float autocvar_g_buffs_disability_speed

Definition at line 43 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_disability_weaponspeed

float autocvar_g_buffs_disability_weaponspeed

Definition at line 45 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_drop

bool autocvar_g_buffs_drop = false

Definition at line 30 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_effects

bool autocvar_g_buffs_effects

Definition at line 19 of file sv_buffs.qh.

Referenced by buff_Effect().

◆ autocvar_g_buffs_inferno_burntime_factor

float autocvar_g_buffs_inferno_burntime_factor

Definition at line 48 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_inferno_burntime_min_time

float autocvar_g_buffs_inferno_burntime_min_time

Definition at line 49 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_inferno_burntime_target_damage

float autocvar_g_buffs_inferno_burntime_target_damage

Definition at line 50 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_inferno_burntime_target_time

float autocvar_g_buffs_inferno_burntime_target_time

Definition at line 51 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_inferno_damagemultiplier

float autocvar_g_buffs_inferno_damagemultiplier

Definition at line 52 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_jump_height

float autocvar_g_buffs_jump_height

Definition at line 47 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_luck_chance

float autocvar_g_buffs_luck_chance = 0.15

Definition at line 56 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_luck_damagemultiplier

float autocvar_g_buffs_luck_damagemultiplier = 3

Definition at line 57 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_magnet_range_buff

float autocvar_g_buffs_magnet_range_buff = 200

Definition at line 55 of file sv_buffs.qh.

◆ autocvar_g_buffs_magnet_range_item

float autocvar_g_buffs_magnet_range_item

Definition at line 54 of file sv_buffs.qh.

◆ autocvar_g_buffs_medic_max

float autocvar_g_buffs_medic_max

Definition at line 37 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_medic_regen

float autocvar_g_buffs_medic_regen

Definition at line 38 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_medic_rot

float autocvar_g_buffs_medic_rot

Definition at line 36 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_medic_survive_chance

float autocvar_g_buffs_medic_survive_chance

Definition at line 34 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_medic_survive_health

float autocvar_g_buffs_medic_survive_health

Definition at line 35 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_pickup_anyway

bool autocvar_g_buffs_pickup_anyway = false

Definition at line 21 of file sv_buffs.qh.

Referenced by buff_Think().

◆ autocvar_g_buffs_pickup_delay

float autocvar_g_buffs_pickup_delay = 0.7

Definition at line 22 of file sv_buffs.qh.

Referenced by buff_Inferno_CalculateTime(), and MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_random_lifetime

float autocvar_g_buffs_random_lifetime

Definition at line 25 of file sv_buffs.qh.

Referenced by buff_Respawn().

◆ autocvar_g_buffs_random_location

bool autocvar_g_buffs_random_location

Definition at line 26 of file sv_buffs.qh.

Referenced by buff_Reset(), and buff_Think().

◆ autocvar_g_buffs_random_location_attempts

int autocvar_g_buffs_random_location_attempts

Definition at line 27 of file sv_buffs.qh.

Referenced by buff_Respawn().

◆ autocvar_g_buffs_randomize

bool autocvar_g_buffs_randomize

Definition at line 23 of file sv_buffs.qh.

Referenced by buff_Reset(), and buff_Think().

◆ autocvar_g_buffs_randomize_teamplay

bool autocvar_g_buffs_randomize_teamplay = true

Definition at line 24 of file sv_buffs.qh.

Referenced by buff_Reset(), and buff_Think().

◆ autocvar_g_buffs_replace_powerups

bool autocvar_g_buffs_replace_powerups

Definition at line 29 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_resistance_blockpercent

float autocvar_g_buffs_resistance_blockpercent

Definition at line 33 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_spawn_count

int autocvar_g_buffs_spawn_count

Definition at line 28 of file sv_buffs.qh.

Referenced by buffs_DelayedInit(), and buffs_Initialize().

◆ autocvar_g_buffs_swapper_range

float autocvar_g_buffs_swapper_range

Definition at line 53 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_vampire_damage_steal

float autocvar_g_buffs_vampire_damage_steal

Definition at line 46 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_vengeance_damage_multiplier

float autocvar_g_buffs_vengeance_damage_multiplier

Definition at line 39 of file sv_buffs.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_buffs_waypoint_distance

float autocvar_g_buffs_waypoint_distance

Definition at line 20 of file sv_buffs.qh.

Referenced by buff_Think(), and buff_Waypoint_Spawn().

◆ buff_active

bool buff_active

Definition at line 69 of file sv_buffs.qh.

Referenced by buff_Customize(), buff_Init(), buff_SetCooldown(), buff_Think(), and buff_Touch().

◆ buff_activetime

float buff_activetime

Definition at line 70 of file sv_buffs.qh.

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

◆ buff_activetime_updated

bool buff_activetime_updated

Definition at line 71 of file sv_buffs.qh.

Referenced by buff_Reset(), and buff_Think().

◆ buff_ammo_prev_clipload

int buff_ammo_prev_clipload

Definition at line 61 of file sv_buffs.qh.

Referenced by buff_Inferno_CalculateTime().

◆ buff_ammo_prev_infitems

float buff_ammo_prev_infitems

Definition at line 60 of file sv_buffs.qh.

◆ buff_effect_delay

float buff_effect_delay

Definition at line 66 of file sv_buffs.qh.

◆ buff_flight_crouchheld

bool buff_flight_crouchheld

Definition at line 64 of file sv_buffs.qh.

◆ buff_flight_oldgravity

float buff_flight_oldgravity

Definition at line 63 of file sv_buffs.qh.

◆ BUFF_MAX

const vector BUFF_MAX = ('16 16 60')

Definition at line 78 of file sv_buffs.qh.

Referenced by buff_Init(), and buff_Think().

◆ BUFF_MIN

const vector BUFF_MIN = ('-16 -16 0')

Definition at line 77 of file sv_buffs.qh.

Referenced by buff_Init(), and buff_Think().

◆ buff_model

entity buff_model

Definition at line 75 of file sv_buffs.qh.

Referenced by buffs_BuffModel_Spawn(), and buffs_BuffModel_Update().

◆ buff_shield

float buff_shield

Definition at line 74 of file sv_buffs.qh.

◆ buff_waypoint

◆ oldbuffs

entity oldbuffs

Definition at line 73 of file sv_buffs.qh.

Referenced by buff_Think().