Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
all.qh File Reference
#include "sound.qh"
#include "all.inc"
#include "all.qc"
Include dependency graph for all.qh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SND(id)
#define SOUND(name, path)

Functions

void play2 (entity e, string filename)
void play2all (string samp)
void play2team (float t, string filename)
 PRECACHE (Sounds)
 SOUND (Null, "misc/null")
bool sound_allowed (int dest, entity e)
void soundat (entity e, vector o, float chan, string samp, float vol, float _atten)
void soundto (float dest, entity e, float chan, string samp, float vol, float atten, float _pitch)
void soundtoat (float _dest, entity e, vector o, float chan, string samp, float vol, float _atten, float _pitch)
float spamsound (entity e, float chan, Sound samp, float vol, float _atten)
void stopsound (entity e, float chan)
void stopsoundto (float _dest, entity e, float chan)

Macro Definition Documentation

◆ SND

◆ SOUND

#define SOUND ( name,
path )
Value:
string SND_##name##_get() { return path; } \
REGISTER(Sounds, SND, name, m_id, NEW(Sound, SND_##name##_get))
int m_id
Definition effect.qh:19
string name
Definition menu.qh:30
#define NEW(cname,...)
Definition oo.qh:117
#define SND(id)
Definition all.qh:35

Definition at line 30 of file all.qh.

30#define SOUND(name, path) \
31 string SND_##name##_get() { return path; } \
32 REGISTER(Sounds, SND, name, m_id, NEW(Sound, SND_##name##_get))

Function Documentation

◆ play2()

void play2 ( entity e,
string filename )

Definition at line 116 of file all.qc.

117{
118 msg_entity = e;
119 soundtoat(MSG_ONE, NULL, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE, 0);
120}
float MSG_ONE
Definition menudefs.qc:56
#define NULL
Definition post.qh:14
entity msg_entity
Definition progsdefs.qc:63
const float VOL_BASE
Definition sound.qh:36
const int CH_INFO
Definition sound.qh:6
const float ATTEN_NONE
Definition sound.qh:27
void soundtoat(int to, entity e, vector o, int chan, string samp, float vol, float attenu, float _pitch)
Definition all.qc:39

References ATTEN_NONE, CH_INFO, entity(), msg_entity, MSG_ONE, NULL, soundtoat(), and VOL_BASE.

Referenced by client_hasweapon(), door_check_keys(), door_touch(), fragsfilter_use(), item_key_touch(), nades_GiveBonus(), ons_CaptureShield_Touch(), ons_ControlPoint_Icon_Damage(), ons_GeneratorDamage(), play2team(), secret_touch(), SUB_UseTargets_Ex(), target_print_message(), target_voicescript_next(), trigger_keylock_touch(), vehicles_locktarget(), W_MineLayer_Attack(), and W_Reload().

◆ play2all()

void play2all ( string samp)

Definition at line 142 of file all.qc.

143{
144 if (autocvar_bot_sound_monopoly) return;
146}
#define _sound(e, c, s, v, a)
Definition sound.qh:43
bool autocvar_bot_sound_monopoly
Definition all.qc:6

References _sound, ATTEN_NONE, autocvar_bot_sound_monopoly, CH_INFO, NULL, and VOL_BASE.

Referenced by dompoint_captured(), kh_LoserTeam(), kh_WinnerTeam(), and Onslaught_CheckWinner().

◆ play2team()

void play2team ( float t,
string filename )

Definition at line 136 of file all.qc.

137{
138 if (autocvar_bot_sound_monopoly) return;
139 FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.team == t, play2(it, filename));
140}
#define IS_PLAYER(s)
Definition player.qh:243
void play2(entity e, string filename)
Definition all.qc:116
#define IS_REAL_CLIENT(v)
Definition utils.qh:17
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:50

References autocvar_bot_sound_monopoly, FOREACH_CLIENT, IS_PLAYER, IS_REAL_CLIENT, and play2().

Referenced by ons_ControlPoint_Icon_Damage(), and ons_GeneratorDamage().

◆ PRECACHE()

PRECACHE ( Sounds )

Definition at line 37 of file all.qh.

37 {
38 FOREACH(Sounds, true, it.sound_precache(it));
39}
#define FOREACH(list, cond, body)
Definition iter.qh:19

References FOREACH.

◆ SOUND()

SOUND ( Null ,
"misc/null"  )

◆ sound_allowed()

bool sound_allowed ( int dest,
entity e )

Definition at line 9 of file all.qc.

10{
11 if(!e) return true; // save on a few checks
12 for ( ; ; )
13 {
14 if (e.classname == "body") e = e.enemy;
15 else if (e.realowner && e.realowner != e) e = e.realowner;
16 else if (e.owner && e.owner != e) e = e.owner;
17 else break;
18 }
19 // sounds to self may always pass
20 if (to == MSG_ONE && e == msg_entity) return true;
21 // sounds by players can be removed
22 if (autocvar_bot_sound_monopoly && IS_REAL_CLIENT(e)) return false;
23 // anything else may pass
24 return true;
25}

References autocvar_bot_sound_monopoly, entity(), IS_REAL_CLIENT, msg_entity, and MSG_ONE.

Referenced by _GlobalSound(), CSQCProjectile(), Damage_DamageInfo(), globalsound(), GrapplingHookSend(), Monster_Damage(), PlayerCorpseDamage(), PlayerDamage(), playersound(), soundto(), soundtoat(), spamsound(), SpawnCasing(), stopsound(), stopsoundto(), vehicles_damage(), Violence_GibSplash_At(), and W_Tuba_NoteSendEntity().

◆ soundat()

void soundat ( entity e,
vector o,
float chan,
string samp,
float vol,
float _atten )

References entity(), and vector.

◆ soundto()

void soundto ( float dest,
entity e,
float chan,
string samp,
float vol,
float atten,
float _pitch )

References atten, dest, and entity().

◆ soundtoat()

void soundtoat ( float _dest,
entity e,
vector o,
float chan,
string samp,
float vol,
float _atten,
float _pitch )

References dest, entity(), and vector.

◆ spamsound()

float spamsound ( entity e,
float chan,
Sound samp,
float vol,
float _atten )

References entity().

◆ stopsound()

void stopsound ( entity e,
float chan )

References entity(), and REGISTER_REGISTRY.

◆ stopsoundto()

void stopsoundto ( float _dest,
entity e,
float chan )

References entity().