|
|
|
@ -6,9 +6,10 @@ local settings = {
|
|
|
|
|
JackpotMax = 2500,
|
|
|
|
|
JackpotMultiplier = 1.1,
|
|
|
|
|
MinimumRounds = 5,
|
|
|
|
|
EndroundPoints = 50, -- Points to give at the end of the round (Jackpot gets added to the points the players get)
|
|
|
|
|
ZombiePointsFactor = 0.15, -- Factor of points zombies get of the points payout after round end
|
|
|
|
|
LosePointReduction = 0.0 -- Factor of points that gets taken away from players who lost
|
|
|
|
|
EndroundPoints = 50, -- Points to give at the end of the round to winners (Jackpot gets added to the points the players get)
|
|
|
|
|
ZombiePointsFactor = 0.00, -- Factor of points zombies get of the EndroundPoints after round end
|
|
|
|
|
LosePointReduction = 0.00, -- Factor of the total saved points, which get taken away from players who lost
|
|
|
|
|
LosePointDifferenceReduction = 0.85 -- Factor of the players gained points, which get taken away from players who lost
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-- Grab the data from the file about the map.
|
|
|
|
@ -147,12 +148,15 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner)
|
|
|
|
|
for k, ply in pairs(player.GetAll()) do
|
|
|
|
|
local pointsToGivePly
|
|
|
|
|
local points = math.Round(ply:GetSavedPoints())
|
|
|
|
|
local gainedPoints = points - (ply.PointSaving_StartPoints or 0)
|
|
|
|
|
print("GAINED: "..gainedPoints)
|
|
|
|
|
if gainedPoints < 0 then gainedPoints = 0 end
|
|
|
|
|
-- Calculate points to give for each player (Depending on if the round was lost or won)
|
|
|
|
|
if ply:Team() == TEAM_HUMAN then
|
|
|
|
|
points = math.Round(ply:GetPoints())
|
|
|
|
|
pointsToGivePly = math.Round(pointsToGive + jackpot)
|
|
|
|
|
else
|
|
|
|
|
pointsToGivePly = math.Round(pointsToGive * settings.ZombiePointsFactor - points * settings.LosePointReduction)
|
|
|
|
|
pointsToGivePly = math.Round(pointsToGive * settings.ZombiePointsFactor - points * settings.LosePointReduction - gainedPoints * settings.LosePointDifferenceReduction)
|
|
|
|
|
end
|
|
|
|
|
-- Limit pointsToGivePly
|
|
|
|
|
if points + pointsToGivePly < 0 then pointsToGivePly = -points end
|
|
|
|
@ -161,7 +165,7 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner)
|
|
|
|
|
ply:SetSavedPoints(points + pointsToGivePly)
|
|
|
|
|
-- Display message
|
|
|
|
|
if pointsToGivePly > 0 then
|
|
|
|
|
ply:PrintMessage(HUD_PRINTTALK, "You gained "..(pointsToGivePly).." this round for playing to the end!")
|
|
|
|
|
ply:PrintMessage(HUD_PRINTTALK, "In the end, you gained additional "..(pointsToGivePly).." points!")
|
|
|
|
|
elseif pointsToGivePly < 0 then
|
|
|
|
|
ply:PrintMessage(HUD_PRINTTALK, "You lost "..(-pointsToGivePly).." points this round!")
|
|
|
|
|
end
|
|
|
|
|