settouch(this, ka_TouchEvent);
setthink(this, ka_RespawnBall);
this.nextthink = time + autocvar_g_keepawayball_respawntime;
- navigation_dynamicgoal_set(this);
+ navigation_dynamicgoal_set(this, NULL);
Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1);
Send_Effect(EFFECT_ELECTRO_COMBO, this.origin, '0 0 0', 1);
ball.effects &= ~EF_NODRAW;
setorigin(ball, plyr.origin + '0 0 10');
ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
- entity e = ball.owner; ball.owner = NULL;
+ entity e = ball.owner;
+ ball.owner = NULL;
e.ballcarried = NULL;
GameRules_scoring_vip(e, false);
- navigation_dynamicgoal_set(ball);
+ navigation_dynamicgoal_set(ball, e);
// reset the player effects
plyr.glow_trail = false;
void havocbot_goalrating_ball(entity this, float ratingscale, vector org)
{
- float t;
entity ball_owner;
ball_owner = ka_ball.owner;
if (ball_owner == this)
return;
- // If ball is carried by player then hunt them down.
if (ball_owner)
- {
- t = (this.health + this.armorvalue) / (ball_owner.health + ball_owner.armorvalue);
- navigation_routerating(this, ball_owner, t * ratingscale, 2000);
- }
- else // Ball has been dropped so collect.
+ navigation_routerating(this, ball_owner, ratingscale, 2000);
+ else
navigation_routerating(this, ka_ball, ratingscale, 2000);
}
{
navigation_goalrating_start(this);
havocbot_goalrating_items(this, 10000, this.origin, 10000);
- havocbot_goalrating_enemyplayers(this, 20000, this.origin, 10000);
+ havocbot_goalrating_enemyplayers(this, 10000, this.origin, 10000);
havocbot_goalrating_waypoints(this, 1, this.origin, 3000);
navigation_goalrating_end(this);
{
navigation_goalrating_start(this);
havocbot_goalrating_items(this, 10000, this.origin, 10000);
- havocbot_goalrating_enemyplayers(this, 1000, this.origin, 10000);
- havocbot_goalrating_ball(this, 20000, this.origin);
+ havocbot_goalrating_enemyplayers(this, 500, this.origin, 10000);
+ havocbot_goalrating_ball(this, 8000, this.origin);
navigation_goalrating_end(this);
navigation_goalrating_timeout_set(this);