Anonymous

Module:Sandbox/GauTest/Township: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 588: Line 588:
-- Benefits
-- Benefits
BuildOptionalRow('\r\n|-\r\n! Benefits\r\n|', p._GetBuildingBenefits)
BuildOptionalRow('\r\n|-\r\n! Benefits\r\n|', p._GetBuildingBenefits)
BuildOptionalRow('\r\n|-\r\n! Production\r\n|', p._GetBuildingBaseProduction)
local benefits = {}
BuildOptionalRow('\r\n|-\r\n! Biome Modifiers\r\n|', p._GetBiomeModifiers)
local hasBenefits = false
 
for _, building in ipairs(buildingList) do
local benefit = p._GetBuildingBenefits(building)
hasBenefits = hasBenefits == true or benefit ~= nil
benefits = benefits ~= nil and benefits or ''
table.insert(benefits, benefit)
end
if hasBenefits == true then
benefits = table.concat(benefits, '\r\n|')
table.insert(ret, '\r\n|-\r\n! Benefits\r\n|'..benefits)
end
-- Production
local production = {}
local hasProduction = false
for _, building in ipairs(buildingList) do
local product = p._GetBuildingBaseProduction(building)
hasProduction = hasProduction == true or product ~= nil
product = product ~= nil and product or ''
table.insert(production, product)
end
if hasProduction == true then
production = table.concat(production, '\r\n|')
table.insert(ret, '\r\n|-\r\n! Production\r\n|'..production)
end
-- Biomes Modifiers
local biomeModifiers = {}
local hasBiomeModifiers = false
for _, building in ipairs(buildingList) do
local biomeModifier = p._GetBiomeModifiers(building)
hasBiomeModifiers = hasBiomeModifiers == true or biomeModifier ~= nil
biomeModifier = biomeModifier ~= nil and biomeModifier or ''
table.insert(biomeModifiers, biomeModifier)
end
if hasBiomeModifiers == true then
biomeModifiers = table.concat(biomeModifiers, '\r\n|')
table.insert(ret, '\r\n|-\r\n! Biome Modifiers\r\n|'..biomeModifiers)
end


-- End
-- End
572

edits