Module:Rounds: Difference between revisions

mNo edit summary
mNo edit summary
Line 68: Line 68:
local rbe = 0
local rbe = 0
local cash = 0
local cash = 0
local duration = 0
for i, group in ipairs(groups) do
for i, group in ipairs(groups) do
Line 98: Line 99:
cash = cash + (data.bloonValueFreeplay[group.bloon] * group.count)
cash = cash + (data.bloonValueFreeplay[group.bloon] * group.count)
end
end
-- duration
if group.start + group.duration > duration then duration = group.start + group.duration end
end
end
return text, rbe, cash * data.getCashModForRound(roundNumber)
return text, rbe, duration, cash * data.getCashModForRound(roundNumber)
end
end


Line 128: Line 132:
for roundNumber, groups in ipairs(rounds) do
for roundNumber, groups in ipairs(rounds) do
local text, rbe, cashFromPops = getStatsOfGroup(data, groups, roundNumber, ceramicHealthRule, moabHealthRule)
local text, rbe, duration, cashFromPops = getStatsOfGroup(data, groups, roundNumber, ceramicHealthRule, moabHealthRule)
totalRbe = totalRbe + rbe
totalRbe = totalRbe + rbe
-- round number, duration, rbe, and total rbe are always included
-- round number, duration, rbe, and total rbe are always included
local row = {
local row = {
sFormat("|-\n!%i\n|%s||%gs||%s (%s)", roundNumber, tConcat(text, "<br>"), 0.0, lang:formatNum(rbe), lang:formatNum(totalRbe))
sFormat("|-\n!%i\n|%s||%gs||%s (%s)", roundNumber, tConcat(text, "<br>"), duration, lang:formatNum(rbe), lang:formatNum(totalRbe))
}
}