Module:Sandbox/Hubianzhen/BTD6 rewards: Difference between revisions

No edit summary
No edit summary
Line 94: Line 94:
local mid = string.sub(value, delimiter + 2, delimiter + 2)
local mid = string.sub(value, delimiter + 2, delimiter + 2)
local btm = string.sub(value, delimiter + 3, delimiter + 3)
local btm = string.sub(value, delimiter + 3, delimiter + 3)
--[[ If both paths equal, the order is:
Middle, Top, Bottom
exceptions:
Dart middle then bottom
Bucc bottom then middle
]]--
if mid >= top and mid >= btm then
top, btm = 0
elseif top >= mid and top >= btm then
mid, btm = 0
end
return string.format('[[File:BTD6 %s%s%s%s]] %s-%s-%s',  
return string.format('[[File:BTD6 %s%s%s%s]] %s-%s-%s',  
top, mid, btm,
top, mid, btm,
insta_towers[string.sub(value, 1, delimiter - 1)],
insta_towers[string.sub(value, 1, delimiter - 1)],
top, mid, btm
string.sub(value, delimiter + 1, delimiter + 1), string.sub(value, delimiter + 2, delimiter + 2), string.sub(value, delimiter + 3, delimiter + 3)
)
)
end,
end,