58 && e !=
this && e.owner !=
this)
61 DEATH_TURRET_WALK_MELEE.m_id,
83 DEATH_TURRET_WALK_ROCKET.m_id,
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)
112 float edist =
vlen(this.
enemy.origin -
this.origin);
131 if (this.shot_dmg != 1337 &&
random() < 0.01)
201 this.shot_dmg = 1337;
210 entity rocket =
new(walker_rocket);
211 setorigin(rocket,
org);
214 setsize(rocket,
'-3 -3 -3',
'3 3 3');
217 rocket.bot_dodge =
true;
218 rocket.bot_dodgerating = 50;
220 rocket.damageforcescale = 2;
223 rocket.cnt =
time + 1;
224 rocket.enemy = this.
enemy;
233 rocket.nextthink =
time;
241 rocket.max_health =
time + 9;
281#ifdef WALKER_FANCYPATHING
331 LOG_TRACE(
"Initital waypoint for walker does NOT exist, fix your map!");
335 if (e.classname !=
"turret_checkpoint")
336 LOG_TRACE(
"Warning: not a turrret path");
339#ifdef WALKER_FANCYPATHING
362 else if (it.enemy ==
NULL)
368 if (it.enemy_last_time != 0)
370 if (
vdist(it.origin - it.enemy_last_loc, <, 128) ||
time - it.enemy_last_time > 10)
371 it.enemy_last_time = 0;
382 it.tur_head.idletime = -1337;
387 it.tur_head.idletime = -1337;
390 if (it.tur_head.idletime == -1337)
392 it.moveto = it.origin +
randomvec() * 256;
393 it.tur_head.idletime = 0;
396 it.moveto = it.moveto * 0.9 + ((it.origin +
v_forward * 500) +
randomvec() * 400) * 0.1;
397 it.moveto.z = it.origin.z + 64;
401 if (it.idletime <
time)
406 it.moveto = it.origin;
413 it.moveto = it.origin +
randomvec() * 256;
414 it.tur_head.moveto = it.moveto;
415 it.tur_head.idletime = 0;
428 &&
fabs(wish_angle.y) < 15)
430 it.moveto = it.enemy.origin;
435 else if (it.tur_head.attack_finished_single[0] <
time)
437 if (it.tur_head.shot_volly)
441 --it.tur_head.shot_volly;
442 if (it.tur_head.shot_volly == 0)
445 it.tur_head.attack_finished_single[0] =
time + 0.2;
453 it.tur_head.shot_volly = 4;
465 float turny = 0, turnx = 0;
530 vz = it.velocity.z +
sin(
time * 4) * 8;
542 it.angles.y += turny;
547 it.angles.x += turnx;
554 if (it.origin != it.oldorigin)
557 it.oldorigin = it.origin;
562#ifdef WALKER_FANCYPATHING
566 it.pathcurrent =
NULL;
574 setorigin(it, it.pos1);
585 it.iscreature =
true;
587 if (!it.damagedbycontents)
589 it.damagedbycontents =
true;
594 setorigin(it, it.origin);
595 tracebox(it.origin +
'0 0 128', it.mins, it.maxs, it.origin -
'0 0 10000',
MOVE_NORMAL, it);
601 it.idle_aim =
'0 0 0';
608#undef WALKER_ROCKET_MOVE
618 this.move_time =
time;
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. "
ERASEABLE float shortangle_f(float ang1, float ang2)
#define angleofs(from, to)
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
IntrusiveList g_bot_dodge
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
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.
#define COLORED_NAME(this)
const int INITPRIO_FINDTARGET
const float SOLID_SLIDEBOX
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)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
IntrusiveList g_damagedbycontents
void defer(entity this, float fdelay, void(entity) func)
Execute func() after time + fdelay.
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void movelib_groundalign4point(entity this, float spring_length, float spring_up, float blendrate, float _max)
Pitches and rolls the entity to match the gound.
void movelib_brake_simple(entity this, float force)
#define movelib_move_simple(e, newdir, velo, blendrate)
void set_movetype(entity this, int mt)
const int WATERLEVEL_SWIMMING
const int WATERLEVEL_WETFEET
const int WATERLEVEL_SUBMERGED
const int WATERLEVEL_NONE
const int MOVETYPE_BOUNCE
#define METHOD(cname, name, prototype)
const int PROJECTILE_ROCKET
void pathlib_deletepath(entity start)
entity pathlib_astar(entity this, vector from, vector to)
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
const int MIF_GUIDED_HEAT
IntrusiveList g_projectiles
#define sound(e, c, s, v, a)
vector steerlib_attract2(entity this, vector point, float min_influense, float max_distance, float max_influense)
#define steerlib_pull(ent, point)
Uniform pull towards a point.
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
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)
const int TELEPORT_NORMAL
const int TFL_TARGETSELECT_TEAMCHECK
don't attack teammates
const int TUR_FLAG_HITSCAN
hit scan
int target_validate_flags
const int TFL_AIM_LEAD
try to predict target movement
const int TFL_TARGETSELECT_PLAYERS
target players
const int TFL_TARGETSELECT_RANGELIMITS
limit target selection range
const int TSF_NO_PATHBREAK
don't break path to chase enemies, will still fire at them if possible
const int TFL_AMMO_BULLETS
uses bullets
const int TFL_TARGETSELECT_LOS
require line of sight to find targets
const int TFL_AMMO_RECHARGE
regenerates ammo
const int TFL_AMMO_RECIEVE
can recieve ammo from support units
const int TSL_ROAM
roam while idle
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void walker_rocket_damage(entity this, entity inflictor, entity attacker, float damage, float deathtype,.entity weaponentity, vector hitloc, vector vforce)
void walker_rocket_loop(entity this)
float autocvar_g_turrets_unit_walker_melee_force
void walker_rocket_touch(entity this, entity toucher)
void walker_findtarget(entity this)
float autocvar_g_turrets_unit_walker_turn_walk
float autocvar_g_turrets_unit_walker_speed_jump
float autocvar_g_turrets_unit_walker_rocket_damage
void walker_rocket_explode(entity this)
float autocvar_g_turrets_unit_walker_turn_run
float autocvar_g_turrets_unit_walker_speed_roam
float autocvar_g_turrets_unit_walker_speed_stop
float autocvar_g_turrets_unit_walker_melee_range
float autocvar_g_turrets_unit_walker_turn
float autocvar_g_turrets_unit_walker_rocket_force
float autocvar_g_turrets_unit_walker_speed_walk
float autocvar_g_turrets_unit_walker_rocket_range_min
float autocvar_g_turrets_unit_walker_rocket_range
void walker_move_path(entity this)
#define WALKER_ROCKET_MOVE(s)
float autocvar_g_turrets_unit_walker_speed_swim
float autocvar_g_turrets_unit_walker_speed_run
void walker_move_to(entity this, vector _target, float _dist)
float autocvar_g_turrets_unit_walker_melee_damage
float autocvar_g_turrets_unit_walker_rocket_speed
void walker_draw(entity this)
float autocvar_g_turrets_unit_walker_rocket_radius
float autocvar_g_turrets_unit_walker_rocket_refire
void walker_rocket_think(entity this)
void walker_setnoanim(entity this)
void walker_melee_do_dmg(entity this)
float autocvar_g_turrets_unit_walker_turn_swim
void walker_fire_rocket(entity this, vector org)
void walker_rocket_loop2(entity this)
bool walker_firecheck(entity this)
void walker_rocket_loop3(entity this)
float autocvar_g_turrets_unit_walker_turn_strafe
float autocvar_g_turrets_unit_walker_rocket_turnrate
void InitializeEntity(entity e, void(entity this) func, int order)