Module:Rounds: Difference between revisions

mNo edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
Red = "Red", Blue = "Blue", Green = "Green", Yellow = "Yellow", Pink = "Pink", Black = "Black", White = "White",
Red = "Red", Blue = "Blue", Green = "Green", Yellow = "Yellow", Pink = "Pink", Black = "Black", White = "White",
Zebra = "Zebra", Lead = "Lead", Rainbow = "Rainbow",Ceramic = "Ceramic",MOAB = "MOAB", BFB = "BFB", ZOMG = "ZOMG",
Zebra = "Zebra", Lead = "Lead", Rainbow = "Rainbow",Ceramic = "Ceramic",MOAB = "MOAB", BFB = "BFB", ZOMG = "ZOMG",
Camo = "Camo", Regrow = "Regen"
Camo = "Camo ", Regrow = "Regen "
},
},
bloonLink = {
bloonLink = {
Line 13: Line 13:
Rainbow = "[[Rainbow Bloon (BTD5)|Rainbow]]", Ceramic = "[[Ceramic Bloon (BTD5)|Ceramic]]", MOAB = "[[MOAB (BTD5)|MOAB]]",
Rainbow = "[[Rainbow Bloon (BTD5)|Rainbow]]", Ceramic = "[[Ceramic Bloon (BTD5)|Ceramic]]", MOAB = "[[MOAB (BTD5)|MOAB]]",
BFB = "[[BFB (BTD5)|BFB]]", ZOMG = "[[ZOMG (BTD5)|ZOMG]]",
BFB = "[[BFB (BTD5)|BFB]]", ZOMG = "[[ZOMG (BTD5)|ZOMG]]",
Camo = "[[Camo Bloon (BTD5)|Camo]]", Regrow = "[[Regen Bloon (BTD5)|Regen]]"
Camo = "[[Camo Bloon (BTD5)|Camo]] ", Regrow = "[[Regen Bloon (BTD5)|Regen]] "
},
},
bloonRbe = {
bloonRbe = {
Line 39: Line 39:
Red = "Red", Blue = "Blue", Green = "Green", Yellow = "Yellow", Pink = "Pink", Black = "Black", White = "White",
Red = "Red", Blue = "Blue", Green = "Green", Yellow = "Yellow", Pink = "Pink", Black = "Black", White = "White",
Zebra = "Zebra", Lead = "Lead", Rainbow = "Rainbow",Ceramic = "Ceramic",MOAB = "MOAB", BFB = "BFB", ZOMG = "ZOMG",
Zebra = "Zebra", Lead = "Lead", Rainbow = "Rainbow",Ceramic = "Ceramic",MOAB = "MOAB", BFB = "BFB", ZOMG = "ZOMG",
DDT = "DDT", Camo = "Camo", Regrow = "Regrow"
DDT = "DDT", Camo = "Camo ", Regrow = "Regrow "
},
},
bloonLink = {
bloonLink = {
Line 47: Line 47:
Rainbow = "[[Rainbow Bloon (BMC)|Rainbow]]", Ceramic = "[[Ceramic Bloon (BMC)|Ceramic]]", MOAB = "[[MOAB (BMC)|MOAB]]",
Rainbow = "[[Rainbow Bloon (BMC)|Rainbow]]", Ceramic = "[[Ceramic Bloon (BMC)|Ceramic]]", MOAB = "[[MOAB (BMC)|MOAB]]",
BFB = "[[BFB (BMC)|BFB]]", ZOMG = "[[ZOMG (BMC)|ZOMG]]", DDT = "[[DDT (BMC)|DDT]]",
BFB = "[[BFB (BMC)|BFB]]", ZOMG = "[[ZOMG (BMC)|ZOMG]]", DDT = "[[DDT (BMC)|DDT]]",
Camo = "[[Camo Bloon (BMC)|Camo]]", Regrow = "[[Regrow Bloon (BMC)|Regrow]]"
Camo = "[[Camo Bloon (BMC)|Camo]] ", Regrow = "[[Regrow Bloon (BMC)|Regrow]] "
},
},
bloonRbe = {
bloonRbe = {
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 112: Line 116:
-- create table header
-- create table header
local tableHeader = {
local tableHeader = {
sFormat([=[{|class="wikitable sortable mw-collapsible %s" style="text-align:center"
sFormat([=[{|class="wikitable sortable mw-collapsible center-col-3 center-col-4 center-col-5 %s"
!№
!№
!class="unsortable"|[[Bloon]] groups
!class="unsortable"|[[Bloon]] groups
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))
}
}