Module:BTD6 paragon stats: Difference between revisions

mNo edit summary
mNo edit summary
 
(8 intermediate revisions by the same user not shown)
Line 20: Line 20:
-- upper header
-- upper header
table.insert(ret, '!rowspan="2"|Degree\n!rowspan="2"|Power')
table.insert(ret, '!rowspan="2"|Degree\n!rowspan="2"|Power\n!rowspan="2"|[[Paragon#Boss damage|Boss multiplier]]')
local labels = {}
local labels = {}
local sublabels = {}
local sublabels = {}
Line 48: Line 48:
table.insert(ret, '|-')
table.insert(ret, '|-')
table.insert(ret, string.format("!%s\n|%s", i, degreeRequirements[i]))
table.insert(ret, string.format("!%s\n|%s", i, degreeRequirements[i]))
if i < 20 then table.insert(ret, "|×1.0")
elseif i < 40 then table.insert(ret, "|×1.25")
elseif i < 60 then table.insert(ret, "|×1.5")
elseif i < 80 then table.insert(ret, "|×1.75")
elseif i ~= 100 then table.insert(ret, "|×2.0")
else table.insert(ret, "|×2.25") end
local values = {}
local values = {}
Line 57: Line 63:
local bd = 0
local bd = 0
local amount = 0
local amount = 0
local prefix = ''
local suffix = ''
local suffix = ''
for j=1, #values do
for j=1, #values do
Line 63: Line 70:
if sublabels[j] == 'Boss damage' then bd = bd + values[j] end
if sublabels[j] == 'Boss damage' then bd = bd + values[j] end
prefix = ''
suffix = ''
suffix = ''
Line 76: Line 84:
else amount = values[j] * (1 + (i-1) * 0.01) + math.floor((i-1)/10)
else amount = values[j] * (1 + (i-1) * 0.01) + math.floor((i-1)/10)
end
end
bd = amount
else
elseif sublabels[j] == 'Ceramic damage' or sublabels[j] == 'MOAB-Class damage' then
if i == 100 then amount = values[j] * 2
if i == 100 then amount = values[j] * 2
else amount = values[j] * (1 + (i-1) * 0.01)
else amount = values[j] * (1 + (i-1) * 0.01)
end
end
if sublabels[j] == 'MOAB-Class damage' then bd = bd + amount end
prefix = ' +'
elseif sublabels[j] == 'Boss damage' then
if i == 100 then amount = values[j] * 2
else amount = values[j] * (1 + (i-1) * 0.01)
end
amount = (amount + bd) * (1 + (math.floor(i/20)/4))
end
end
if amount > 999 then table.insert(ret, string.format('|%i%s', amount, suffix))
if amount > 999 then table.insert(ret, string.format('|%s%.8g%s', prefix, amount, suffix))
else table.insert(ret, string.format('|%.4g%s', amount, suffix)) end
else table.insert(ret, string.format('|%s%.4g%s', prefix, amount, suffix)) end
end
end
end
end