60 e = findradius(where,32);
64 if (e !=
this && e.owner !=
this)
78 RadiusDamage (
this, this.
owner, (
autocvar_g_turrets_unit_walker_rocket_damage), 0, (
autocvar_g_turrets_unit_walker_rocket_radius),
this,
NULL, (
autocvar_g_turrets_unit_walker_rocket_force), DEATH_TURRET_WALK_ROCKET.m_id,
DMG_NOWEP,
NULL);
96#define WALKER_ROCKET_MOVE(s) movelib_move_simple((s), newdir, (autocvar_g_turrets_unit_walker_rocket_speed), (autocvar_g_turrets_unit_walker_rocket_turnrate)); UpdateCSQCProjectile(s)
107 edist =
vlen(this.
enemy.origin -
this.origin);
130 if (this.shot_dmg != 1337 &&
random() < 0.01)
144 itime =
max(edist / m_speed, 1);
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
358 else if (it.enemy ==
NULL)
364 if(it.enemy_last_time != 0)
366 if(
vdist(it.origin - it.enemy_last_loc, <, 128) ||
time - it.enemy_last_time > 10)
367 it.enemy_last_time = 0;
378 it.tur_head.idletime = -1337;
383 it.tur_head.idletime = -1337;
386 if(it.tur_head.idletime == -1337)
388 it.moveto = it.origin +
randomvec() * 256;
389 it.tur_head.idletime = 0;
392 it.moveto = it.moveto * 0.9 + ((it.origin +
v_forward * 500) +
randomvec() * 400) * 0.1;
393 it.moveto_z = it.origin_z + 64;
397 if(it.idletime <
time)
402 it.moveto = it.origin;
409 it.moveto = it.origin +
randomvec() * 256;
410 it.tur_head.moveto = it.moveto;
411 it.tur_head.idletime = 0;
423 wish_angle =
angleofs(it, it.enemy);
425 if (
fabs(wish_angle_y) < 15)
427 it.moveto = it.enemy.origin;
432 else if (it.tur_head.attack_finished_single[0] <
time)
434 if(it.tur_head.shot_volly)
438 it.tur_head.shot_volly = it.tur_head.shot_volly -1;
439 if(it.tur_head.shot_volly == 0)
442 it.tur_head.attack_finished_single[0] =
time + 0.2;
444 if(it.tur_head.shot_volly > 1)
453 it.tur_head.shot_volly = 4;
465 float turny = 0, turnx = 0;
531 vz = it.velocity_z +
sin(
time * 4) * 8;
543 it.angles_y += turny;
549 it.angles_x += turnx;
556 if(it.origin != it.oldorigin)
559 it.oldorigin = it.origin;
564#ifdef WALKER_FANCYPATHING
568 it.pathcurrent =
NULL;
576 setorigin(it, it.pos1);
587 it.iscreature =
true;
589 if(!it.damagedbycontents)
591 it.damagedbycontents =
true;
596 setorigin(it, it.origin);
597 tracebox(it.origin +
'0 0 128', it.mins, it.maxs, it.origin -
'0 0 10000',
MOVE_NORMAL, it);
603 it.idle_aim =
'0 0 0';
620 this.move_time =
time;
651 PAR(_(
"The %s is an arachnid-like walking turret that hunts down its targets."),
COLORED_NAME(
this));
652 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
const int TUR_FLAG_HITSCAN
int target_validate_flags
const int TFL_TARGETSELECT_PLAYERS
const int TFL_TARGETSELECT_RANGELIMITS
const int TSF_NO_PATHBREAK
const int TFL_AMMO_BULLETS
const int TFL_TARGETSELECT_LOS
const int TFL_AMMO_RECHARGE
const int TFL_AMMO_RECIEVE
#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)