Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
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_cooldown_activate
float autocvar_g_buffs_cooldown_respawn
bool autocvar_g_buffs_drop = false
bool autocvar_g_buffs_effects
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_available = true
bool autocvar_g_buffs_replace_powerups
int autocvar_g_buffs_spawn_count
float autocvar_g_buffs_waypoint_distance
bool buff_active
float buff_activetime
bool buff_activetime_updated
float buff_effect_delay
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 )

◆ buff_Available()

float buff_Available ( entity buff)

Definition at line 256 of file sv_buffs.qc.

257{
258 if (!buff)
259 return false;
260 if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_AMMO) || cvar("g_melee_only")))
261 return false;
262 if (buff == BUFF_VAMPIRE && cvar("g_vampire"))
263 return false;
264 return cvar(strcat("g_buffs_", buff.netname));
265}
const int IT_UNLIMITED_AMMO
Definition item.qh:23
float cvar(string name)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
int start_items
Definition world.qh:83

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

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

◆ buff_FirstFromFlags()

entity buff_FirstFromFlags ( entity actor)

Definition at line 293 of file sv_buffs.qc.

294{
295 if (!actor.statuseffects)
296 return NULL;
297 FOREACH(StatusEffects, it.instanceOfBuff && it.m_active(it, actor), {
298 return it;
299 });
300 return NULL;
301}
#define FOREACH(list, cond, body)
Definition iter.qh:19
#define NULL
Definition post.qh:14

References entity(), 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().

◆ buff_RemoveAll()

void buff_RemoveAll ( entity actor,
int removal_type )

Definition at line 284 of file sv_buffs.qc.

285{
286 if (!actor.statuseffects)
287 return;
288 FOREACH(StatusEffects, it.instanceOfBuff, {
289 it.m_remove(it, actor, removal_type);
290 });
291}

References entity(), and FOREACH.

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

◆ buffs_Initialize()

void buffs_Initialize ( )

Definition at line 716 of file sv_buffs.qc.

717{
718 // if buffs are above 0, allow random spawning
719 if (autocvar_g_buffs > 0 && autocvar_g_buffs_spawn_count > 0)
721}
const int INITPRIO_FINDTARGET
Definition constants.qh:96
void buffs_DelayedInit(entity this)
Definition sv_buffs.qc:703
int autocvar_g_buffs_spawn_count
Definition sv_buffs.qh:28
void InitializeEntity(entity e, void(entity this) func, int order)
Definition world.qc:2209

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

Referenced by REGISTER_MUTATOR().

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( buffs ,
autocvar_g_buffs  )

Definition at line 11 of file sv_buffs.qh.

12{
14 {
16 }
17}
#define MUTATOR_ONADD
Definition base.qh:309
void buffs_Initialize()
Definition sv_buffs.qc:716

References buffs_Initialize(), and MUTATOR_ONADD.

Variable Documentation

◆ autocvar_g_buffs_cooldown_activate

float autocvar_g_buffs_cooldown_activate

Definition at line 32 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 33 of file sv_buffs.qh.

Referenced by buff_Think().

◆ autocvar_g_buffs_drop

bool autocvar_g_buffs_drop = false

Definition at line 31 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_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 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_Init(), 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_available

bool autocvar_g_buffs_replace_available = true

Definition at line 30 of file sv_buffs.qh.

Referenced by buff_Init().

◆ 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_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_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 39 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 40 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 41 of file sv_buffs.qh.

Referenced by buff_Reset(), and buff_Think().

◆ buff_effect_delay

float buff_effect_delay

Definition at line 36 of file sv_buffs.qh.

◆ buff_model

entity buff_model

Definition at line 45 of file sv_buffs.qh.

Referenced by buffs_BuffModel_Spawn(), and buffs_BuffModel_Update().

◆ buff_shield

float buff_shield

Definition at line 44 of file sv_buffs.qh.

◆ buff_waypoint

◆ oldbuffs

entity oldbuffs

Definition at line 43 of file sv_buffs.qh.

Referenced by buff_Think().