FANDOM


local p = {}
 
local data = mw.loadData( 'Module:Description/data' )
 
function stripFormat(text)
    text = string.gsub(text, "{{Type|", "")
    text = string.gsub(text, "{{Tooltip|", "")
    text = string.gsub(text, "}}", "")
    return text
end
 
function getDescription(name, section, prefix, strip)
    if section == nil then
        section = "default"
    end
    local t = { }
    for i, text in pairs(data[name][section]) do
        if strip then
            t[#t+1] = prefix..stripFormat(text)
        else
            t[#t+1] = prefix..text
        end
    end
    return t
end
 
function p.effect(frame)
    local t = getDescription(frame.args[1], frame.args[2], "{{bull}}", false)
    return frame:preprocess(table.concat(t, "<br />"))
end
 
function p.effectTooltip(frame)
    local t = getDescription(frame.args[1], frame.args[2], "{{bull2}}", true)
    return frame:preprocess(table.concat(t, "<br />"))
end
 
function p.effectGear(frame)
    local t = getDescription(frame.args[1], frame.args[2], "*", true)
    return table.concat(t, "\n")
end
 
function p.effectIcon(frame)
    local t = getDescription(frame.args[1], frame.args[2], "", true)
    return table.concat(t, "; ")
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.