Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
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#ifndef SVQC
7#include <common/util.qh> // for icon_path_from_HUDskin
8#endif
9
10REGISTRY(StatusEffects, 32)
11REGISTER_REGISTRY(StatusEffects)
12#define REGISTER_STATUSEFFECT(id, inst) REGISTER(StatusEffects, STATUSEFFECT, id, m_id, inst)
13
14REGISTRY_SORT(StatusEffects)
15REGISTRY_CHECK(StatusEffects)
16
17REGISTRY_DEFINE_GET(StatusEffects, NULL)
18STATIC_INIT(StatusEffects) { FOREACH(StatusEffects, true, it.m_id = i); }
19
20enum
21{
24};
25
26enum
27{
31};
32
36 ATTRIB(StatusEffect, m_icon, string);
42#ifdef GAMEQC
45 METHOD(StatusEffect, m_tick, void(StatusEffect this, entity actor));
46 METHOD(StatusEffect, m_active, bool(StatusEffect this, entity actor));
50#endif
51#ifdef SVQC
52 METHOD(StatusEffect, m_apply, void(StatusEffect this, entity actor, float eff_time, int eff_flags));
53 METHOD(StatusEffect, m_remove, void(StatusEffect this, entity actor, int removal_type));
55 METHOD(StatusEffect, m_persistent, bool(StatusEffect this, entity actor)) { return false; };
56#endif
57#ifndef SVQC
58 METHOD(StatusEffect, display, void(StatusEffect this, void(string name, string icon) returns))
59 {
60 TC(StatusEffect, this);
61 returns(this.m_name, icon_path_from_HUDskin(this.m_icon));
62 }
63#endif
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
int m_id
Definition all.qh:34
int statuseffect_flags[REGISTRY_MAX(StatusEffects)]
Definition all.qh:49
bool m_hidden
Whether the effect is displayed in the HUD.
Definition all.qh:39
virtual void m_active()
ATTRIB(StatusEffect, m_name, string)
Sound m_sound
Definition all.qh:43
virtual void m_apply()
virtual void m_tick()
float statuseffect_time[REGISTRY_MAX(StatusEffects)]
Stores times of status effects, the id being the index.
Definition all.qh:48
float m_lifetime
Lifetime scale for HUD progress bars.
Definition all.qh:41
virtual void m_persistent()
Sets the persistent flag and updates client side if returning true.
Definition all.qh:55
virtual void m_remove()
Sound m_sound_rm
Definition all.qh:44
vector m_color
Definition all.qh:37
string m_name
Definition scores.qh:142
#define false
Definition csprogsdefs.qh:6
#define FOREACH(list, cond, body)
Definition iter.qh:19
#define TC(T, sym)
Definition _all.inc:82
string name
Definition menu.qh:30
@ STATUSEFFECT_REMOVE_CLEAR
Effect is being forcibly removed without calling any additional mechanics.
Definition all.qh:30
@ STATUSEFFECT_REMOVE_NORMAL
Effect is being removed by a function, calls regular removal mechanics.
Definition all.qh:28
@ STATUSEFFECT_REMOVE_TIMEOUT
Definition all.qh:29
@ STATUSEFFECT_FLAG_PERSISTENT
Effect is currently being granted passively.
Definition all.qh:23
@ STATUSEFFECT_FLAG_ACTIVE
Definition all.qh:22
#define ATTRIBARRAY(cname, name, type, cnt)
Definition oo.qh:266
#define CLASS(...)
Definition oo.qh:145
#define ENDCLASS(cname)
Definition oo.qh:281
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define ATTRIB(...)
Definition oo.qh:148
#define NULL
Definition post.qh:14
#define REGISTRY_SORT(...)
Definition registry.qh:128
#define REGISTER_REGISTRY(id)
Definition registry.qh:229
#define REGISTRY(id, max)
Declare a new registry.
Definition registry.qh:26
#define REGISTRY_CHECK(id)
Definition registry.qh:175
#define REGISTRY_DEFINE_GET(id, null)
Definition registry.qh:40
#define REGISTRY_MAX(id)
Definition registry.qh:17
vector
Definition self.qh:92
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:32