From: terencehill Date: Thu, 29 Dec 2016 01:19:31 +0000 (+0100) Subject: Improve weapon rating balance: bots now really take small health if low on health... X-Git-Tag: xonotic-v0.8.2~343^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=66fc0a87a9436d3ae5363d854c509f8a496dceea;p=xonotic%2Fxonotic-data.pk3dir.git Improve weapon rating balance: bots now really take small health if low on health and ammo if low on ammo --- diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index b506141e8..5faa6dc93 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -924,6 +924,7 @@ float generic_pickupevalfunc(entity player, entity item) {return item.bot_pickup float weapon_pickupevalfunc(entity player, entity item) { float c; + int rating = item.bot_pickupbasevalue; // See if I have it already if(player.weapons & item.weapons) @@ -933,8 +934,10 @@ float weapon_pickupevalfunc(entity player, entity item) c = 0; else if(player.ammo_cells || player.ammo_shells || player.ammo_plasma || player.ammo_nails || player.ammo_rockets) { + if (rating > 0) + rating = BOT_PICKUP_RATING_LOW * 0.5 * (1 + rating / BOT_PICKUP_RATING_HIGH); // Skilled bots will grab more - c = bound(0, skill / 10, 1) * 0.5; + c = 1 + bound(0, skill / 10, 1) * 0.5; } else c = 0; @@ -985,10 +988,10 @@ float weapon_pickupevalfunc(entity player, entity item) } if (missing < 3 && best_ratio) - return (BOT_PICKUP_RATING_HIGH - ( (BOT_PICKUP_RATING_HIGH - BOT_PICKUP_RATING_LOW) * best_ratio )) * c; + c = c - best_ratio * 0.3; } - return item.bot_pickupbasevalue * c; + return rating * c; } float commodity_pickupevalfunc(entity player, entity item)