From 4173462368be317d45504168af7f60c48e693e32 Mon Sep 17 00:00:00 2001 From: Alexander van Gessel Date: Sun, 18 Mar 2012 02:43:31 +0100 Subject: [PATCH] Don't count dead sides for the end-game advantage --- data/multiplayer/eras.cfg | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/data/multiplayer/eras.cfg b/data/multiplayer/eras.cfg index c9bf00234b5..400623f975b 100644 --- a/data/multiplayer/eras.cfg +++ b/data/multiplayer/eras.cfg @@ -101,6 +101,22 @@ if team.__cfg.hidden then break end + local r, g, b = 255, 255, 255 + if team.__cfg.color == 1 then r, g, b = 255, 0, 0 + elseif team.__cfg.color == 2 then r, g, b = 0, 0, 255 + elseif team.__cfg.color == 3 then r, g, b = 0, 255, 0 + elseif team.__cfg.color == 4 then r, g, b = 155, 48, 255 + elseif team.__cfg.color == 5 then r, g, b = 0, 0, 0 + elseif team.__cfg.color == 6 then r, g, b = 165, 42, 42 + elseif team.__cfg.color == 7 then r, g, b = 255, 165, 0 + elseif team.__cfg.color == 8 then r, g, b = 255, 255, 255 + elseif team.__cfg.color == 9 then r, g, b = 0, 128, 128 end + if # wesnoth.get_units( { side = side } ) == 0 then + side_comparison = side_comparison .. + string.format( tostring( _ "Side %d") .. "\n", + r, g, b, side) + break + end local income = team.total_income * income_factor local units = 0 -- Calc the total unit-score here @@ -112,16 +128,6 @@ end -- Up to here local total = units + team.gold + income - local r, g, b = 255, 255, 255 - if team.__cfg.color == 1 then r, g, b = 255, 0, 0 - elseif team.__cfg.color == 2 then r, g, b = 0, 0, 255 - elseif team.__cfg.color == 3 then r, g, b = 0, 255, 0 - elseif team.__cfg.color == 4 then r, g, b = 155, 48, 255 - elseif team.__cfg.color == 5 then r, g, b = 0, 0, 0 - elseif team.__cfg.color == 6 then r, g, b = 165, 42, 42 - elseif team.__cfg.color == 7 then r, g, b = 255, 165, 0 - elseif team.__cfg.color == 8 then r, g, b = 255, 255, 255 - elseif team.__cfg.color == 9 then r, g, b = 0, 128, 128 end side_comparison = side_comparison .. string.format( tostring( _ "Side %d: Income score = %d Unit score = %d Gold = %d") .. "\n" .. tostring( _ "Grand total: %d") .. "\n", r, g, b, side, income, units, team.gold, total)