Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
tesla_weapon.qc File Reference
#include "tesla_weapon.qh"
Include dependency graph for tesla_weapon.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 SOUND (TeslaCoilTurretAttack_FIRE, W_Sound("electro_fire"))
entity toast (entity actor, entity from, float range, float damage)

Function Documentation

◆ SOUND()

SOUND ( TeslaCoilTurretAttack_FIRE ,
W_Sound("electro_fire")  )

◆ toast()

entity toast ( entity actor,
entity from,
float range,
float damage )

Definition at line 53 of file tesla_weapon.qc.

54{
55 float dd = range + 1;
56 entity etarget = NULL;
57 FOREACH_ENTITY_RADIUS(from.origin, range, it != from && !it.railgunhit,
58 {
59 float r = turret_validate_target(actor, it, actor.target_validate_flags);
60 if (r > 0)
61 {
62 traceline(from.origin, 0.5 * (it.absmin + it.absmax), MOVE_WORLDONLY, from);
63 if (trace_fraction == 1.0)
64 {
65 float d = vlen(it.origin - from.origin);
66 if (d < dd)
67 {
68 dd = d;
69 etarget = it;
70 }
71 }
72 }
73 });
74
75 if (etarget)
76 {
77 te_csqc_lightningarc(from.origin, etarget.origin);
78 if (etarget != actor.realowner)
79 Damage(etarget, actor, actor,
80 damage,
81 DEATH_TURRET_TESLA.m_id,
83 etarget.origin,
84 '0 0 0'
85 );
86 etarget.railgunhit = true;
87 IL_PUSH(g_railgunhit, etarget);
88 }
89
90 return etarget;
91}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition damage.qc:493
#define DMG_NOWEP
Definition damage.qh:104
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define FOREACH_ENTITY_RADIUS(org, dist, cond, body)
Definition iter.qh:160
void te_csqc_lightningarc(vector from, vector to)
#define NULL
Definition post.qh:14
IntrusiveList g_railgunhit
Definition tracing.qh:89

References entity(), FOREACH_ENTITY_RADIUS, and NULL.