]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mutators/mutator/buffs/cl_buffs.qc
790a10a86b8f16da4b5f0f0f65900d1813ca89a2
[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_name, strcat("buff_", it.netname), 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     {
17         Buff b = Buffs_from(this.wp_extra);
18         M_ARGV(2, vector) = b.m_color;
19         M_ARGV(3, string) = b.m_name;
20         M_ARGV(4, string) = strcat("buff_", b.netname);
21         return true;
22     }
23 }