Module:Skills/sandbox

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'] = '\n|-\n!style="background:#000;color:#fff;"|', ['skillc'] = '\n!style="background:#000;color:#fff;"|', ['cost2'] = '\n|style="background:#282828"|', ['effect1'] = '\n|style="text-align:left"|', ['effect2'] = '\n|style="background:#282828;text-align:left"|', ['effect1p'] = '\n|colspan=2 style="text-align:left"|', ['effect2p'] = '\n|colspan=2 style="background:#282828;text-align:left"|', ['order'] = '\n|style="background:#000;text-align:left"|', ['smt1table'] = '\n{|class="customtable smt1" width="100%"', ['statlow'] = '\n|style="background:#000;color:#fff"|', } local p,q={},{} function p.row( frame ) local getFrame local row = frame.args[1] local game = frame.args[2] local code = frame.args[3] if not code or code ==  then return  end local level = frame.args[4] if level == 'innate' or level == 'default' or level == 'Default' then level = 'Innate' end local data = require('Module:Skills/' .. game) local skill = data.skills[code] if not skill 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 if skill.name then code = skill.name end local skillcell = string.format(styles['skill']) .. code local cost = skill.cost if game == 'SMT3' then if cost == 'Convo' then cost = 'Convo ' elseif cost == 'Interrupt' then cost = 'Interrupt ' end end local cost1 = '\n||' .. cost local cost2 = string.format(styles['cost2']) .. cost local effect1 = string.format(styles['effect1']) .. skill.effect local effect2 = string.format(styles['effect2']) .. skill.effect local order = string.format(styles['order']) .. skill.cost if skill.element then local element1 = '\n||' .. skill.element local element2 = string.format(styles['cost2']) .. skill.element end local level1, level2 if level then level1 = '\n||' .. level or '' level2 = string.format(styles['cost2']) .. level or '' elseif skill.pre then level1 = '\n||' .. skill.pre level2 = string.format(styles['cost2']) .. skill.pre end 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 if game == 'SMT3' and skill.phy then return skillcell .. string.format(styles['effect1p']) .. skill.effect -- Odd number row for enemy whose physical skills cost no HP. else return skillcell .. cost1 .. effect1 -- Odd number row for demon which does not learn new skill on level gain. end elseif row == 'r12' then if game == 'SMT3' and skill.phy then return skillcell .. string.format(styles['effect2p']) .. skill.effect -- Even number row for enemy whose physical skills cost no HP. else return skillcell .. cost2 .. effect2 -- Even number row for demon which does not learn new skill on level gain. end 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. elseif row == 'r31' then return skillcell .. effect1 .. level1 -- Odd number row for guest who learn new skill on level gain. elseif row == 'r32' then return skillcell .. effect2 .. level2 -- Even number row for guest who learn new skill on level gain. elseif row == 'p12' then return string.format(styles['skill']) .. level .. string.format(styles['skillc']) .. code .. effect1 -- Row for Persona 1 and 2 persona elseif row == 'rf' then return skillcell .. effect1 .. order -- Row for Persona-specific fusion spell. elseif row == 'dk1' then return skillcell .. element1 .. cost1 .. effect1 -- Odd number row for DemiKids stats skill list. elseif row == 'dk2' then return skillcell .. element2 .. cost2 .. effect2 -- Odd number row for DemiKids stats skill list. elseif row == 'dkc1' then return skillcell .. level1 .. element1 .. cost1 .. effect1 -- Odd number row for DemiKids stats skill list. elseif row == 'dkc2' then return skillcell .. level2 .. element2 .. cost2 .. effect2 -- Odd number row for DemiKids stats skill list. else return 'Invalid parameter 1 of ' .. '"' .. row .. '". '	end end function p.SMTstats( frame ) local getFrame local image = frame.args.Image local magdrop = frame.args('Mag Drop') local mag = frame.args.MAG or frame.args.CP or '' local race = frame.args.Race or frame.args.Clan or '' local alignment = frame.args.Alignment or frame.args.Align or '' local level = frame.args.Level or '' local hp = frame.args.HP or '' local mp = frame.args.MP or '' local noa = frame.args.NOA or frame.args.NOH or '' local str = frame.args.STR or frame.args.st or '' local int = frame.args.INT or frame.args('in') or '' local mgc = frame.args.MGC or frame.args.ma or '' local stm = frame.args.STM or frame.args.vi or '' local lck = frame.args.LCK or frame.args.lu or '' local atk = frame.args.Atk or '' local hit = frame.args.Hit or '' local def = frame.args.Def or '' local avd = frame.args.Avd or frame.args.Eva or '' local mef = frame.args.Mef or '' local drop = frame.args.Drop or '' local resist = frame.args.Resist or frame.args.Affinity or '-' if image then image = string.format(styles['skill']) .. image else image = '' end local magt if magdrop then magt = '| MAG ' else magt = 'CP ' end if race == 'Seraph' then race = 'Seraph' elseif race == 'Ghost' then race = 'Ghost' elseif race == 'Gaean' or race == 'Gaian' then race = 'Gaean' elseif race == 'Messian' then race = 'Messian' elseif mw.title.new( race ) then race =  .. race ..  else race = race end if resist then resist = string.format(styles['smt1table']) .. Resistances	\n|style="background:#000;text-align:left;padding:0 5px"| .. resist .. '\n|}' else resist = '' end local number --local ('s' .. number) = frame.args.('Skill' .. number) or '' --local ('l' .. number) = frame.args.('Level' .. number) or '' --local p.row --if (number % 2 == 0) then ('s' .. number) = skillcell .. cost2 .. effect2 --	else ('s' .. number) = skillcell .. cost1 .. effect1 --end local categoryb, categoryd, categorya if magdrop then categoryb =  else categoryb =  end if mag then categoryd =  else categoryd =  end if alignment == 'Law' or 'Light-Law' or 'Neutral-Law' or 'Dark-Law' then categorya = '' elseif alignment == 'Neutral' or 'Light-Neutral' or 'Neutral-Neutral' or 'Dark-Neutral' then categorya = '' elseif alignment == 'Chaos' or 'Light-Chaos' or 'Neutral-Chaos' or 'Dark-Chaos' then categorya = '' else categorya = '' end if not magdrop or magdrop == '' then magdrop = mag end local costt if magdrop then costt = string.format(styles['skill']) .. 'Cost' else costt = '' end return '{|align="center" style="min-width:650px;text-align:center; background: #222222; border:2px solid #608341;border-radius:7px; clear:both; font-size:75%; font-family:verdana;"\n|-\n|\n{|width=100% cellpadding=0 cellspacing=0\n' .. image .. '\n|' .. string.format(styles['smt1table']) .. '\n! Race \n! Alignment \n!HP\n!MP\n!' .. magt .. '\n|-' .. string.format(styles['statlow']) .. alignment .. string.format(styles['statlow']) .. level .. string.format(styles['statlow']) .. hp .. string.format(styles['statlow']) .. mp .. string.format(styles['statlow']) .. magdrop .. '\n|}' .. string.format(styles['smt1table']) .. '\n!NOH \n!Strength\n!Intelligence\n!Magic\n!Vitality\n!Agility\n!Luck\n|-' .. string.format(styles['statlow']) .. noa .. string.format(styles['statlow']) .. str .. string.format(styles['statlow']) .. int .. string.format(styles['statlow']) .. mgc .. string.format(styles['statlow']) .. stm .. string.format(styles['statlow']) .. agl .. string.format(styles['statlow']) .. lck .. '\n|}' .. string.format(styles['smt1table']) .. '\n!Attack\n!Hit\n!Defense\n!Evasion\n!MPower \n!MEffect \n! Drop \n|-' .. string.format(styles['statlow']) .. atk .. string.format(styles['statlow']) .. hit .. string.format(styles['statlow']) .. def .. string.format(styles['statlow']) .. avd .. string.format(styles['statlow']) .. mpw .. string.format(styles['statlow']) .. mef .. string.format(styles['statlow']) .. drop .. '\n|}\n|}' .. resist .. string.format(styles['smt1table']) .. '\n!colspan="3"| List of Skills \n|-\n' .. string.format(styles['skill']) .. 'Skill' .. costt .. string.format(styles['skill']) .. 'Effect' .. '\n|}\n|}' .. categoryb .. categoryd .. categorya end

return p --