24 sradius =
max(range, (0.5 +
random() * 0.5) * sradius);
28 &&
vdist(it.origin - org, >,
max(100, sradius - range))
31 if(vdist(it.origin - this.wp_goal_prev0.origin, <, range * 1.5))
33 else if(vdist(it.origin - this.wp_goal_prev1.origin, <, range * 1.5))
36 f = 0.5 + random() * 0.5;
37 navigation_routerating(this, it, ratingscale * f, 2000);
49 if (STAT(WEAPONS, item) && !(STAT(WEAPONS, player) & STAT(WEAPONS, item))) {
return true;}
55 if (item.itemdef.instanceOfPowerup) {
return true;}
72 if (it.team ==
this.team)
74 if (!IS_REAL_CLIENT(it))
77 dist2 = vlen2(it.origin - item_org);
78 if (dist2 > friend_dist2)
81 if(havocbot_goalrating_item_can_be_left_to_teammate(this, it, item))
91 dist2 =
vlen2(it.origin - item_org);
92 if (dist2 < enemy_dist2)
98 dist2 =
vlen2(item_org - org);
99 if ((enemy_dist2 < friend_dist2 && dist2 < enemy_dist2)
101 || (dist2 < friend_dist2 && dist2 < 200 ** 2))
108 ratingscale = ratingscale * 0.0001;
114 if(it.bot_ratingscale_time == time && ratingscale < it.bot_ratingscale)
119 if(!autocvar_bot_ai_timeitems)
121 if(!it.scheduledrespawntime)
123 if(it.respawntime < max(11, autocvar_bot_ai_timeitems_minrespawndelay))
125 if(it.respawntimejitter && !it.itemdef.instanceOfPowerup)
129 if(it.itemdef.instanceOfPowerup)
130 t = bound(0, skill / 10, 1) * 6;
134 if(time < it.scheduledrespawntime - t)
137 it.bot_pickup_respawning = true;
139 vector o = (it.absmin + it.absmax) * 0.5;
148 traceline(o, o +
'0 0 -1500',
true,
NULL);
161 if(
IN_LAVA(it.origin + (it.mins + it.maxs) * 0.5))
168 it.bot_ratingscale_time =
time;
169 it.bot_ratingscale = ratingscale;
170 float rating = it.bot_pickupevalfunc(
this, it);
185 ratingscale = ratingscale * 0.0001;
189 if(
vdist(it.origin - org, <, 100) ||
vdist(it.origin - org, >, sradius))
191 if(
vdist(
vec2(it.velocity), >, autocvar_sv_maxspeed * 2))
202 t =
bound(0, 1 + t, 3);
205 if (
time < StatusEffects_gettime(STATUSEFFECT_Strength,
this) - 1) t += 0.5;
206 if (
time < StatusEffects_gettime(STATUSEFFECT_Strength, it) - 1) t -= 0.5;
207 if (
time < StatusEffects_gettime(STATUSEFFECT_Shield,
this) - 1) t += 0.2;
208 if (
time < StatusEffects_gettime(STATUSEFFECT_Shield, it) - 1) t -= 0.4;
#define IL_EACH(this, cond, body)
void navigation_goalrating_start(entity this)
void navigation_goalrating_end(entity this)
Header file that describes the resource system.
#define FOREACH_CLIENT(cond, body)
entity navigation_bestgoal
void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius)
void havocbot_goalrating_waypoints(entity this, float ratingscale, vector org, float sradius)
void navigation_goalrating_timeout_force(entity this)
void navigation_routerating(entity this, entity e, float f, float rangebias)
void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius)
bool navigation_goalrating_timeout(entity this)
const int WAYPOINTFLAG_TELEPORT
const float BOT_RATING_ENEMY
void havocbot_chooserole_generic(entity this)
const int WATERLEVEL_WETFEET
IntrusiveList g_waypoints
void havocbot_chooserole(entity this)
void navigation_goalrating_timeout_set(entity this)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void havocbot_role_generic(entity this)
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
float autocvar_bot_ai_friends_aware_pickup_radius
bool havocbot_goalrating_item_pickable_check_players(entity this, vector org, entity item, vector item_org)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
bool havocbot_goalrating_item_can_be_left_to_teammate(entity this, entity player, entity item)
#define MUTATOR_CALLHOOK(id,...)
bool bot_shouldattack(entity this, entity e)
bool Item_IsLoot(entity item)
Returns whether the item is loot.
Header file that describes the functions related to game items.