Module:Stats/REQ/H5G/TEMPLATES: Difference between revisions

From Halopedia, the Halo wiki

mNo edit summary
No edit summary
Line 4: Line 4:


function p.powerwep( card, data )
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
function p.vehicle( card, data )
-- Build the rarity string
-- Build the rarity string
local rarity = strings.rarity( data[ 'rarity' ] )
local rarity = strings.rarity( data[ 'rarity' ] )

Revision as of 09:13, September 24, 2022

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

function p.vehicle( 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