Module:Rounds: Difference between revisions

saving progress
 
saving progress
Line 33: Line 33:
else return 0.02 end
else return 0.02 end
end
end
}
local BMC = {
bloonName = {
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",
DDT = "DDT", Camo = "Camo", Regrow = "Regrow"
},
bloonLink = {
Red = "[[Red Bloon (BMC)|Red]]", Blue = "[[Blue Bloon (BMC)|Blue]]", Green = "[[Green Bloon (BMC)|Green]]",
Yellow = "[[Yellow Bloon (BMC)|Yellow]]", Pink = "[[Pink Bloon (BMC)|Pink]]", Black = "[[Black Bloon (BMC)|Black]]",
White = "[[White Bloon (BMC)|White]]", Zebra = "[[Zebra Bloon (BMC)|Zebra]]", Lead = "[[Lead Bloon (BMC)|Lead]]",
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]]",
Camo = "[[Camo Bloon (BMC)|Camo]]", Regrow = "[[Regrow Bloon (BMC)|Regrow]]"
},
bloonRbe = {
Red = 1, Blue = 2, Green = 3, Yellow = 4, Pink = 5, Black = 11,
White = 11, Zebra = 23, Lead = 23, Rainbow = 47, Ceramic = 104
},
moabLayerRbe = { MOAB = 132, BFB = 990, ZOMG = 2640, DDT = 198 },
moabChildrenRbe = { MOAB = 416, BFB = 1664, ZOMG = 6656, DDT = 416 },
bloonValue = {
Red = 1, Blue = 2, Green = 3, Yellow = 4, Pink = 5, Black = 11, White = 11,
Zebra = 23, Lead = 23, Rainbow = 47, Ceramic = 95, MOAB = 381, BFB = 1525, ZOMG = 6101, DDT = 381
},
freeplayRoundStart = 31
}
}


Line 39: Line 66:
local text = {}
local text = {}
for i, group in ipairs(groups) do
for i, group in ipairs(groups) do
local timing = (group.Count == 1 or group.Duration == 0) and sFormat("At: %gs", group.StartTime) or sFormat("Duration: %gs — %gs", group.StartTime, group.StartTime + group.Duration)
local timing = (group.count == 1 or group.duration == 0) and sFormat("At: %gs", group.start) or sFormat("Duration: %gs — %gs", group.start, group.start + group.duration)
text[i] = sFormat("<span class='explain' title='%s'>%s%s%s%s ×%i</span>",
text[i] = sFormat("<span class='explain' title='%s'>%s%s%s%s ×%i</span>",
timing,
timing,
Line 45: Line 72:
group.camo and data.bloonName.Camo or "",
group.camo and data.bloonName.Camo or "",
group.regrow and data.bloonName.regrow or "",
group.regrow and data.bloonName.regrow or "",
data.bloonName[group.Bloon],
data.bloonName[group.bloon],
group.Count)
group.count)
if highlightType == group.Bloon then text[i] = sFormat("'''%s'''", text[i]) end
if highlightType == group.bloon then text[i] = sFormat("'''%s'''", text[i]) end
end
end
return text
return text
Line 57: Line 84:
for i, group in ipairs(groups) do
for i, group in ipairs(groups) do
if roundNumber < data.freeplayRoundStart then
if roundNumber < data.freeplayRoundStart then
if data.moabLayerRbe[group.Bloon] then
if data.moabLayerRbe[group.bloon] then
rbe = rbe + (((data.moabLayerRbe[group.Bloon] * moabHealthRule) + data.moabChildrenRbe[group.Bloon]) * group.Count)
rbe = rbe + (((data.moabLayerRbe[group.bloon] * moabHealthRule) + data.moabChildrenRbe[group.bloon]) * group.count)
else
else
rbe = rbe + (data.bloonRbe[group.Bloon] * group.Count)
rbe = rbe + (data.bloonRbe[group.bloon] * group.count)
end
end
else
else
Line 75: Line 102:
for i, group in ipairs(groups) do
for i, group in ipairs(groups) do
if roundNumber < data.freeplayRoundStart then
if roundNumber < data.freeplayRoundStart then
cash = cash + (data.bloonValue[group.Bloon] * group.Count)
cash = cash + (data.bloonValue[group.bloon] * group.count)
else
else
cash = cash + (data.bloonValueFreeplay[group.bloon] * group.count)
cash = cash + (data.bloonValueFreeplay[group.bloon] * group.count)
Line 88: Line 115:
local tConcat = table.concat
local tConcat = table.concat
local lang = mw.language.new("en")
local lang = mw.language.new("en")
local rounds = mw.loadJsonData("Module:BTD5 rounds/" .. roundSet)["Rounds"]
local rounds = mw.loadJsonData("Module:Rounds/" .. roundSet)["rounds"]
local totalRbe, totalCashFromPops, totalCashFromRoundEnds, totalXp = 0, 0, 0, 0
local totalRbe, totalCashFromPops, totalCashFromRoundEnds, totalXp = 0, 0, 0, 0
Line 145: Line 172:
p["BTD5 full"] = function(frame)
p["BTD5 full"] = function(frame)
return full(BTD5, frame.args[1], frame.args["collapsed"], true, false,
return full(BTD5, frame.args[1], frame.args["collapsed"], true, false,
frame.args["start round"], frame.args["end round"],
tonumber(frame.args["start round"]), tonumber(frame.args["end round"]),
frame.args["cash per pop"], 99, {},
tonumber(frame.args["cash per pop"]), 99, {},
frame.args["ceramic health"], frame.args["moab health"])
tonumber(frame.args["ceramic health"]), tonumber(frame.args["moab health"]))
end
 
-- this is just for bloonprint hideout for now
p["BMC full"] = function(frame)
return full(BMC, frame.args[1], frame.args["collapsed"], false, false,
tonumber(frame.args["start round"]), tonumber(frame.args["end round"]),
0, 0, {},
tonumber(frame.args["ceramic health"]), tonumber(frame.args["moab health"]))
end
end


p["BTD6 full"] = function(frame)
p["BTD6 full"] = function(frame)
return full(BTD6, frame.args[1], frame.args["collapsed"], true, true,
return full(BTD6, frame.args[1], frame.args["collapsed"], true, true,
frame.args["start round"], frame.args["end round"],
tonumber(frame.args["start round"]), tonumber(frame.args["end round"]),
frame.args["cash per pop"], 100, {},
tonumber(frame.args["cash per pop"]), 100, {},
frame.args["ceramic health"], frame.args["moab health"])
tonumber(frame.args["ceramic health"]), tonumber(frame.args["moab health"]))
end
end


return p
return p