#ifndef BUFFS_ALL_H
#define BUFFS_ALL_H
-// Welcome to the stuff behind the scenes
-// Below, you will find the list of buffs
-// Add new buffs here!
-// Note: Buffs also need spawnfuncs, which are set below
-#include "../../../teams.qh"
-#include "../../../util.qh"
+#include <common/teams.qh>
+#include <common/util.qh>
REGISTER_WAYPOINT(Buff, _("Buff"), '1 0.5 0', 1);
REGISTER_RADARICON(Buff, 1);
-REGISTRY(Buffs, BITS(4))
+REGISTRY(Buffs, BITS(5))
#define Buffs_from(i) _Buffs_from(i, BUFF_Null)
REGISTER_REGISTRY(Buffs)
REGISTRY_CHECK(Buffs)
#define REGISTER_BUFF(id) \
- REGISTER(Buffs, BUFF_##id, m_id, NEW(Buff)); \
- REGISTER_INIT_POST(BUFF_##id) { \
- this.netname = this.m_name; \
- this.m_itemid = BIT(this.m_id - 1); \
- this.m_sprite = strzone(strcat("buff-", this.m_name)); \
- } \
- REGISTER_INIT(BUFF_##id)
+ REGISTER(Buffs, BUFF_##id, m_id, NEW(Buff))
-#include "../../../items/item/pickup.qh"
+#include <common/items/item/pickup.qh>
CLASS(Buff, Pickup)
/** bit index */
ATTRIB(Buff, m_itemid, int, 0)
#endif
ENDCLASS(Buff)
+STATIC_INIT(REGISTER_BUFFS) {
+ FOREACH(Buffs, true, {
+ it.netname = it.m_name; \
+ it.m_itemid = BIT(it.m_id - 1); \
+ it.m_sprite = strzone(strcat("buff-", it.m_name)); \
+ });
+}
+
#ifdef SVQC
- .int buffs;
+ // .int buffs = _STAT(BUFFS);
void buff_Init(entity ent);
void buff_Init_Compat(entity ent, entity replacement);
#define BUFF_SPAWNFUNC(e, b, t) spawnfunc(item_buff_##e) { \