Module:Infobox Monster: Difference between revisions

From OtherX
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 43: Line 43:
     local infoboxCode = ret:create()
     local infoboxCode = ret:create()


     return infoboxCode
     return ret:create()
end
end


return p
return p

Revision as of 18:54, 21 January 2024

Module documentation
This documentation is transcluded from Module:Infobox Monster/doc. [edit] [history] [purge]
Module:Infobox Monster requires Module:Infobox.

-- Module for Template:Infobox Monster

local p = {}

local infobox = require('Module:Infobox')

function p.main(frame)
    local args = frame:getParent().args

    local ret = infobox.new(args)

    -- Define the parameters that the infobox will use
    ret:defineParams{
        'name',
        'image',
        'release',
        'update',
        'also called',
        'enviro tiers',
        'boss number',
        'members',
        'combat',
        'examine',
        'max hit',
        'aggressive',
        'poisonous',
        'hp stats',
        'immunepoison',
        'immunevenom',
        'id'
    }

    -- Add the rows to the infobox
    ret:addRow{ { tag = 'argd', content = 'name', class='infobox-header' } }
    ret:addRow{ { tag = 'argd', content = 'image', class='infobox-image' } }
    ret:addRow{ { tag = 'argd', content = 'release', class='infobox-release' } }
    -- Continue adding rows for each parameter as needed...

    -- Process and clean up the parameters
    ret:cleanParams()

    -- Generate the infobox
    local infoboxCode = ret:create()

    return ret:create()
end

return p