]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mutators/mutator/buffs/cl_buffs.qc
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / buffs / cl_buffs.qc
1 #include "cl_buffs.qh"
2
3 REGISTER_MUTATOR(cl_buffs, true);
4 MUTATOR_HOOKFUNCTION(cl_buffs, HUD_Powerups_add)
5 {
6         int allBuffs = STAT(BUFFS);
7         FOREACH(Buffs, it.m_itemid & allBuffs, {
8                 addPowerupItem(it.m_prettyName, strcat("buff_", it.m_name), it.m_color, bound(0, STAT(BUFF_TIME) - time, 99), 60);
9         });
10 }
11 MUTATOR_HOOKFUNCTION(cl_buffs, WP_Format)
12 {
13         entity this = M_ARGV(0, entity);
14         string s = M_ARGV(1, string);
15         if (s == WP_Buff.netname || s == RADARICON_Buff.netname) {
16                 Buff b = Buffs_from(this.wp_extra);
17                 M_ARGV(2, vector) = b.m_color;
18                 M_ARGV(3, string) = b.m_prettyName;
19                 return true;
20         }
21 }