Difference between revisions of "Module:OTable"

Jump to navigation Jump to search
655 bytes added ,  13:22, 19 April 2025
m
no edit summary
m
m
 
(12 intermediate revisions by the same user not shown)
Line 48: Line 48:
local c = buildingList[v]
local c = buildingList[v]
local buildingType = c.type
local buildingType = c.type
        local influence = ''
local influence = ''
        if c.influence then
          if c.influence then
            local n = #c.influence -- Exclude splendour bonus???
          local influenceKeys = {}
            local i = 0
          for k in pairs(c.influence) do
            for k, v in pairs(c.influence) do
            if k ~= 'bsplendour' and k ~= 'tier' then -- Exclude 'bsplendour' and 'tier'... for now
                i = i + 1
            table.insert(influenceKeys, k)
                if i < n then
                    influence = influence .. i.icon(k, v, nil, k, 'en') .. '<br />'
                end
             end
             end
            local l = string.len(influence)
          end
             if l > 0 then
          local lastKey = influenceKeys[#influenceKeys]
                influence = string.sub(influence, 1, l -6)
          local itemCount = #influenceKeys
       
          for k, v in pairs(c.influence) do
             if k ~= 'bsplendour' and k ~= 'tier' then
            influence = influence .. i.icon(k, v, nil, k, 'en')
            if k ~= lastKey and itemCount > 1 then
              influence = influence .. '<br />'
            end
             end
             end
        end
          end
        local unlocks = influence
          end
          local unlocks = influence
local production = ''
if c.input then
production = '\'\'\'Consumes:\'\'\'<br />'
for k, v in pairs(c.input) do
production = production .. i.icon(v, nil, nil, v, 'en') .. '<br />'
end
end
if c.output then
if c.output then
Line 83: Line 96:
end
end
local l = string.len(construction)
local l = string.len(construction)
construction = string.sub(construction, 1, l -6)
if l > 0 then
construction = string.sub(construction, 1, l - 6)
end
end
 
-- adding gold coins back in??
if c.costs and c.costs['gold coins'] then
construction = construction .. '<br />' .. i.icon('gold coins', c.costs['gold coins'], nil, 'gold coins', 'en')
end
end
local newRow = mw.html.create('tr')
local newRow = mw.html.create('tr')
606

edits

Navigation menu