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;}
50 if (item.itemdef.instanceOfPowerup) {
return true;}
72 if (it.team ==
this.team)
77 dist2 =
vlen2(it.origin - item_org);
78 if (dist2 > friend_dist2)
91 dist2 =
vlen2(it.origin - item_org);
92 if (dist2 < enemy_dist2)
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;
202 t =
bound(0, 1 + t, 3);
void navigation_goalrating_start(entity this)
const int WAYPOINTFLAG_TELEPORT
void navigation_goalrating_timeout_force(entity this)
void navigation_goalrating_timeout_set(entity this)
bool navigation_goalrating_timeout(entity this)
void navigation_routerating(entity this, entity e, float f, float rangebias)
void navigation_goalrating_end(entity this)
bool bot_shouldattack(entity this, entity e)
IntrusiveList g_waypoints
#define MUTATOR_CALLHOOK(id,...)
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.
const int IT_UNLIMITED_AMMO
float autocvar_sv_maxspeed
float autocvar_bot_ai_friends_aware_pickup_radius
#define IL_EACH(this, cond, body)
Header file that describes the functions related to game items.
#define ITEM_IS_LOOT(item)
Returns whether the item is loot.
const int WATERLEVEL_WETFEET
entity navigation_bestgoal
void havocbot_goalrating_waypoints(entity this, float ratingscale, vector org, float sradius)
bool havocbot_goalrating_item_pickable_check_players(entity this, vector org, entity item, vector item_org)
void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius)
void havocbot_role_generic(entity this)
void havocbot_chooserole(entity this)
void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius)
bool havocbot_goalrating_item_can_be_left_to_teammate(entity this, entity player, entity item)
void havocbot_chooserole_generic(entity this)
const float BOT_RATING_ENEMY
float StatusEffects_gettime(StatusEffect this, entity actor)
Header file that describes the resource system.
#define IS_REAL_CLIENT(v)
#define FOREACH_CLIENT(cond, body)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()