Documentation for this module may be created at Module:Combat/doc

u = require("Module:Util")
db = require("Module:Combat_DB")

local p = {}

function p.enemy_combat_info(name)
    enemy = nil
    if type(name) == 'table' then
        enemy = name
    else
        for _, e in ipairs(db) do
            if e[1] == name then
                enemy = e
                break
            end
        end
    end
    if not enemy then
        return ''
    end
    result = enemy[2] .. [[
    
{| class="article-table" style="text-align:center"
!Type
!Effect
!Occurs
]]
    for _, e in ipairs(enemy[3]) do
        result = result .. [[
|-
| ]] .. '[[' .. [[File:]] .. e[1] .. [[.png|20px]] .. ']]' .. [[

| ]] .. e[2] .. [[

| ]] .. e[3] .. [[

]]
    end
    return result .. [[
|}
]]
end

function p.teci(frame)
    return p.enemy_combat_info(frame.args[1] or frame:getParent():getTitle())
end

return p
Community content is available under CC-BY-SA unless otherwise noted.