From: terencehill Date: Wed, 18 Jan 2017 15:19:19 +0000 (+0100) Subject: Reduce weapon value if bot already got a good arsenal X-Git-Tag: xonotic-v0.8.2~202^2~30 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e07b68e4e03845d437d0e2c198038314f617ab5d;p=xonotic%2Fxonotic-data.pk3dir.git Reduce weapon value if bot already got a good arsenal --- diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index e04b31d8c..7ea83888c 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -957,7 +957,16 @@ float weapon_pickupevalfunc(entity player, entity item) return 0; return ammo_pickupevalfunc(player, item); } - return item.bot_pickupbasevalue; + + // reduce weapon value if bot already got a good arsenal + float c = 1; + int weapons_value = 0; + FOREACH(Weapons, it != WEP_Null && (player.weapons & it.m_wepset), { + weapons_value += it.bot_pickupbasevalue; + }); + c -= bound(0, weapons_value / 20000, 1) * 0.5; + + return item.bot_pickupbasevalue * c; } float ammo_pickupevalfunc(entity player, entity item) @@ -1030,8 +1039,7 @@ float ammo_pickupevalfunc(entity player, entity item) rating *= min(2, c); if(wpn) - // Skilled bots will grab more - rating += wpn.bot_pickupbasevalue * (0.1 + 0.1 * bound(0, skill / 10, 1)); + rating += wpn.bot_pickupbasevalue * 0.1; return rating; }