lzinga / TTTWeightedTraitorSelection

A Garrys Mod TTT addon that improves the traitor selection process
Other
11 stars 6 forks source link

Innocent Streak Bonus Weight #25

Open lzinga opened 4 years ago

lzinga commented 4 years ago

While looking through the code I believe this should potentially be added into a convar to set if this should be running or not.

-- Phantom139: Added a block here to add additional weight for "streaks" of not being a traitor.
if v:GetRoundsSinceTraitorCount() >= math.random(3, 5) then
    local bonusWeight = math.floor(math.pow(1.75, v:GetRoundsSinceTraitorCount()))
    v:AddWeight( bonusWeight )
    print(v:GetName() .. " was given " .. bonusWeight .. " extra weight for being on a streak of not being the traitor. ( " .. v:GetRoundsSinceTraitorCount() .. " rounds)")
end

This gives the server owner more control of what they want their server to be instead of forcing certain settings on them.