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 51 of file tesla_weapon.qc.

52{
53 float dd = range + 1;
54 entity etarget = NULL;
55 FOREACH_ENTITY_RADIUS(from.origin, range, it != from && !it.railgunhit,
56 {
57 float r = turret_validate_target(actor, it, actor.target_validate_flags);
58 if(r > 0)
59 {
60 traceline(from.origin, 0.5 * (it.absmin + it.absmax), MOVE_WORLDONLY, from);
61 if(trace_fraction == 1.0)
62 {
63 float d = vlen(it.origin - from.origin);
64 if(d < dd)
65 {
66 dd = d;
67 etarget = it;
68 }
69 }
70 }
71 });
72
73 if (etarget)
74 {
75 te_csqc_lightningarc(from.origin, etarget.origin);
76 if (etarget != actor.realowner)
77 Damage(etarget, actor, actor, damage, DEATH_TURRET_TESLA.m_id, DMG_NOWEP, etarget.origin, '0 0 0');
78 etarget.railgunhit = true;
79 IL_PUSH(g_railgunhit, etarget);
80 }
81
82 return etarget;
83}
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:503
#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:85

References entity(), FOREACH_ENTITY_RADIUS, and NULL.