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
52{
53 makevectors(this.angles);
54
55 for (entity e = findradius(this.origin + v_forward * 128, 32); e; e = e.chain)
56 {
58 && e != this && e.owner != this)
59 Damage(e, this, this,
61 DEATH_TURRET_WALK_MELEE.m_id,
63 '0 0 0',
65 );
66 }
67}
68
70{
71 turrets_setframe(this, ANIM_NO, false);
72 this.animflag = this.frame;
73}
75{
76 RadiusDamage(this, this.owner,
78 0,
80 this,
81 NULL,
83 DEATH_TURRET_WALK_ROCKET.m_id,
85 NULL
86 );
87 delete(this);
88}
89
94
95void walker_rocket_damage(entity this, entity inflictor, entity attacker, float damage, float deathtype, .entity weaponentity, vector hitloc, vector vforce)
96{
97 TakeResource(this, RES_HEALTH, damage);
98 this.velocity += vforce;
99
100 if (GetResource(this, RES_HEALTH) <= 0)
102}
103
104#define WALKER_ROCKET_MOVE(s) \
105 movelib_move_simple((s), newdir, autocvar_g_turrets_unit_walker_rocket_speed, autocvar_g_turrets_unit_walker_rocket_turnrate); \
106 UpdateCSQCProjectile(s)
107void walker_rocket_loop(entity this);
109{
110 this.nextthink = time;
111
112 float edist = vlen(this.enemy.origin - this.origin);
113
114 // Simulate crude guidance
115 if (this.cnt < time)
116 {
117 this.tur_shotorg = randomvec() * min(edist, (edist < 1000 ? 64 : 256));
118 this.cnt = time + 0.5;
119 }
120
121 if (edist < 128)
122 this.tur_shotorg = '0 0 0';
123
124 if (this.max_health < time)
125 {
127 this.nextthink = time;
128 return;
129 }
130
131 if (this.shot_dmg != 1337 && random() < 0.01)
132 {
133 walker_rocket_loop(this);
134 return;
135 }
136
137 // Enemy dead? just keep on the current heading then.
138 if (this.enemy == NULL || IS_DEAD(this.enemy))
139 this.enemy = NULL;
140
141 vector newdir;
142 if (this.enemy)
143 {
144 //float itime = max(edist / vlen(this.velocity), 1);
145 newdir = steerlib_pull(this, this.enemy.origin + this.tur_shotorg);
146 }
147 else
148 newdir = normalize(this.velocity);
149
150 WALKER_ROCKET_MOVE(this);
151}
152
154{
155 this.nextthink = time;
156
157 if (this.max_health < time)
158 {
160 return;
161 }
162
163 if (vdist(this.origin - this.tur_shotorg, <, 100))
164 {
166 return;
167 }
168
169 vector newdir = steerlib_pull(this, this.tur_shotorg);
170 WALKER_ROCKET_MOVE(this);
171
172 this.angles = vectoangles(this.velocity);
173}
174
176{
177 this.nextthink = time;
178
179 if (this.max_health < time)
180 {
182 return;
183 }
184
185 if (vdist(this.origin - this.tur_shotorg, <, 100))
186 {
187 this.tur_shotorg = this.origin - '0 0 200';
189 return;
190 }
191
192 vector newdir = steerlib_pull(this, this.tur_shotorg);
193 WALKER_ROCKET_MOVE(this);
194}
195
197{
198 this.nextthink = time;
199 this.tur_shotorg = this.origin + '0 0 300';
201 this.shot_dmg = 1337;
202}
203
205{
207
208 te_explosion (org);
209
210 entity rocket = new(walker_rocket);
211 setorigin(rocket, org);
212 rocket.solid = SOLID_BBOX; // before setsize so it will be linked to the area grid
213 sound(this, CH_WEAPON_A, SND_TUR_WALKER_FIRE, VOL_BASE, ATTEN_NORM);
214 setsize(rocket, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
215
216 rocket.owner = this;
217 rocket.bot_dodge = true;
218 rocket.bot_dodgerating = 50;
219 rocket.takedamage = DAMAGE_YES;
220 rocket.damageforcescale = 2;
221 SetResourceExplicit(rocket, RES_HEALTH, 25);
222 rocket.tur_shotorg = randomvec() * 512;
223 rocket.cnt = time + 1;
224 rocket.enemy = this.enemy;
225
226 if (random() < 0.01)
228 else
230
231 rocket.event_damage = walker_rocket_damage;
232
233 rocket.nextthink = time;
234 set_movetype(rocket, MOVETYPE_FLY);
235 rocket.velocity = normalize((v_forward + v_up * 0.5) + (randomvec() * 0.2)) * autocvar_g_turrets_unit_walker_rocket_speed;
236 rocket.angles = vectoangles(rocket.velocity);
238 rocket.flags = FL_PROJECTILE;
239 IL_PUSH(g_projectiles, rocket);
240 IL_PUSH(g_bot_dodge, rocket);
241 rocket.max_health = time + 9;
242 rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
243
244 CSQCProjectile(rocket, false, PROJECTILE_ROCKET, false); // no culling, has fly sound
245}
246
249void walker_move_to(entity this, vector _target, float _dist)
250{
251 switch (this.waterlevel)
252 {
253 case WATERLEVEL_NONE:
254 if (_dist > 500)
255 this.animflag = ANIM_RUN;
256 else
257 this.animflag = ANIM_WALK;
260 if (this.animflag != ANIM_SWIM)
261 this.animflag = ANIM_WALK;
262 else
263 this.animflag = ANIM_SWIM;
264 break;
266 this.animflag = ANIM_SWIM;
267 }
268
269 this.moveto = _target;
270 this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
271
272 if (this.enemy)
273 {
274 this.enemy_last_loc = _target;
275 this.enemy_last_time = time;
276 }
277}
278
280{
281#ifdef WALKER_FANCYPATHING
282 // Are we close enougth to a path node to switch to the next?
283 if (turret_closetotarget(this, this.pathcurrent.origin, 64))
284 {
285 if (this.pathcurrent.path_next == NULL)
286 {
287 // Path endpoint reached
289 this.pathcurrent = NULL;
290
291 if (this.pathgoal)
292 {
293 if (this.pathgoal.use)
294 this.pathgoal.use(this, NULL, NULL);
295
296 if (this.pathgoal.enemy)
297 {
298 this.pathcurrent = pathlib_astar(this, this.pathgoal.origin, this.pathgoal.enemy.origin);
299 this.pathgoal = this.pathgoal.enemy;
300 }
301 }
302 else
303 this.pathgoal = NULL;
304 }
305 else
306 this.pathcurrent = this.pathcurrent.path_next;
307 }
308
309 this.moveto = this.pathcurrent.origin;
310 this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
311 walker_move_to(this, this.moveto, 0);
312
313#else
314 if (turret_closetotarget(this, this.pathcurrent.origin, 64))
315 this.pathcurrent = this.pathcurrent.enemy;
316
317 if (!this.pathcurrent)
318 return;
319
320 this.moveto = this.pathcurrent.origin;
321 this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
322 walker_move_to(this, this.moveto, 0);
323#endif
324}
325
327{
328 entity e = find(NULL, targetname, this.target);
329 if (!e)
330 {
331 LOG_TRACE("Initital waypoint for walker does NOT exist, fix your map!");
332 this.target = "";
333 }
334
335 if (e.classname != "turret_checkpoint")
336 LOG_TRACE("Warning: not a turrret path");
337 else
338 {
339#ifdef WALKER_FANCYPATHING
340 this.pathcurrent = pathlib_astar(this, this.origin, e.origin);
341 this.pathgoal = e;
342#else
343 this.pathcurrent = e;
344#endif
345 }
346
347 // TODO: this doesn't reset target, so tur_defend will be the checkpoint too!
348}
349
350spawnfunc(turret_walker)
351{
352 if (!turret_initialize(this, TUR_WALKER))
353 delete(this);
354}
355
356METHOD(WalkerTurret, tr_think, void(WalkerTurret thistur, entity it))
357{
358 fixedmakevectors(it.angles);
359
360 if ((it.spawnflags & TSF_NO_PATHBREAK) && it.pathcurrent)
362 else if (it.enemy == NULL)
363 {
364 if (it.pathcurrent)
366 else
367 {
368 if (it.enemy_last_time != 0)
369 {
370 if (vdist(it.origin - it.enemy_last_loc, <, 128) || time - it.enemy_last_time > 10)
371 it.enemy_last_time = 0;
372 else
373 walker_move_to(it, it.enemy_last_loc, 0);
374 }
375 else
376 {
377 if (it.animflag != ANIM_NO)
378 {
379 traceline(it.origin + '0 0 64', it.origin + '0 0 64' + v_forward * 128, MOVE_NORMAL, it);
380
381 if (trace_fraction != 1.0)
382 it.tur_head.idletime = -1337;
383 else
384 {
385 traceline(trace_endpos, trace_endpos - '0 0 256', MOVE_NORMAL, it);
386 if (trace_fraction == 1.0)
387 it.tur_head.idletime = -1337;
388 }
389
390 if (it.tur_head.idletime == -1337)
391 {
392 it.moveto = it.origin + randomvec() * 256;
393 it.tur_head.idletime = 0;
394 }
395
396 it.moveto = it.moveto * 0.9 + ((it.origin + v_forward * 500) + randomvec() * 400) * 0.1;
397 it.moveto.z = it.origin.z + 64;
398 walker_move_to(it, it.moveto, 0);
399 }
400
401 if (it.idletime < time)
402 {
403 if (random() < 0.5 || !(it.spawnflags & TSL_ROAM))
404 {
405 it.idletime = time + 1 + random() * 5;
406 it.moveto = it.origin;
407 it.animflag = ANIM_NO;
408 }
409 else
410 {
411 it.animflag = ANIM_WALK;
412 it.idletime = time + 4 + random() * 2;
413 it.moveto = it.origin + randomvec() * 256;
414 it.tur_head.moveto = it.moveto;
415 it.tur_head.idletime = 0;
416 }
417 }
418 }
419 }
420 }
421 else
422 {
423 if (it.tur_dist_enemy < autocvar_g_turrets_unit_walker_melee_range && it.animflag != ANIM_MELEE)
424 {
425 vector wish_angle = angleofs(it, it.enemy);
426
427 if (it.animflag != ANIM_SWIM
428 && fabs(wish_angle.y) < 15)
429 {
430 it.moveto = it.enemy.origin;
431 it.steerto = steerlib_attract2(it, it.moveto, 0.5, 500, 0.95);
432 it.animflag = ANIM_MELEE;
433 }
434 }
435 else if (it.tur_head.attack_finished_single[0] < time)
436 {
437 if (it.tur_head.shot_volly)
438 {
439 it.animflag = ANIM_NO;
440
441 --it.tur_head.shot_volly;
442 if (it.tur_head.shot_volly == 0)
443 it.tur_head.attack_finished_single[0] = time + autocvar_g_turrets_unit_walker_rocket_refire;
444 else
445 it.tur_head.attack_finished_single[0] = time + 0.2;
446
447 walker_fire_rocket(it, gettaginfo(it, gettagindex(it, (it.tur_head.shot_volly > 1 ? "tag_rocket01" : "tag_rocket02"))));
448 }
449 else
450 {
452 && it.tur_dist_enemy < (autocvar_g_turrets_unit_walker_rocket_range))
453 it.tur_head.shot_volly = 4;
454 }
455 }
456 else
457 {
458 if (it.animflag != ANIM_MELEE)
459 walker_move_to(it, it.enemy.origin, it.tur_dist_enemy);
460 }
461 }
462
463 {
464 vector real_angle;
465 float turny = 0, turnx = 0;
466 float vz;
467
468 real_angle = vectoangles(it.steerto) - it.angles;
469 vz = it.velocity.z;
470
471 switch (it.animflag)
472 {
473 case ANIM_NO:
475 break;
476
477 case ANIM_TURN:
480 break;
481
482 case ANIM_WALK:
485 break;
486
487 case ANIM_RUN:
490 break;
491
492 case ANIM_STRAFE_L:
495 break;
496
497 case ANIM_STRAFE_R:
500 break;
501
502 case ANIM_JUMP:
504 break;
505
506 case ANIM_LAND:
507 break;
508
509 case ANIM_PAIN:
510 if (it.frame != ANIM_PAIN)
511 defer(it, 0.25, walker_setnoanim);
512 break;
513
514 case ANIM_MELEE:
515 if (it.frame != ANIM_MELEE)
516 {
517 defer(it, 0.41, walker_setnoanim);
518 defer(it, 0.21, walker_melee_do_dmg);
519 }
520
522 break;
523
524 case ANIM_SWIM:
527
528 it.angles.x += bound(-10, shortangle_f(real_angle.x, it.angles.x), 10);
530 vz = it.velocity.z + sin(time * 4) * 8;
531 break;
532
533 case ANIM_ROAM:
536 break;
537 }
538
539 if (turny)
540 {
541 turny = bound(-turny, shortangle_f(real_angle.y, it.angles.y), turny);
542 it.angles.y += turny;
543 }
544 if (turnx)
545 {
546 turnx = bound(-turnx, shortangle_f(real_angle.x, it.angles.x), turnx);
547 it.angles.x += turnx;
548 }
549
550 it.velocity.z = vz;
551 }
552
553
554 if (it.origin != it.oldorigin)
555 it.SendFlags |= TNSF_MOVE;
556
557 it.oldorigin = it.origin;
558 turrets_setframe(it, it.animflag, false);
559}
560METHOD(WalkerTurret, tr_death, void(WalkerTurret this, entity it))
561{
562#ifdef WALKER_FANCYPATHING
563 if (it.pathcurrent)
564 pathlib_deletepath(it.pathcurrent.owner);
565#endif
566 it.pathcurrent = NULL;
567}
568METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))
569{
570 // Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn.
571 if (it.move_movetype == MOVETYPE_WALK)
572 {
573 if (it.pos1)
574 setorigin(it, it.pos1);
575 if (it.pos2)
576 it.angles = it.pos2;
577 }
578
580 it.aim_flags = TFL_AIM_LEAD;
581 it.turret_flags |= TUR_FLAG_HITSCAN;
582
585 it.iscreature = true;
586 it.teleportable = TELEPORT_NORMAL;
587 if (!it.damagedbycontents)
589 it.damagedbycontents = true;
590 it.solid = SOLID_SLIDEBOX;
591 it.takedamage = DAMAGE_AIM;
592 if (it.move_movetype != MOVETYPE_WALK)
593 {
594 setorigin(it, it.origin);
595 tracebox(it.origin + '0 0 128', it.mins, it.maxs, it.origin - '0 0 10000', MOVE_NORMAL, it);
596 setorigin(it, trace_endpos + '0 0 4');
597 it.pos1 = it.origin;
598 it.pos2 = it.angles;
599 }
601 it.idle_aim = '0 0 0';
602 it.turret_firecheckfunc = walker_firecheck;
603
604 if (it.target != "")
606}
607
608#undef WALKER_ROCKET_MOVE
609
610#endif // SVQC
611#ifdef CSQC
612
614
616{
617 float dt = time - this.move_time;
618 this.move_time = time;
619 if (dt <= 0)
620 return;
621
623 movelib_groundalign4point(this, 300, 100, 0.25, 45);
624 setorigin(this, this.origin + this.velocity * dt);
625 this.tur_head.angles += dt * this.tur_head.avelocity;
626
627 if (GetResource(this, RES_HEALTH) < 127
628 && random() < 0.15)
629 te_spark(this.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
630}
631
632METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))
633{
634 it.gravity = 1;
636 it.move_time = time;
637 it.draw = walker_draw;
638}
639
640#endif // CSQC
641#ifdef MENUQC
644
645METHOD(WalkerTurret, describe, string(WalkerTurret this))
646{
647 TC(WalkerTurret, this);
649 PAR(_("The %s is an arachnid-like walking turret that hunts down its targets."), COLORED_NAME(this));
650 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. "
651 "It also has the ability to melee close by targets."), COLORED_NAME(WEP_MACHINEGUN), COLORED_NAME(WEP_DEVASTATOR));
652 return PAGE_TEXT;
653}
654
655#endif // MENUQC
ERASEABLE float shortangle_f(float ang1, float ang2)
Definition angle.qc:29
#define angleofs(from, to)
Definition angle.qc:88
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.
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
float cnt
Definition powerups.qc:24
entity owner
Definition main.qh:87
#define COLORED_NAME(this)
Definition color.qh:195
#define IS_DEAD(s)
Definition player.qh:244
float waterlevel
Definition player.qh:225
const int FL_PROJECTILE
Definition constants.qh:85
const int INITPRIO_FINDTARGET
Definition constants.qh:96
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:493
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:943
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:29
#define gettagindex
ent angles
Definition ent_cs.qc:121
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define TC(T, sym)
Definition _all.inc:82
#define LOG_TRACE(...)
Definition log.qh:76
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_WALK
Definition movetypes.qh:132
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:77
const int MOVETYPE_FLY
Definition movetypes.qh:134
const int MOVETYPE_BOUNCE
Definition movetypes.qh:139
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#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:92
vector org
Definition self.qh:92
entity entity toucher
Definition self.qh:72
#define settouch(e, f)
Definition self.qh:73
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:46
const int MIF_GUIDED_HEAT
Definition common.qh:50
IntrusiveList g_projectiles
Definition common.qh:58
const int MIF_PROXY
Definition common.qh:48
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:96
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:642
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:648
#define PAGE_TEXT_INIT()
Definition string.qh:641
const int DAMAGE_YES
Definition subs.qh:80
const int DAMAGE_AIM
Definition subs.qh:81
entity enemy
Definition sv_ctf.qh:153
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
string targetname
Definition triggers.qh:56
string target
Definition triggers.qh:55
const int TFL_TARGETSELECT_TEAMCHECK
don't attack teammates
Definition turret.qh:88
const int TUR_FLAG_HITSCAN
hit scan
Definition turret.qh:140
int target_validate_flags
Definition turret.qh:80
const int TFL_AIM_LEAD
try to predict target movement
Definition turret.qh:100
const int TFL_TARGETSELECT_PLAYERS
target players
Definition turret.qh:83
const int TFL_TARGETSELECT_RANGELIMITS
limit target selection range
Definition turret.qh:87
const int TSF_NO_PATHBREAK
don't break path to chase enemies, will still fire at them if possible
Definition turret.qh:180
const int TFL_AMMO_BULLETS
uses bullets
Definition turret.qh:159
const int TNSF_MOVE
Definition turret.qh:190
const int TFL_TARGETSELECT_LOS
require line of sight to find targets
Definition turret.qh:82
const int TFL_AMMO_RECHARGE
regenerates ammo
Definition turret.qh:161
const int TFL_AMMO_RECIEVE
can recieve ammo from support units
Definition turret.qh:162
const int TSL_ROAM
roam while idle
Definition turret.qh:182
#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:95
void walker_rocket_loop(entity this)
Definition walker.qc:196
float autocvar_g_turrets_unit_walker_melee_force
Definition walker.qc:6
void walker_rocket_touch(entity this, entity toucher)
Definition walker.qc:90
float enemy_last_time
Definition walker.qc:248
void walker_findtarget(entity this)
Definition walker.qc:326
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:74
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:247
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:279
const int ANIM_SWIM
Definition walker.qc:38
#define WALKER_ROCKET_MOVE(s)
Definition walker.qc:104
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:249
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:615
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:108
const int ANIM_RUN
Definition walker.qc:31
void walker_setnoanim(entity this)
Definition walker.qc:69
void walker_melee_do_dmg(entity this)
Definition walker.qc:51
float autocvar_g_turrets_unit_walker_turn_swim
Definition walker.qc:25
void walker_fire_rocket(entity this, vector org)
Definition walker.qc:204
void walker_rocket_loop2(entity this)
Definition walker.qc:175
float idletime
Definition walker.qc:42
bool walker_firecheck(entity this)
Definition walker.qc:44
void walker_rocket_loop3(entity this)
Definition walker.qc:153
float autocvar_g_turrets_unit_walker_turn_strafe
Definition walker.qc:24
float autocvar_g_turrets_unit_walker_rocket_turnrate
Definition walker.qc:15
void InitializeEntity(entity e, void(entity this) func, int order)
Definition world.qc:2230