Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
magnet.qc
Go to the documentation of this file.
1#include "magnet.qh"
2
3#ifdef SVQC
4METHOD(MagnetBuff, m_tick, void(StatusEffect this, entity actor))
5{
6 if (IS_PLAYER(actor))
7 {
8 vector pickup_size;
9 IL_EACH(g_items, it.itemdef, {
10 if (it.buffdef)
11 pickup_size = '1 1 1' * autocvar_g_buffs_magnet_range_buff;
12 else
13 pickup_size = '1 1 1' * autocvar_g_buffs_magnet_range_item;
14
15 if (boxesoverlap(actor.absmin - pickup_size, actor.absmax + pickup_size, it.absmin, it.absmax))
16 if (gettouch(it))
17 gettouch(it)(it, actor);
18 });
19 }
20
21 SUPER(MagnetBuff).m_tick(this, actor);
22}
23#endif // SVQC
24#ifdef MENUQC
25METHOD(MagnetBuff, describe, string(MagnetBuff this))
26{
27 TC(MagnetBuff, this);
29 PAR(_("The %s buff greatly increases your item pickup range, collecting nearby items for you while the buff is active."), COLORED_NAME(this));
30 return PAGE_TEXT;
31}
32#endif // MENUQC
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define COLORED_NAME(this)
Definition color.qh:195
#define IS_PLAYER(s)
Definition player.qh:243
#define IL_EACH(this, cond, body)
#define TC(T, sym)
Definition _all.inc:82
#define SUPER(cname)
Definition oo.qh:231
#define METHOD(cname, name, prototype)
Definition oo.qh:269
vector
Definition self.qh:92
IntrusiveList g_items
Definition items.qh:125
#define PAGE_TEXT
Definition string.qh:643
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:649
#define PAGE_TEXT_INIT()
Definition string.qh:642