5,078
edits
No edit summary |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
local strings = require( 'Module:Stats/REQ/H5G/STRINGS' ) | |||
[ ' | |||
function rarity( data ) | |||
'rarity', | -- Build the rarity string | ||
'energy', | local rarity = strings.rarity( data[ 'rarity' ] ) | ||
'rp' | if data[ 'mythic' ] then | ||
} | rarity = rarity .. ', ' .. strings.rarity( 'mythic' ) | ||
end | |||
return rarity | |||
end | |||
function consumable( card, data ) | |||
-- Add the fields to the infocard | |||
card.withField( strings.field( 'category' ), strings.category( data[ 'category' ] ) ) | |||
.withField( strings.field( 'rarity' ), rarity( data ) ) | |||
.withField( strings.field( 'energy' ), '{{Energy|' .. data[ 'energy' ] .. '}}' ) | |||
.withField( strings.field( 'rp' ), '{{RP|' .. data[ 'rp' ] .. '}}') | |||
return | |||
end | |||
function permanent( card, data ) | |||
-- Add the fields to the infocard | |||
card.withField( strings.field( 'category' ), strings.category( data[ 'category' ] ) ) | |||
.withField( strings.field( 'rarity' ), rarity( data ) ) | |||
return | |||
end | |||
function certification( card, data ) | |||
-- Add the fields to the infocard | |||
card.withField( strings.field( 'category' ), strings.category( data[ 'category' ] ) ) | |||
.withField( strings.field( 'rarity' ), rarity( data ) ) | |||
return | |||
end | |||
local p = {} | |||
function p.announcer( card, data ) | |||
permanent( card, data ) | |||
return | |||
end | |||
function p.armor( card, data ) | |||
permanent( card, data ) | |||
return | |||
end | |||
function p.assassination( card, data ) | |||
permanent( card, data ) | |||
return | |||
end | |||
function p.boost( card, data ) | |||
consumable( card, data ) | |||
return | |||
end | |||
function p.certpowerup( card, data ) | |||
certification( card, data ) | |||
return | |||
end | |||
function p.certpowerwep( card, data ) | |||
certification( card, data ) | |||
return | |||
end | |||
function p.certvehicle( card, data ) | |||
certification( card, data ) | |||
return | |||
end | |||
function p.emblem( card, data ) | |||
permanent( card, data ) | |||
return | |||
end | |||
function p.helmet( card, data ) | |||
permanent( card, data ) | |||
return | |||
end | |||
function p.loadout( card, data ) | |||
permanent( card, data ) | |||
return | |||
end | |||
function p.powerup( card, data ) | |||
consumable( card, data ) | |||
return | |||
end | |||
function p.powerwep( card, data ) | |||
consumable( card, data ) | |||
return | |||
end | |||
function p.skin( card, data ) | |||
permanent( card, data ) | |||
return | |||
end | |||
function p.stance( card, data ) | |||
permanent( card, data ) | |||
return | |||
end | |||
function p.vehicle( card, data ) | |||
consumable( card, data ) | |||
return | |||
end | |||
function p.visor( card, data ) | |||
permanent( card, data ) | |||
return | |||
end | |||
return p |