Xonotic
all.qh
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef GAMEQC
4  #include <common/sounds/all.qh>
5 #endif
6 
7 REGISTRY(StatusEffect, 32)
8 REGISTER_REGISTRY(StatusEffect)
9 #define REGISTER_STATUSEFFECT(id, inst) REGISTER(StatusEffect, STATUSEFFECT, id, m_id, inst)
10 
11 REGISTRY_SORT(StatusEffect)
12 REGISTRY_CHECK(StatusEffect)
13 
14 REGISTRY_DEFINE_GET(StatusEffect, NULL)
15 STATIC_INIT(StatusEffect) { FOREACH(StatusEffect, true, it.m_id = i); }
16 
17 enum
18 {
21 };
22 
23 enum
24 {
28 };
29 
32  ATTRIB(StatusEffects, m_name, string);
33  ATTRIB(StatusEffects, m_icon, string);
34  ATTRIB(StatusEffects, m_color, vector, '1 1 1');
36  ATTRIB(StatusEffects, m_hidden, bool, false);
38  ATTRIB(StatusEffects, m_lifetime, float, 30);
39 #ifdef GAMEQC
40  ATTRIB(StatusEffects, m_sound, Sound, SND_Null);
41  ATTRIB(StatusEffects, m_sound_rm, Sound, SND_Null);
42  METHOD(StatusEffects, m_tick, void(StatusEffects this, entity actor));
43  METHOD(StatusEffects, m_active, bool(StatusEffects this, entity actor));
45  ATTRIBARRAY(StatusEffects, statuseffect_time, float, REGISTRY_MAX(StatusEffect));
46  ATTRIBARRAY(StatusEffects, statuseffect_flags, int, REGISTRY_MAX(StatusEffect));
47 #endif
48 #ifdef SVQC
49  METHOD(StatusEffects, m_apply, void(StatusEffects this, entity actor, float eff_time, int eff_flags));
50  METHOD(StatusEffects, m_remove, void(StatusEffects this, entity actor, int removal_type));
52  METHOD(StatusEffects, m_persistent, bool(StatusEffects this, entity actor)) { return false; };
53 #endif
54  METHOD(StatusEffects, display, void(StatusEffects this, void(string name, string icon) returns))
55  {
56  TC(StatusEffects, this);
57  returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
58  }
59 ENDCLASS(StatusEffects)
REGISTRY(Weapons, 72) STATIC_INIT(WeaponPickup)
Definition: all.qh:28
string string_null
Definition: nil.qh:9
CLASS(Object) Object
Definition: oo.qh:318
REGISTRY_SORT(Notifications)
entity() spawn
#define false
Definition: csprogsdefs.qh:6
#define REGISTRY_CHECK(id)
Definition: registry.qh:175
Effect is being removed by a function, calls regular removal mechanics.
Definition: all.qh:25
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
#define ATTRIB(...)
Definition: oo.qh:136
#define REGISTER_REGISTRY(id)
Definition: registry.qh:212
Effect is being forcibly removed without calling any additional mechanics.
Definition: all.qh:27
#define REGISTRY_DEFINE_GET(id, null)
Definition: registry.qh:40
int m_id
Definition: effect.qh:19
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition: bits.qh:8
Effect is currently being granted passively.
Definition: all.qh:20
#define NULL
Definition: post.qh:17
#define TC(T, sym)
Definition: _all.inc:82
#define REGISTRY_MAX(id)
Definition: registry.qh:17
Definition: sound.qh:119
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define ENDCLASS(cname)
Definition: oo.qh:269
STATIC_INIT(IMPULSES_renumber)
Definition: all.qh:8
#define ATTRIBARRAY(cname, name, type, cnt)
Definition: oo.qh:254
#define FOREACH(list, cond, body)
Definition: iter.qh:19
string m_name
Definition: scores.qh:135