Module:Bribes
From IdleOn MMO Wiki
hewwo
local data = mw.loadJsonData('Module:Bribes/data.json')
local p = {}
local Loops = require("Module:Loops")
local ROW_TEMPLATE = [=[<tr>
<td>%s</td>
<td>%s</td>
<td>%s</td>
</tr>]=]
local ROW_TEMPLATE_EXPANSION = [=[<tr>
<th>%s</th>
<th>%s</th>
<th>%s</th>
</tr>]=]
function p.bribez()
local ret = ""
for _, bribeData in pairs(data) do
local name = bribeData["name"]
local desc = bribeData["desc"]
local cost = bribeData["cost"]
local intName = bribeData["intName"]
if intName == "BribeExpansion" then
ret = ret .. string.format(
ROW_TEMPLATE_EXPANSION,
name,
desc,
cost
)
else
ret = ret .. string.format(
ROW_TEMPLATE,
name,
desc,
cost
)
end
end
return ret
end
return p