Anonymous

Module:Sandbox/GauTest/Township: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 349: Line 349:
local tier = p._GetTierRequirements(building.tier)
local tier = p._GetTierRequirements(building.tier)
table.insert(ret, '\r\n|-\r\n| <b>Tier '..building.tier..'</b><ul><li>'..Icons._SkillReq('Township', tier.level, false)..'</li><li>'..p.GetTownshipStatIcon('Population')..tier.population..'</li></ul>')
table.insert(ret, '\r\n|-\r\n| <b>Tier '..building.tier..'</b><ul><li>'..Icons._SkillReq('Township', tier.level, false)..'</li><li>'..p.GetTownshipStatIcon('Population')..tier.population..'</li></ul>')
-- Upgrades From
if building.upgradesFrom ~= nil then
table.insert(ret, '\r\n|-\r\n| <b>Upgrades From:</b> '..Icons.Icon({building.upgradesFrom, type='building'}))
end
-- Cost
-- Cost
local cost = {}
local cost = {}
Line 355: Line 360:
end
end
table.insert(ret, '\r\n|-\r\n| <b>Base Cost:</b> '..table.concat(cost, ', '))
table.insert(ret, '\r\n|-\r\n| <b>Base Cost:</b> '..table.concat(cost, ', '))
-- Upgrades To
local upgradesTo = GameData.getEntityByProperty(Township.buildings, 'upgradesFrom', building.id)
if upgradesTo ~= nil then
table.insert(ret, '\r\n|-\r\n| <b>Upgrades To:</b> '..Icons.Icon({upgradesTo.name, type='building'}))
-- Cost
local upgrade_cost = {}
for _, resource in ipairs(upgradesTo.cost) do
table.insert(upgrade_cost, Icons.Icon(p._GetResourceIcon(resource.id))..' '..resource.quantity)
end
table.insert(ret, '\r\n|-\r\n| <b>Upgrade Base Cost:</b> '..table.concat(upgrade_cost, ', '))
end
-- Fixed benefits
-- Fixed benefits
local benefits = {}
local benefits = {}
572

edits