Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
walker.qc
Go to the documentation of this file.
1#include "walker.qh"
2
3#ifdef SVQC
4
27
28const int ANIM_NO = 0;
29const int ANIM_TURN = 1;
30const int ANIM_WALK = 2;
31const int ANIM_RUN = 3;
32const int ANIM_STRAFE_L = 4;
33const int ANIM_STRAFE_R = 5;
34const int ANIM_JUMP = 6;
35const int ANIM_LAND = 7;
36const int ANIM_PAIN = 8;
37const int ANIM_MELEE = 9;
38const int ANIM_SWIM = 10;
39const int ANIM_ROAM = 11;
40
41.float animflag;
42.float idletime;
43
45{
46 if (this.animflag == ANIM_MELEE)
47 return false;
48 return turret_firecheck(this);
49}
50
57{
58 makevectors(this.angles);
59
61 for (entity e = WarpZone_SearchInRadius(this.origin + v_forward * 128, 32, MOVE_NOTHING, walker_melee_do_dmg_cond); e; e = e.chain)
62 Damage(e, this, this,
64 DEATH_TURRET_WALK_MELEE.m_id,
66 e.WarpZone_findradius_nearest,
68 );
69}
70
72{
73 turrets_setframe(this, ANIM_NO, false);
74 this.animflag = this.frame;
75}
77{
78 RadiusDamage(this, this.realowner,
80 0,
82 this,
83 NULL,
85 DEATH_TURRET_WALK_ROCKET.m_id,
87 NULL
88 );
89 delete(this);
90}
91
96
97void walker_rocket_damage(entity this, entity inflictor, entity attacker, float damage, float deathtype, .entity weaponentity, vector hitloc, vector vforce)
98{
99 TakeResource(this, RES_HEALTH, damage);
100 this.velocity += vforce;
101
102 if (GetResource(this, RES_HEALTH) <= 0)
104}
105
106#define WALKER_ROCKET_MOVE(s) \
107 movelib_move_simple((s), newdir, autocvar_g_turrets_unit_walker_rocket_speed, autocvar_g_turrets_unit_walker_rocket_turnrate); \
108 UpdateCSQCProjectile(s)
109void walker_rocket_loop(entity this);
111{
112 this.nextthink = time;
113
114 float edist = vlen(this.enemy.origin - this.origin);
115
116 // Simulate crude guidance
117 if (this.cnt < time)
118 {
119 this.tur_shotorg = randomvec() * min(edist, (edist < 1000 ? 64 : 256));
120 this.cnt = time + 0.5;
121 }
122
123 if (edist < 128)
124 this.tur_shotorg = '0 0 0';
125
126 if (this.max_health < time)
127 {
129 this.nextthink = time;
130 return;
131 }
132
133 if (this.shot_dmg != 1337 && random() < 0.01)
134 {
135 walker_rocket_loop(this);
136 return;
137 }
138
139 // Enemy dead? just keep on the current heading then.
140 if (this.enemy == NULL || IS_DEAD(this.enemy))
141 this.enemy = NULL;
142
143 vector newdir;
144 if (this.enemy)
145 {
146 //float itime = max(edist / vlen(this.velocity), 1);
147 newdir = steerlib_pull(this, this.enemy.origin + this.tur_shotorg);
148 }
149 else
150 newdir = normalize(this.velocity);
151
152 WALKER_ROCKET_MOVE(this);
153}
154
156{
157 this.nextthink = time;
158
159 if (this.max_health < time)
160 {
162 return;
163 }
164
165 if (vdist(this.origin - this.tur_shotorg, <, 100))
166 {
168 return;
169 }
170
171 vector newdir = steerlib_pull(this, this.tur_shotorg);
172 WALKER_ROCKET_MOVE(this);
173
174 this.angles = vectoangles(this.velocity);
175}
176
178{
179 this.nextthink = time;
180
181 if (this.max_health < time)
182 {
184 return;
185 }
186
187 if (vdist(this.origin - this.tur_shotorg, <, 100))
188 {
189 this.tur_shotorg = this.origin - '0 0 200';
191 return;
192 }
193
194 vector newdir = steerlib_pull(this, this.tur_shotorg);
195 WALKER_ROCKET_MOVE(this);
196}
197
199{
200 this.nextthink = time;
201 this.tur_shotorg = this.origin + '0 0 300';
203 this.shot_dmg = 1337;
204}
205
207{
209
210 te_explosion (org);
211
212 entity rocket = new(walker_rocket);
213 setorigin(rocket, org);
214 rocket.solid = SOLID_BBOX; // before setsize so it will be linked to the area grid
215 sound(this, CH_WEAPON_A, SND_TUR_WALKER_FIRE, VOL_BASE, ATTEN_NORM);
216 setsize(rocket, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
217
218 rocket.realowner = this;
219 rocket.owner = this;
220 rocket.bot_dodge = true;
221 rocket.bot_dodgerating = 50;
222 rocket.takedamage = DAMAGE_YES;
223 rocket.damageforcescale = 2;
224 SetResourceExplicit(rocket, RES_HEALTH, 25);
225 rocket.tur_shotorg = randomvec() * 512;
226 rocket.cnt = time + 1;
227 rocket.enemy = this.enemy;
228
229 if (random() < 0.01)
231 else
233
234 rocket.event_damage = walker_rocket_damage;
235
236 rocket.nextthink = time;
237 set_movetype(rocket, MOVETYPE_FLY);
238 rocket.velocity = normalize((v_forward + v_up * 0.5) + (randomvec() * 0.2)) * autocvar_g_turrets_unit_walker_rocket_speed;
239 rocket.angles = vectoangles(rocket.velocity);
241 rocket.flags = FL_PROJECTILE;
242 IL_PUSH(g_projectiles, rocket);
243 IL_PUSH(g_bot_dodge, rocket);
244 rocket.max_health = time + 9;
245 rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
246
247 CSQCProjectile(rocket, false, PROJECTILE_ROCKET, false); // no culling, has fly sound
248}
249
252void walker_move_to(entity this, vector _target, float _dist)
253{
254 switch (this.waterlevel)
255 {
256 case WATERLEVEL_NONE:
257 if (_dist > 500)
258 this.animflag = ANIM_RUN;
259 else
260 this.animflag = ANIM_WALK;
263 if (this.animflag != ANIM_SWIM)
264 this.animflag = ANIM_WALK;
265 else
266 this.animflag = ANIM_SWIM;
267 break;
269 this.animflag = ANIM_SWIM;
270 }
271
272 this.moveto = _target;
273 this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
274
275 if (this.enemy)
276 {
277 this.enemy_last_loc = _target;
278 this.enemy_last_time = time;
279 }
280}
281
283{
284#ifdef WALKER_FANCYPATHING
285 // Are we close enougth to a path node to switch to the next?
286 if (turret_closetotarget(this, this.pathcurrent.origin, 64))
287 {
288 if (this.pathcurrent.path_next == NULL)
289 {
290 // Path endpoint reached
292 this.pathcurrent = NULL;
293
294 if (this.pathgoal)
295 {
296 if (this.pathgoal.use)
297 this.pathgoal.use(this, NULL, NULL);
298
299 if (this.pathgoal.enemy)
300 {
301 this.pathcurrent = pathlib_astar(this, this.pathgoal.origin, this.pathgoal.enemy.origin);
302 this.pathgoal = this.pathgoal.enemy;
303 }
304 }
305 else
306 this.pathgoal = NULL;
307 }
308 else
309 this.pathcurrent = this.pathcurrent.path_next;
310 }
311
312 this.moveto = this.pathcurrent.origin;
313 this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
314 walker_move_to(this, this.moveto, 0);
315
316#else
317 if (turret_closetotarget(this, this.pathcurrent.origin, 64))
318 this.pathcurrent = this.pathcurrent.enemy;
319
320 if (!this.pathcurrent)
321 return;
322
323 this.moveto = this.pathcurrent.origin;
324 this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
325 walker_move_to(this, this.moveto, 0);
326#endif
327}
328
330{
331 entity e = find(NULL, targetname, this.target);
332 if (!e)
333 {
334 LOG_TRACE("Initital waypoint for walker does NOT exist, fix your map!");
335 this.target = "";
336 }
337
338 if (e.classname != "turret_checkpoint")
339 LOG_TRACE("Warning: not a turrret path");
340 else
341 {
342#ifdef WALKER_FANCYPATHING
343 this.pathcurrent = pathlib_astar(this, this.origin, e.origin);
344 this.pathgoal = e;
345#else
346 this.pathcurrent = e;
347#endif
348 }
349
350 // TODO: this doesn't reset target, so tur_defend will be the checkpoint too!
351}
352
353spawnfunc(turret_walker)
354{
355 if (!turret_initialize(this, TUR_WALKER))
356 delete(this);
357}
358
359METHOD(WalkerTurret, tr_think, void(WalkerTurret thistur, entity it))
360{
361 fixedmakevectors(it.angles);
362
363 if ((it.spawnflags & TSF_NO_PATHBREAK) && it.pathcurrent)
365 else if (it.enemy == NULL)
366 {
367 if (it.pathcurrent)
369 else
370 {
371 if (it.enemy_last_time != 0)
372 {
373 if (vdist(it.origin - it.enemy_last_loc, <, 128) || time - it.enemy_last_time > 10)
374 it.enemy_last_time = 0;
375 else
376 walker_move_to(it, it.enemy_last_loc, 0);
377 }
378 else
379 {
380 if (it.animflag != ANIM_NO)
381 {
382 WarpZone_TraceLine(it.origin + '0 0 64', it.origin + '0 0 64' + v_forward * 128, MOVE_NORMAL, it);
383
384 if (trace_fraction != 1.0)
385 it.tur_head.idletime = -1337;
386 else
387 {
389 if (trace_fraction == 1.0)
390 it.tur_head.idletime = -1337;
391 }
392
393 if (it.tur_head.idletime == -1337)
394 {
395 it.moveto = it.origin + randomvec() * 256;
396 it.tur_head.idletime = 0;
397 }
398
399 it.moveto = it.moveto * 0.9 + ((it.origin + v_forward * 500) + randomvec() * 400) * 0.1;
400 it.moveto.z = it.origin.z + 64;
401 walker_move_to(it, it.moveto, 0);
402 }
403
404 if (it.idletime < time)
405 {
406 if (random() < 0.5 || !(it.spawnflags & TSL_ROAM))
407 {
408 it.idletime = time + 1 + random() * 5;
409 it.moveto = it.origin;
410 it.animflag = ANIM_NO;
411 }
412 else
413 {
414 it.animflag = ANIM_WALK;
415 it.idletime = time + 4 + random() * 2;
416 it.moveto = it.origin + randomvec() * 256;
417 it.tur_head.moveto = it.moveto;
418 it.tur_head.idletime = 0;
419 }
420 }
421 }
422 }
423 }
424 else
425 {
426 if (it.tur_dist_enemy < autocvar_g_turrets_unit_walker_melee_range && it.animflag != ANIM_MELEE)
427 {
428 vector wish_angle = angleofs(it, it.enemy);
429
430 if (it.animflag != ANIM_SWIM
431 && fabs(wish_angle.y) < 15)
432 {
433 it.moveto = it.enemy.origin;
434 it.steerto = steerlib_attract2(it, it.moveto, 0.5, 500, 0.95);
435 it.animflag = ANIM_MELEE;
436 }
437 }
438 else if (it.tur_head.attack_finished_single[0] < time)
439 {
440 if (it.tur_head.shot_volly)
441 {
442 it.animflag = ANIM_NO;
443
444 --it.tur_head.shot_volly;
445 if (it.tur_head.shot_volly == 0)
446 it.tur_head.attack_finished_single[0] = time + autocvar_g_turrets_unit_walker_rocket_refire;
447 else
448 it.tur_head.attack_finished_single[0] = time + 0.2;
449
450 walker_fire_rocket(it, gettaginfo(it, gettagindex(it, (it.tur_head.shot_volly > 1 ? "tag_rocket01" : "tag_rocket02"))));
451 }
452 else
453 {
455 && it.tur_dist_enemy < (autocvar_g_turrets_unit_walker_rocket_range))
456 it.tur_head.shot_volly = 4;
457 }
458 }
459 else
460 {
461 if (it.animflag != ANIM_MELEE)
462 walker_move_to(it, it.enemy.origin, it.tur_dist_enemy);
463 }
464 }
465
466 {
467 vector real_angle;
468 float turny = 0, turnx = 0;
469 float vz;
470
471 real_angle = vectoangles(it.steerto) - it.angles;
472 vz = it.velocity.z;
473
474 switch (it.animflag)
475 {
476 case ANIM_NO:
478 break;
479
480 case ANIM_TURN:
483 break;
484
485 case ANIM_WALK:
488 break;
489
490 case ANIM_RUN:
493 break;
494
495 case ANIM_STRAFE_L:
498 break;
499
500 case ANIM_STRAFE_R:
503 break;
504
505 case ANIM_JUMP:
507 break;
508
509 case ANIM_LAND:
510 break;
511
512 case ANIM_PAIN:
513 if (it.frame != ANIM_PAIN)
514 defer(it, 0.25, walker_setnoanim);
515 break;
516
517 case ANIM_MELEE:
518 if (it.frame != ANIM_MELEE)
519 {
520 defer(it, 0.41, walker_setnoanim);
521 defer(it, 0.21, walker_melee_do_dmg);
522 }
523
525 break;
526
527 case ANIM_SWIM:
530
531 it.angles.x += bound(-10, shortangle_f(real_angle.x, it.angles.x), 10);
533 vz = it.velocity.z + sin(time * 4) * 8;
534 break;
535
536 case ANIM_ROAM:
539 break;
540 }
541
542 if (turny)
543 {
544 turny = bound(-turny, shortangle_f(real_angle.y, it.angles.y), turny);
545 it.angles.y += turny;
546 }
547 if (turnx)
548 {
549 turnx = bound(-turnx, shortangle_f(real_angle.x, it.angles.x), turnx);
550 it.angles.x += turnx;
551 }
552
553 it.velocity.z = vz;
554 }
555
556
557 if (it.origin != it.oldorigin || it.velocity != it.oldvelocity)
558 it.SendFlags |= TNSF_MOVE;
559
560 it.oldorigin = it.origin;
561 it.oldvelocity = it.velocity;
562 turrets_setframe(it, it.animflag, false);
563}
564METHOD(WalkerTurret, tr_death, void(WalkerTurret this, entity it))
565{
566#ifdef WALKER_FANCYPATHING
567 if (it.pathcurrent)
568 pathlib_deletepath(it.pathcurrent.owner);
569#endif
570 it.pathcurrent = NULL;
571}
572METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))
573{
574 // Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn.
575 if (it.move_movetype == MOVETYPE_STEP)
576 {
577 if (it.pos1)
578 setorigin(it, it.pos1);
579 if (it.pos2)
580 it.angles = it.pos2;
581 }
582
584 it.aim_flags = TFL_AIM_LEAD;
585 it.turret_flags |= TUR_FLAG_HITSCAN;
586
589 it.iscreature = true;
590 it.teleportable = TELEPORT_NORMAL;
591 if (!it.damagedbycontents)
593 it.damagedbycontents = true;
594 it.solid = SOLID_SLIDEBOX;
595 it.takedamage = DAMAGE_AIM;
596 if (it.move_movetype != MOVETYPE_STEP)
597 {
598 setorigin(it, it.origin);
599 tracebox(it.origin + '0 0 128', it.mins, it.maxs, it.origin - '0 0 10000', MOVE_NORMAL, it);
600 setorigin(it, trace_endpos + '0 0 4');
601 it.pos1 = it.origin;
602 it.pos2 = it.angles;
603 }
605 it.idle_aim = '0 0 0';
606 it.turret_firecheckfunc = walker_firecheck;
607
608 if (it.target != "")
610}
611
612#undef WALKER_ROCKET_MOVE
613
614#endif // SVQC
615#ifdef CSQC
616
618
620{
621 float dt = time - this.move_time;
622 this.move_time = time;
623 if (dt <= 0)
624 return;
625
627 movelib_groundalign4point(this, 300, 100, 0.25, 45);
628 setorigin(this, this.origin + this.velocity * dt);
629 this.tur_head.angles += dt * this.tur_head.avelocity;
630
631 if (GetResource(this, RES_HEALTH) < 127
632 && random() < 0.15)
633 te_spark(this.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
634}
635
636METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))
637{
638 it.gravity = 1;
640 it.move_time = time;
641 it.draw = walker_draw;
642}
643
644#endif // CSQC
645#ifdef MENUQC
648
649METHOD(WalkerTurret, describe, string(WalkerTurret this))
650{
651 TC(WalkerTurret, this);
653 PAR(_("The %s is an arachnid-like walking turret that hunts down its targets."), COLORED_NAME(this));
654 PAR(_("It has two weapons, both a machinegun like the %s for medium range combat, and a rocket launcher shooting homing missiles like the %s for long range targets. "
655 "It also has the ability to melee close by targets."), COLORED_NAME(WEP_MACHINEGUN), COLORED_NAME(WEP_DEVASTATOR));
656 return PAGE_TEXT;
657}
658
659#endif // MENUQC
ERASEABLE float shortangle_f(float ang1, float ang2)
Return the short angle.
Definition angle.qc:23
#define angleofs(from, to)
Definition angle.qc:74
void fixedmakevectors(vector a)
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
Definition anim.qh:6
IntrusiveList g_bot_dodge
Definition api.qh:150
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float max_health
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
float cnt
Definition powerups.qc:24
#define COLORED_NAME(this)
Definition color.qh:189
#define IS_DEAD(s)
Definition player.qh:244
float waterlevel
Definition player.qh:225
const int FL_PROJECTILE
Definition constants.qh:77
const int INITPRIO_FINDTARGET
Definition constants.qh:89
vector v_up
const float SOLID_SLIDEBOX
const float MOVE_NORMAL
vector velocity
const float SOLID_BBOX
float time
vector v_right
vector trace_endpos
float nextthink
vector v_forward
vector origin
float trace_fraction
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition damage.qc:484
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
Definition damage.qc:937
IntrusiveList g_damagedbycontents
Definition damage.qh:143
#define DMG_NOWEP
Definition damage.qh:104
void defer(entity this, float fdelay, void(entity) func)
Execute func() after time + fdelay.
Definition defer.qh:26
#define gettagindex
ent angles
Definition ent_cs.qc:146
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define TC(T, sym)
Definition _all.inc:82
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_TransformVelocity(entity wz, vector vel)
Transforms velocity v across warpzone wz.
Definition common.qc:495
#define WarpZone_TraceLine(org, end, nomonsters, forent)
Definition common.qh:51
noref entity WarpZone_SearchInRadius_otherent
Free to use in the callback.
Definition common.qh:71
#define MOVE_NOTHING
Definition common.qh:35
#define LOG_TRACE(...)
Definition log.qh:74
float bound(float min, float value, float max)
entity find(entity start,.string field, string match)
float random(void)
float vlen(vector v)
vector vectoangles(vector v)
vector randomvec(void)
float sin(float f)
float min(float f,...)
vector normalize(vector v)
float fabs(float f)
void movelib_groundalign4point(entity this, float spring_length, float spring_up, float blendrate, float _max)
Pitches and rolls the entity to match the gound.
Definition movelib.qc:182
void movelib_brake_simple(entity this, float force)
Definition movelib.qc:163
vector moveto
Definition movelib.qc:4
#define movelib_move_simple(e, newdir, velo, blendrate)
Definition movelib.qh:36
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_STEP
Definition movetypes.qh:137
const int WATERLEVEL_SWIMMING
Definition movetypes.qh:13
const int WATERLEVEL_WETFEET
Definition movetypes.qh:12
const int WATERLEVEL_SUBMERGED
Definition movetypes.qh:14
const int WATERLEVEL_NONE
Definition movetypes.qh:11
float move_time
Definition movetypes.qh:81
const int MOVETYPE_FLY
Definition movetypes.qh:138
const int MOVETYPE_BOUNCE
Definition movetypes.qh:143
#define METHOD(cname, name, prototype)
Definition oo.qh:274
#define NULL
Definition post.qh:14
#define makevectors
Definition post.qh:21
#define gettaginfo
Definition post.qh:32
const int PROJECTILE_ROCKET
Definition projectiles.qh:4
#define setthink(e, f)
vector
Definition self.qh:96
vector org
Definition self.qh:96
entity entity toucher
Definition self.qh:76
#define settouch(e, f)
Definition self.qh:77
void pathlib_deletepath(entity start)
Definition main.qc:10
entity pathlib_astar(entity this, vector from, vector to)
Definition main.qc:351
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
Definition common.qc:87
const int MIF_SPLASH
Definition common.qh:58
const int MIF_GUIDED_HEAT
Definition common.qh:62
IntrusiveList g_projectiles
Definition common.qh:70
const int MIF_PROXY
Definition common.qh:60
const float VOL_BASE
Definition sound.qh:36
const int CH_WEAPON_A
Definition sound.qh:7
const float ATTEN_NORM
Definition sound.qh:30
#define sound(e, c, s, v, a)
Definition sound.qh:52
#define spawnfunc(id)
Definition spawnfunc.qh:107
vector steerlib_attract2(entity this, vector point, float min_influense, float max_distance, float max_influense)
Definition steerlib.qc:45
#define steerlib_pull(ent, point)
Uniform pull towards a point.
Definition steerlib.qc:8
vector steerto
Definition steerlib.qh:3
#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
const int DAMAGE_YES
Definition subs.qh:80
const int DAMAGE_AIM
Definition subs.qh:81
entity enemy
Definition sv_ctf.qh:152
bool turret_firecheck(entity this)
Preforms pre-fire checks based on the uints firecheck_flags.
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 ...
bool turret_closetotarget(entity this, vector targ, float range)
bool turret_initialize(entity this, Turret tur)
void turrets_setframe(entity this, float _frame, float client_only)
vector tur_shotorg
Definition sv_turrets.qh:30
entity pathcurrent
Definition sv_turrets.qh:86
entity pathgoal
Definition sv_turrets.qh:88
entity tur_head
Definition sv_turrets.qh:28
const int TELEPORT_NORMAL
entity realowner
string targetname
Definition triggers.qh:56
string target
Definition triggers.qh:55
const int TFL_TARGETSELECT_TEAMCHECK
don't attack teammates
Definition turret.qh:91
const int TUR_FLAG_HITSCAN
hit scan
Definition turret.qh:143
const int TFL_AIM_LEAD
try to predict target movement
Definition turret.qh:103
const int TFL_TARGETSELECT_PLAYERS
target players
Definition turret.qh:86
const int TFL_TARGETSELECT_RANGELIMITS
limit target selection range
Definition turret.qh:90
const int TSF_NO_PATHBREAK
don't break path to chase enemies, will still fire at them if possible
Definition turret.qh:183
const int TFL_AMMO_BULLETS
uses bullets
Definition turret.qh:162
const int TNSF_MOVE
Definition turret.qh:193
const int TFL_TARGETSELECT_LOS
require line of sight to find targets
Definition turret.qh:85
const int TFL_AMMO_RECHARGE
regenerates ammo
Definition turret.qh:164
const int TFL_AMMO_RECIEVE
can recieve ammo from support units
Definition turret.qh:165
const int TSL_ROAM
roam while idle
Definition turret.qh:185
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt().
Definition vector.qh:8
const int ANIM_STRAFE_L
Definition walker.qc:32
void walker_rocket_damage(entity this, entity inflictor, entity attacker, float damage, float deathtype,.entity weaponentity, vector hitloc, vector vforce)
Definition walker.qc:97
void walker_rocket_loop(entity this)
Definition walker.qc:198
float autocvar_g_turrets_unit_walker_melee_force
Definition walker.qc:6
void walker_rocket_touch(entity this, entity toucher)
Definition walker.qc:92
float enemy_last_time
Definition walker.qc:251
void walker_findtarget(entity this)
Definition walker.qc:329
const int ANIM_PAIN
Definition walker.qc:36
float autocvar_g_turrets_unit_walker_turn_walk
Definition walker.qc:23
const int ANIM_JUMP
Definition walker.qc:34
float autocvar_g_turrets_unit_walker_speed_jump
Definition walker.qc:19
float autocvar_g_turrets_unit_walker_rocket_damage
Definition walker.qc:8
void walker_rocket_explode(entity this)
Definition walker.qc:76
const int ANIM_ROAM
Definition walker.qc:39
const int ANIM_MELEE
Definition walker.qc:37
float autocvar_g_turrets_unit_walker_turn_run
Definition walker.qc:26
vector enemy_last_loc
Definition walker.qc:250
float autocvar_g_turrets_unit_walker_speed_roam
Definition walker.qc:21
float autocvar_g_turrets_unit_walker_speed_stop
Definition walker.qc:16
float autocvar_g_turrets_unit_walker_melee_range
Definition walker.qc:7
const int ANIM_LAND
Definition walker.qc:35
float autocvar_g_turrets_unit_walker_turn
Definition walker.qc:22
const int ANIM_STRAFE_R
Definition walker.qc:33
float autocvar_g_turrets_unit_walker_rocket_force
Definition walker.qc:10
float autocvar_g_turrets_unit_walker_speed_walk
Definition walker.qc:17
const int ANIM_NO
Definition walker.qc:28
float autocvar_g_turrets_unit_walker_rocket_range_min
Definition walker.qc:13
float autocvar_g_turrets_unit_walker_rocket_range
Definition walker.qc:12
void walker_move_path(entity this)
Definition walker.qc:282
const int ANIM_SWIM
Definition walker.qc:38
#define WALKER_ROCKET_MOVE(s)
Definition walker.qc:106
float autocvar_g_turrets_unit_walker_speed_swim
Definition walker.qc:20
float autocvar_g_turrets_unit_walker_speed_run
Definition walker.qc:18
const int ANIM_TURN
Definition walker.qc:29
void walker_move_to(entity this, vector _target, float _dist)
Definition walker.qc:252
float autocvar_g_turrets_unit_walker_melee_damage
Definition walker.qc:5
float autocvar_g_turrets_unit_walker_rocket_speed
Definition walker.qc:11
void walker_draw(entity this)
Definition walker.qc:619
const int ANIM_WALK
Definition walker.qc:30
float autocvar_g_turrets_unit_walker_rocket_radius
Definition walker.qc:9
float animflag
Definition walker.qc:41
float autocvar_g_turrets_unit_walker_rocket_refire
Definition walker.qc:14
void walker_rocket_think(entity this)
Definition walker.qc:110
const int ANIM_RUN
Definition walker.qc:31
void walker_setnoanim(entity this)
Definition walker.qc:71
void walker_melee_do_dmg(entity this)
Definition walker.qc:56
float autocvar_g_turrets_unit_walker_turn_swim
Definition walker.qc:25
void walker_fire_rocket(entity this, vector org)
Definition walker.qc:206
void walker_rocket_loop2(entity this)
Definition walker.qc:177
float idletime
Definition walker.qc:42
bool walker_firecheck(entity this)
Definition walker.qc:44
void walker_rocket_loop3(entity this)
Definition walker.qc:155
float autocvar_g_turrets_unit_walker_turn_strafe
Definition walker.qc:24
float autocvar_g_turrets_unit_walker_rocket_turnrate
Definition walker.qc:15
bool walker_melee_do_dmg_cond(entity e)
Definition walker.qc:51
void InitializeEntity(entity e, void(entity this) func, int order)
Definition world.qc:2204