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 turret_tesla_toast (entity actor, entity from, float range, float damage)
bool turret_tesla_toast_cond (entity e)

Variables

entity turret_tesla_toast_cond_actor
entity turret_tesla_toast_cond_from

Function Documentation

◆ SOUND()

SOUND ( TeslaCoilTurretAttack_FIRE ,
W_Sound("electro_fire")  )

◆ turret_tesla_toast()

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

Definition at line 60 of file tesla_weapon.qc.

61{
62 entity closest = NULL;
63 float head_dist2, closest_dist2 = 0;
66 for (entity head = WarpZone_SearchInRadius(from.origin, range, MOVE_NOMONSTERS, turret_tesla_toast_cond); head; head = head.chain)
67 {
68 head_dist2 = vlen2(head.WarpZone_findradius_dist);
69 if (!closest || head_dist2 < closest_dist2) // new closest
70 {
71 closest_dist2 = head_dist2;
72 closest = head;
73 }
74 }
75
76 if (closest)
77 {
79 WarpZone_TraceLine_ThroughZone(from.origin, WarpZone_UnTransformOrigin(closest, closest.WarpZone_findradius_nearest),
81 if (closest != actor.realowner)
82 Damage(closest, actor, actor,
83 damage,
84 DEATH_TURRET_TESLA.m_id,
86 closest.WarpZone_findradius_nearest,
87 '0 0 0'
88 );
89 closest.railgunhit = true;
90 IL_PUSH(g_railgunhit, closest);
91 }
92 return closest;
93}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const float MOVE_NOMONSTERS
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition damage.qc:484
#define DMG_NOWEP
Definition damage.qh:104
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
entity WarpZone_SearchInRadius(vector org, float rad, float nomonsters, WarpZone_FindRadius_cond_callback_t cb)
Modified findradius aware of warpzones, that only includes entities that meet the "cb" criteria.
Definition common.qc:680
vector WarpZone_UnTransformOrigin(entity wz, vector org)
Transforms origin org backwards through warpzone wz, as the inverse of WarpZone_TransformOrigin.
Definition common.qc:526
#define WarpZone_TraceLine_ThroughZone(org, end, nomonsters, forent, zone, cb)
Definition common.qh:47
WarpZone_trace_callback_t te_csqc_trace_callback
Definition common.qh:38
#define MOVE_NOTHING
Definition common.qh:35
var void te_csqc_trace_callback_func(vector start, vector hit)
void te_csqc_lightningarc(vector from, vector to)
#define NULL
Definition post.qh:14
entity turret_tesla_toast_cond_from
bool turret_tesla_toast_cond(entity e)
entity turret_tesla_toast_cond_actor
IntrusiveList g_railgunhit
Definition tracing.qh:91
#define vlen2(v)
Definition vector.qh:4

References Damage(), DMG_NOWEP, entity(), g_railgunhit, IL_PUSH(), MOVE_NOMONSTERS, MOVE_NOTHING, NULL, te_csqc_lightningarc(), te_csqc_trace_callback, te_csqc_trace_callback_func(), turret_tesla_toast_cond(), turret_tesla_toast_cond_actor, turret_tesla_toast_cond_from, vlen2, WarpZone_SearchInRadius(), WarpZone_TraceLine_ThroughZone, and WarpZone_UnTransformOrigin().

◆ turret_tesla_toast_cond()

bool turret_tesla_toast_cond ( entity e)

Definition at line 55 of file tesla_weapon.qc.

56{
57 return (e != turret_tesla_toast_cond_from && !e.railgunhit
59}
float turret_validate_target(entity e_turret, entity e_target, float validate_flags)
Evaluate a entity for target valitity based on validate_flags NOTE: the caller must check takedamage ...

References entity(), turret_tesla_toast_cond_actor, turret_tesla_toast_cond_from, and turret_validate_target().

Referenced by turret_tesla_toast().

Variable Documentation

◆ turret_tesla_toast_cond_actor

entity turret_tesla_toast_cond_actor

Definition at line 54 of file tesla_weapon.qc.

Referenced by turret_tesla_toast(), and turret_tesla_toast_cond().

◆ turret_tesla_toast_cond_from

entity turret_tesla_toast_cond_from

Definition at line 53 of file tesla_weapon.qc.

Referenced by turret_tesla_toast(), and turret_tesla_toast_cond().