Module:Infobox

local p = {} local rtable = require( 'Module:Table' )

local function rechargeImg( value, text ) if text then return ' ' .. ( value == 'one time' and 'One time use' or value == 'unlimited' and 'Unlimited' or value:find( 's' ) and value:gsub( 's', '' ) .. ' seconds' or value .. ' rooms' ) else return '' end end

function p.recharge( f ) local args = rtable.trimAll( rtable.getArgs( f ) ) local recharge = require( 'Module:Image' ).splitParams( args.recharge ) local _r = rechargeImg( recharge[1], args.text ) if args.dlc == 'a' then if recharge['a+'] then _r = _r .. ( args.text and ' ' or '' ) .. f:expandTemplate{ title = 'dlc', args = { 'a+' } } .. rechargeImg( recharge['a+'], args.text ) end elseif args.dlc == '0' then if recharge['a'] then _r = _r .. ( args.text and ' ' or '' ) .. f:expandTemplate{ title = 'dlc', args = { 'a' } } .. rechargeImg( recharge['a'], args.text ) end if recharge['a+'] then _r = _r .. ( args.text and ' ' or '' ) .. f:expandTemplate{ title = 'dlc', args = { 'a+' } } .. rechargeImg( recharge['a+'], args.text ) end end return _r end

function p.health( f ) local args = rtable.trimAll( rtable.getArgs( f ) ) local list = require( 'Module:Image' ).splitParams( args[1] ) local _r = require( 'Module:Text' ).font{ 'ID', list[1] } if args[2] == 'a' then if list['a+'] then _r = f:expandTemplate{ title = 'dlc', args = { 'na+' } } .. _r .. ' ' .. f:expandTemplate{ title = 'dlc', args = { 'a+' } } .. require( 'Module:Text' ).font{ 'ID', list['a+'] } end elseif args[2] == '0' then if list['a'] then _r = f:expandTemplate{ title = 'dlc', args = { 'na' } } .. _r .. ' ' .. f:expandTemplate{ title = 'dlc', args = { 'a' } } .. require( 'Module:Text' ).font{ 'ID', list['a'] } end if list['a+'] then _r = _r .. ' ' .. f:expandTemplate{ title = 'dlc', args = { 'a+' } } .. require( 'Module:Text' ).font{ 'ID', list['a+'] } end end return _r end

return p