From: terencehill Date: Sat, 1 Apr 2017 15:28:49 +0000 (+0200) Subject: Freeze Tag bot AI: avoid gathering all teammates in one place; seek teammates out... X-Git-Tag: xonotic-v0.8.5~2855 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f4eb38b519ce0da5a1efb00b7ad9e211abf3d2a3;p=xonotic%2Fxonotic-data.pk3dir.git Freeze Tag bot AI: avoid gathering all teammates in one place; seek teammates out more if low on health (eventually ignoring frozen teammates if really low) --- diff --git a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc index 515c9da94..1d6e1c1ff 100644 --- a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc @@ -225,6 +225,7 @@ void(entity this) havocbot_role_ft_offense; void havocbot_goalrating_freeplayers(entity this, float ratingscale, vector org, float sradius) { + float t; FOREACH_CLIENT(IS_PLAYER(it) && it != this && SAME_TEAM(it, this), LAMBDA( if (STAT(FROZEN, it) == 1) { @@ -232,11 +233,12 @@ void havocbot_goalrating_freeplayers(entity this, float ratingscale, vector org, continue; navigation_routerating(this, it, ratingscale, 2000); } - else + else if(vdist(it.origin - org, >, 400)) // avoid gathering all teammates in one place { // If teamate is not frozen still seek them out as fight better // in a group. - navigation_routerating(this, it, ratingscale/3, 2000); + t = 0.2 * 150 / (this.health + this.armorvalue); + navigation_routerating(this, it, t * ratingscale, 2000); } )); }