5 float autocvar_g_turrets_unit_ewheel_speed_fast;
6 float autocvar_g_turrets_unit_ewheel_speed_slow;
7 float autocvar_g_turrets_unit_ewheel_speed_slower;
8 float autocvar_g_turrets_unit_ewheel_speed_stop;
9 float autocvar_g_turrets_unit_ewheel_turnrate;
11 const int ewheel_anim_stop = 0;
12 const int ewheel_anim_fwd_slow = 1;
13 const int ewheel_anim_fwd_fast = 2;
14 const int ewheel_anim_bck_slow = 3;
15 const int ewheel_anim_bck_fast = 4;
17 void ewheel_move_path(
entity this)
22 #ifdef EWHEEL_FANCYPATH 55 movelib_move_simple(
this,
v_forward, (autocvar_g_turrets_unit_ewheel_speed_fast), 0.4);
59 void ewheel_move_enemy(
entity this)
69 if ( this.
tur_head.spawnshieldtime < 1 )
71 newframe = ewheel_anim_fwd_fast;
72 movelib_move_simple(
this,
v_forward, (autocvar_g_turrets_unit_ewheel_speed_fast), 0.4);
74 else if (this.
tur_head.spawnshieldtime < 2)
77 newframe = ewheel_anim_fwd_slow;
78 movelib_move_simple(
this,
v_forward, (autocvar_g_turrets_unit_ewheel_speed_slow), 0.4);
82 newframe = ewheel_anim_fwd_slow;
83 movelib_move_simple(
this,
v_forward, (autocvar_g_turrets_unit_ewheel_speed_slower), 0.4);
88 newframe = ewheel_anim_bck_slow;
89 movelib_move_simple(
this,
v_forward * -1, (autocvar_g_turrets_unit_ewheel_speed_slow), 0.4);
93 newframe = ewheel_anim_stop;
94 movelib_brake_simple(
this, (autocvar_g_turrets_unit_ewheel_speed_stop));
100 void ewheel_move_idle(
entity this)
110 movelib_brake_simple(
this, (autocvar_g_turrets_unit_ewheel_speed_stop));
113 void ewheel_findtarget(
entity this)
118 LOG_TRACE(
"Initital waypoint for ewheel does NOT exist, fix your map!");
122 if (e.classname !=
"turret_checkpoint")
127 #ifdef EWHEEL_FANCYPATH 140 vector wish_angle, real_angle;
142 float vz = it.velocity_z;
151 real_angle = wish_angle - it.angles;
154 it.tur_head.spawnshieldtime =
fabs(real_angle_y);
155 real_angle_y =
bound(-it.tur_head.aim_speed, real_angle_y, it.tur_head.aim_speed);
156 it.angles_y = (it.angles_y + real_angle_y);
159 ewheel_move_enemy(it);
160 else if(it.pathcurrent)
161 ewheel_move_path(it);
163 ewheel_move_idle(it);
173 it.velocity =
'0 0 0';
175 #ifdef EWHEEL_FANCYPATH 179 it.pathcurrent =
NULL;
186 it.velocity =
'0 0 0';
195 it.iscreature =
true;
197 if(!it.damagedbycontents)
199 it.damagedbycontents =
true;
203 it.idle_aim =
'0 0 0';
207 it.frame = it.tur_head.frame = 1;
211 it.tur_head.aim_speed = (autocvar_g_turrets_unit_ewheel_turnrate);
212 it.tur_head.aim_speed = it.tur_head.aim_speed / (1 / it.ticrate);
218 void ewheel_draw(
entity this)
223 this.move_time =
time;
241 it.draw = ewheel_draw;
const float SOLID_SLIDEBOX
ERASEABLE float anglemods(float v)
const int TELEPORT_NORMAL
entity pathlib_astar(entity this, vector from, vector to)
IntrusiveList g_damagedbycontents
bool turret_initialize(entity this, Turret tur)
spawnfunc(info_player_attacker)
void turrets_setframe(entity this, float _frame, float client_only)
#define METHOD(cname, name, prototype)
const int TFL_AMMO_RECHARGE
const int TFL_TARGETSELECT_PLAYERS
const int TFL_TARGETSELECT_LOS
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
const int TFL_AMMO_RECIEVE
vector steerlib_arrive(entity this, vector point, float maximal_distance)
Pull toward a point, The further away, the stronger the pull.
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const int TFL_TARGETSELECT_TEAMCHECK
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
void InitializeEntity(entity e, void(entity this) func, int order)
vector steerlib_attract2(entity this, vector point, float min_influense, float max_distance, float max_influense)
bool turret_closetotarget(entity this, vector targ)
const int TFL_AMMO_ENERGY
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
ERASEABLE vector shortangle_vxy(vector ang1, vector ang2)
void pathlib_deletepath(entity start)
void set_movetype(entity this, int mt)
const int TFL_TARGETSELECT_RANGELIMITS