64 DEATH_TURRET_WALK_MELEE.m_id,
66 e.WarpZone_findradius_nearest,
85 DEATH_TURRET_WALK_ROCKET.m_id,
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)
114 float edist =
vlen(this.
enemy.origin -
this.origin);
133 if (this.shot_dmg != 1337 &&
random() < 0.01)
203 this.shot_dmg = 1337;
212 entity rocket =
new(walker_rocket);
213 setorigin(rocket,
org);
216 setsize(rocket,
'-3 -3 -3',
'3 3 3');
218 rocket.realowner =
this;
220 rocket.bot_dodge =
true;
221 rocket.bot_dodgerating = 50;
223 rocket.damageforcescale = 2;
226 rocket.cnt =
time + 1;
227 rocket.enemy = this.
enemy;
236 rocket.nextthink =
time;
244 rocket.max_health =
time + 9;
284#ifdef WALKER_FANCYPATHING
334 LOG_TRACE(
"Initital waypoint for walker does NOT exist, fix your map!");
338 if (e.classname !=
"turret_checkpoint")
339 LOG_TRACE(
"Warning: not a turrret path");
342#ifdef WALKER_FANCYPATHING
365 else if (it.enemy ==
NULL)
371 if (it.enemy_last_time != 0)
373 if (
vdist(it.origin - it.enemy_last_loc, <, 128) ||
time - it.enemy_last_time > 10)
374 it.enemy_last_time = 0;
385 it.tur_head.idletime = -1337;
390 it.tur_head.idletime = -1337;
393 if (it.tur_head.idletime == -1337)
395 it.moveto = it.origin +
randomvec() * 256;
396 it.tur_head.idletime = 0;
399 it.moveto = it.moveto * 0.9 + ((it.origin +
v_forward * 500) +
randomvec() * 400) * 0.1;
400 it.moveto.z = it.origin.z + 64;
404 if (it.idletime <
time)
409 it.moveto = it.origin;
416 it.moveto = it.origin +
randomvec() * 256;
417 it.tur_head.moveto = it.moveto;
418 it.tur_head.idletime = 0;
431 &&
fabs(wish_angle.y) < 15)
433 it.moveto = it.enemy.origin;
438 else if (it.tur_head.attack_finished_single[0] <
time)
440 if (it.tur_head.shot_volly)
444 --it.tur_head.shot_volly;
445 if (it.tur_head.shot_volly == 0)
448 it.tur_head.attack_finished_single[0] =
time + 0.2;
456 it.tur_head.shot_volly = 4;
468 float turny = 0, turnx = 0;
533 vz = it.velocity.z +
sin(
time * 4) * 8;
545 it.angles.y += turny;
550 it.angles.x += turnx;
557 if (it.origin != it.oldorigin || it.velocity != it.oldvelocity)
560 it.oldorigin = it.origin;
561 it.oldvelocity = it.velocity;
566#ifdef WALKER_FANCYPATHING
570 it.pathcurrent =
NULL;
578 setorigin(it, it.pos1);
589 it.iscreature =
true;
591 if (!it.damagedbycontents)
593 it.damagedbycontents =
true;
598 setorigin(it, it.origin);
599 tracebox(it.origin +
'0 0 128', it.mins, it.maxs, it.origin -
'0 0 10000',
MOVE_NORMAL, it);
605 it.idle_aim =
'0 0 0';
612#undef WALKER_ROCKET_MOVE
622 this.move_time =
time;
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. "
ERASEABLE float shortangle_f(float ang1, float ang2)
Return the short angle.
#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.
#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.
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
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.
vector WarpZone_TransformVelocity(entity wz, vector vel)
Transforms velocity v across warpzone wz.
#define WarpZone_TraceLine(org, end, nomonsters, forent)
noref entity WarpZone_SearchInRadius_otherent
Free to use in the callback.
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
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
bool walker_melee_do_dmg_cond(entity e)
void InitializeEntity(entity e, void(entity this) func, int order)