Module:Skills

local p = {} local function getFrame local pframe = frame:getParent local config = frame.args local args = pframe.args return pframe, config, args end local styles = { ['skill'] = '!style="background:#000"|', ['cost2'] = '\n|style="background:#282828"|', ['effect1'] = '\n|style="text-align:left"|', ['effect2'] = '\n|style="background:#282828;text-align:left"|', } local p,q={},{} function p.row( frame ) local getFrame local row = frame.args[1] local game = frame.args[2] local code = frame.args[3] local level = frame.args[4] local level1, level2 if level then level1 = '\n||' .. level end if level then level2 = string.format(styles['cost2']) .. level end local data = require('Module:Skills/' .. game) local skill = data.skills[code] if skill==nil then local alias = data.aliases[code] if alias then code = alias skill = data.skills[code] else return 'Invalid parameter 3 of ' .. '"' .. code .. '". You may correct the skill name or modify module:Skills/' .. game .. ' if needed. '		end end local skillcell = string.format(styles['skill']) .. code local cost1 = '\n||' .. skill.cost local cost2 = string.format(styles['cost2']) .. skill.cost local effect1 = string.format(styles['effect1']) .. skill.effect local effect2 = string.format(styles['effect2']) .. skill.effect if row == 'r01' then return skillcell .. effect1 -- Odd number row for enemy whose skill cost is irrelevant. elseif row == 'r02' then return skillcell .. effect2 -- Even number row for enemy whose skill cost is irrelevant. elseif row == 'r11' then return skillcell .. cost1 .. effect1 -- Odd number row for demon which does not learn new skill on level gain. elseif row == 'r12' then return skillcell .. cost2 .. effect2 -- Even number row for demon which does not learn new skill on level gain. elseif row == 'r21' then return skillcell .. cost1 .. effect1 .. level1 -- Odd number row for demon/persona which learn new skill on level gain. elseif row == 'r22' then return skillcell .. cost2 .. effect2 .. level2 -- Even number row for demon/persona which learn new skill on level gain. else return 'Invalid parameter 1 of ' .. '"' .. row .. '". '	end end return p