18 float c, savesolid, shottime;
28 savesolid = targ.solid;
30 o = (targ.absmin + targ.absmax) * 0.5;
31 shottime = ((
vlen(o - org) / shotspeed) + shotdelay);
32 v = targ.velocity * shottime + o;
33 tracebox(o, targ.mins, targ.maxs, v,
false, targ);
35 end = v + (targ.mins + targ.maxs) * 0.5;
36 if ((
vlen(end - org) / shotspeed + 0.2) > maxtime)
39 targ.solid = savesolid;
62 targ.solid = savesolid;
77 targ.solid = savesolid;
114 if (targ.team ==
this.team)
123 if(STAT(FROZEN, targ))
134 if (!targ.takedamage)
142 if(targ.alpha <= 0.1 && targ.alpha != 0)
188 float dist, delta_t, blend;
189 vector desiredang, diffang;
205 float skill_save =
skill;
221 if (desiredang.x >= 180)
222 desiredang.x = desiredang.x - 360;
223 desiredang.x =
bound(-90, 0 - desiredang.x, 90);
237 diffang.y = diffang.y -
floor(diffang.y / 360) * 360;
238 if (diffang.y >= 180)
239 diffang.y = diffang.y - 360;
244 this.bot_prevaimtime =
time;
259 desiredang = desiredang + blend *
267 desiredang.x =
bound(-90, desiredang.x, 90);
272 diffang.y = diffang.y -
floor(diffang.y / 360) * 360;
273 if (diffang.y >= 180)
274 diffang.y = diffang.y - 360;
285 diffang = this.bot_mouseaim - desiredang;
287 diffang.y = diffang.y -
floor(diffang.y / 360) * 360;
288 if (diffang.y >= 180)
289 diffang.y = diffang.y - 360;
293 diffang = desiredang - this.
v_angle;
295 diffang.y = diffang.y -
floor(diffang.y / 360) * 360;
296 if (diffang.y >= 180)
297 diffang.y = diffang.y - 360;
301 dist =
vlen(diffang);
305 float r, fixedrate, blendrate;
308 r =
max(fixedrate, blendrate);
314 this.v_angle_y = this.v_angle.y -
floor(this.v_angle.y / 360) * 360;
334 if (maxfiredeviation <= 0)
360 return targorigin + targvelocity * (shotdelay +
vlen(targorigin -
shotorg) / shotspeed);
363 bool bot_aim(
entity this, .
entity weaponentity,
float shotspeed,
float shotspeedupward,
float maxshottime,
bool applygravity)
365 float r, hf, distanceratio;
371 shotspeed *= speed_factor;
372 shotspeedupward *= speed_factor;
375 LOG_TRACE(
"bot_aim: WARNING: weapon ", this.(weaponentity).m_weapon.m_name,
" shotspeed is zero!");
380 LOG_TRACE(
"bot_aim: WARNING: weapon ", this.(weaponentity).m_weapon.m_name,
" maxshottime is zero!");
388 distanceratio =
bound(0,distanceratio,1);
#define PHYS_INPUT_BUTTON_CHAT(s)
vector bot_1st_order_aimfilter
float autocvar_bot_ai_aimskill_order_mix_4th
float autocvar_bot_ai_aimskill_order_mix_1st
float findtrajectorywithleading(vector org, vector m1, vector m2, entity targ, float shotspeed, float shotspeedupward, float maxtime, float shotdelay, entity ignore)
float autocvar_bot_ai_aimskill_blendrate
vector findtrajectory_velocity
float autocvar_bot_ai_aimskill_order_filter_5th
float autocvar_bot_ai_aimskill_order_mix_5th
float autocvar_bot_ai_aimskill_offset
float autocvar_bot_ai_aimskill_order_mix_2nd
float autocvar_bot_ai_aimskill_mouse
vector bot_5th_order_aimfilter
ClientState CS(Client this)
float autocvar_bot_ai_aimskill_firetolerance_mindegrees
void bot_aimdir(entity this, vector v, float maxfiredeviation)
bool bot_shouldattack(entity this, entity targ)
vector bot_4th_order_aimfilter
float autocvar_bot_ai_aimskill_order_filter_3th
int autocvar_bot_ai_aimskill_firetolerance
float autocvar_bot_ai_aimskill_firetolerance_distdegrees
void bot_aim_reset(entity this)
float autocvar_bot_ai_aimskill_order_mix_3th
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1
float autocvar_bot_ai_aimskill_fixedrate
vector bot_aimtargvelocity
void bot_lagfunc(entity this, float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4)
entity tracetossfaketarget
spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2 f1 f1points f2
void lag_update(entity this)
vector bot_3th_order_aimfilter
float autocvar_bot_ai_aimskill_order_filter_4th
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, bool applygravity)
float autocvar_bot_ai_aimskill_firetolerance_maxdegrees
vector(float skel, float bonenum) _skel_get_boneabs_hidden
vector bot_2nd_order_aimfilter
float autocvar_bot_ai_aimskill_order_filter_1st
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
float W_WeaponSpeedFactor(entity this)
float autocvar_bot_ai_aimskill_order_filter_2nd
bool autocvar_bot_ignore_bots
vector bot_shotlead(vector targorigin, vector targvelocity, float shotspeed, float shotdelay)
#define MUTATOR_CALLHOOK(id,...)
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
bool autocvar_bot_typefrag
float autocvar_bot_ai_aimskill_think
float lag_additem(entity this, float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4)
void set_movetype(entity this, int mt)