Module:Stats/REQ/H5G/TEMPLATES: Difference between revisions
From Halopedia, the Halo wiki
< Module:Stats | REQ
No edit summary |
mNo edit summary |
||
Line 7: | Line 7: | ||
local rarity = strings.rarity( data[ 'rarity' ] ) | local rarity = strings.rarity( data[ 'rarity' ] ) | ||
if data[ 'mythic' ] then | if data[ 'mythic' ] then | ||
rarity = rarity .. ' ' .. strings.rarity( 'mythic' ) | rarity = rarity .. ', ' .. strings.rarity( 'mythic' ) | ||
end | end | ||
-- Add the fields to the infocard | -- Add the fields to the infocard |
Revision as of 18:19, September 28, 2020
Documentation for this module may be created at ModuleDoc:Stats/REQ/H5G/TEMPLATES
local strings = require( 'Module:Stats/REQ/H5G/STRINGS' )
local p = {}
function p.powerwep( card, data )
-- Build the rarity string
local rarity = strings.rarity( data[ 'rarity' ] )
if data[ 'mythic' ] then
rarity = rarity .. ', ' .. strings.rarity( 'mythic' )
end
-- Add the fields to the infocard
card.withField( strings.field( 'category' ), strings.category( data[ 'category' ] ) )
.withField( strings.field( 'rarity' ), rarity )
.withField( strings.field( 'energy' ), '{{Energy|' .. data[ 'energy' ] .. '}}' )
.withField( strings.field( 'rp' ), '{{RP|' .. data[ 'rp' ] .. '}}')
return
end
return p