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 {
11 if (it.buffdef)
12 pickup_size = '1 1 1' * autocvar_g_buffs_magnet_range_buff;
13 else
14 pickup_size = '1 1 1' * autocvar_g_buffs_magnet_range_item;
15
16 if (boxesoverlap(actor.absmin - pickup_size, actor.absmax + pickup_size, it.absmin, it.absmax)
17 && gettouch(it))
18 gettouch(it)(it, actor);
19 });
20 }
21
22 SUPER(MagnetBuff).m_tick(this, actor);
23}
24#endif // SVQC
25#ifdef MENUQC
26METHOD(MagnetBuff, describe, string(MagnetBuff this))
27{
28 TC(MagnetBuff, this);
30 PAR(_("The %s buff greatly increases your item pickup range, collecting nearby items for you while the buff is active."), COLORED_NAME(this));
31 return PAGE_TEXT;
32}
33#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:242
#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:119
#define PAGE_TEXT
Definition string.qh:642
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:648
#define PAGE_TEXT_INIT()
Definition string.qh:641