Skip to content

Commit 598728a

Browse files
authored
Update bounty_algo.lua: better tweak the algorithm
1 parent a1af3b7 commit 598728a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

mods/ctf/ctf_modebase/bounty_algo.lua

+11-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,16 @@ function ctf_modebase.bounty_algo.kd.get_next_bounty(team_members)
2828
end
2929

3030
function ctf_modebase.bounty_algo.kd.bounty_reward_func(pname)
31-
local recent = ctf_modebase:get_current_mode().recent_rankings.players()[pname] or {}
32-
local kd = (recent.kills or 1) / (recent.deaths or 1)
31+
local recent = ctf_modebase:get_current_mode().recent_rankings.players()
32+
local sum = 0
33+
for _, tname in ipairs(team_members) do
34+
local stats = recent[tname]
35+
if stats then
36+
sum = sum + (stats.kills or 0) / (stats.deaths or 1)
37+
end
38+
end
39+
local pstats = recent[pname] or {}
40+
local kd = (pstats.kills or 1) / (pstats.deaths or 1)
3341

34-
return {bounty_kills = 1, score = math.pow(kd * 1.5, 2.3)}
42+
return {bounty_kills = 1, score = math.pow(kd, ))}
3543
end

0 commit comments

Comments
 (0)