X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Fbuffs%2Fall.qh;h=8e1319b39bdcfeb16e6b7f164735b773f7a71fde;hb=35528e99ccad9a20fbd6eed640a5bc1bda884acd;hp=76ecff8be1bac913082922b65dc297de6d4ba10b;hpb=1cbef966e133966c5b5f0f5b58fbd1a5851ed35b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mutators/mutator/buffs/all.qh b/qcsrc/common/mutators/mutator/buffs/all.qh index 76ecff8be..8e1319b39 100644 --- a/qcsrc/common/mutators/mutator/buffs/all.qh +++ b/qcsrc/common/mutators/mutator/buffs/all.qh @@ -1,31 +1,21 @@ #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 +#include 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 CLASS(Buff, Pickup) /** bit index */ ATTRIB(Buff, m_itemid, int, 0) @@ -43,6 +33,14 @@ CLASS(Buff, Pickup) #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 = _STAT(BUFFS); void buff_Init(entity ent);