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 {
9 actor.origin + actor.view_ofs, // line from eyes
11 true // require line of sight
12 );
13 for (; head; head = next)
14 {
15 next = head.chain; // save next entity in case head is deleted (or head.chain changed) by gettouch(head)
16 if (head.itemdef // this (intentionally) doesn't include buffs -- they use .buffdef not .itemdef
17 && gettouch(head))
18 gettouch(head)(head, 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 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:189
#define IS_PLAYER(s)
Definition player.qh:242
next
Definition all.qh:75
#define TC(T, sym)
Definition _all.inc:82
entity WarpZone_FindRadius(vector org, float rad, bool needlineofsight)
Definition common.qc:651
float autocvar_g_buffs_magnet_range
Definition magnet.qh:6
#define SUPER(cname)
Definition oo.qh:236
#define METHOD(cname, name, prototype)
Definition oo.qh:274
#define gettouch(e)
Definition self.qh:78
#define PAGE_TEXT
Definition string.qh:651
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:657
#define PAGE_TEXT_INIT()
Definition string.qh:650