Template:Infobox Monster: Difference between revisions

From OtherX
Jump to navigation Jump to search
No edit summary
Tag: Reverted
(Replaced content with "<includeonly> {{#invoke:Infobox Monster|main}} </includeonly><noinclude> {{Documentation}} </noinclude>")
Tags: Replaced Manual revert Reverted
Line 1: Line 1:
-- Module for Template:Infobox Monster
<includeonly>
 
{{#invoke:Infobox Monster|main}}
local p = {}
</includeonly><noinclude>
 
{{Documentation}}
local infobox = require('Module:Infobox')
</noinclude>
local commas = require('Module:Addcommas')._add
 
function p.main(frame)
    local args = frame:getParent().args
 
    local ret = infobox.new(args)
 
    ret:defineParams{
        'name',
        'image',
        'release',
        'update',
        'also called',
        'enviro tiers',
        'boss number',
        'members',
        'combat',
        'examine',
        'max hit',
        'aggressive',
        'poisonous',
        'hp stats',
        'immunepoison',
        'immunevenom',
        'id'
    }
 
    ret:defineLinks({ hide = true })
 
    ret:create()
    ret:cleanParams()
 
    ret:addButtonsCaption()
 
    ret:defineName('Infobox Monster')
    ret:addClass('infobox-monster')
 
    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' } }
    ret:addRow{ { tag = 'argd', content = 'also called', class='infobox-aka' } }
    ret:addRow{ { tag = 'argd', content = 'enviro tiers', class='infobox-enviro-tiers' } }
    ret:addRow{ { tag = 'argd', content = 'boss number', class='infobox-boss-number' } }
    ret:addRow{ { tag = 'argd', content = 'members', class='infobox-members' } }
    ret:addRow{ { tag = 'argd', content = 'combat', class='infobox-combat' } }
    ret:addRow{ { tag = 'argd', content = 'examine', class='infobox-examine' } }
    ret:addRow{ { tag = 'argd', content = 'max hit', class='infobox-max-hit' } }
    ret:addRow{ { tag = 'argd', content = 'aggressive', class='infobox-aggressive' } }
    ret:addRow{ { tag = 'argd', content = 'poisonous', class='infobox-poisonous' } }
    ret:addRow{ { tag = 'argd', content = 'hp stats', class='infobox-hp-stats' } }
    ret:addRow{ { tag = 'argd', content = 'immunepoison', class='infobox-immunepoison' } }
    ret:addRow{ { tag = 'argd', content = 'immunevenom', class='infobox-immunevenom' } }
    ret:addRow{ { tag = 'argd', content = 'id', class='infobox-id' } }
 
    return ret:tostring()
end
 
return p

Revision as of 21:14, 21 January 2024

Template documentation
This documentation is transcluded from Template:Infobox Monster/doc. [edit] [history] [purge]
Template:Infobox Monster invokes function main in Module:Infobox Monster using Lua.