19 actor.tur_head = actor;
23 float d = actor.shot_dmg;
24 float r = actor.target_range;
26 setorigin(e, actor.tur_shotorg);
38 actor.attack_finished_single[0] =
time + actor.shot_refire;
39 for (
int i = 0; i < 10; ++i)
63 float head_dist2, closest_dist2 = 0;
68 head_dist2 =
vlen2(head.WarpZone_findradius_dist);
69 if (!closest || head_dist2 < closest_dist2)
71 closest_dist2 = head_dist2;
81 if (closest != actor.realowner)
82 Damage(closest, actor, actor,
84 DEATH_TURRET_TESLA.m_id,
86 closest.WarpZone_findradius_nearest,
89 closest.railgunhit =
true;
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)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define IL_EACH(this, cond, body)
#define IL_CLEAR(this)
Remove all elements.
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.
vector WarpZone_UnTransformOrigin(entity wz, vector org)
Transforms origin org backwards through warpzone wz, as the inverse of WarpZone_TransformOrigin.
#define WarpZone_TraceLine_ThroughZone(org, end, nomonsters, forent, zone, cb)
WarpZone_trace_callback_t te_csqc_trace_callback
var void te_csqc_trace_callback_func(vector start, vector hit)
void te_csqc_lightningarc(vector from, vector to)
#define METHOD(cname, name, prototype)
string W_Sound(string w_snd)
#define SOUND(name, path)
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 ...
void turret_initparams(entity tur)
entity turret_tesla_toast_cond_from
bool turret_tesla_toast_cond(entity e)
entity turret_tesla_toast_cond_actor
entity turret_tesla_toast(entity actor, entity from, float range, float damage)
IntrusiveList g_railgunhit
#define W_SetupShot_Dir(ent, wepent, s_forward, antilag, recoil, snd, chan, maxdamage, deathtype)
const int TFL_TARGETSELECT_TEAMCHECK
don't attack teammates
const int TFL_TARGETSELECT_PLAYERS
target players
const int TFL_TARGETSELECT_RANGELIMITS
limit target selection range
const int TFL_TARGETSELECT_MISSILES
target projectiles
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)