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[1] or frame.args.Image local magdrop = frame.args[2] or frame.args['Mag Drop'] local mag = frame.args[3] or frame.args.MAG or '' local cp = frame.args[4] or frame.args.CP or '' local race = frame.args[5] or frame.args.Race or frame.args.Clan or '' local alignment = frame.args[6]or frame.args.Alignment or frame.args.Align or '' local level = frame.args[7] or frame.args.Level or '' local hp = frame.args[8] or frame.args.HP or '' local mp = frame.args[9] or frame.args.MP or '' local noa = frame.args[10] or frame.args.NOA or frame.args.NOH or '' local str = frame.args[11] or frame.args.STR or frame.args.st or '' local int = frame.args[12] or frame.args.INT or frame.args['in'] or '' local mgc = frame.args[13] or frame.args.MGC or frame.args.ma or '' local stm = frame.args[14] or frame.args.STM or frame.args.vi or '' local agl = frame.args[15] or frame.args.AGL or frame.args.ag or '' local lck = frame.args[16] or frame.args.LCK or frame.args.lu or '' local atk = frame.args[17] or frame.args.Atk or '' local hit = frame.args[18] or frame.args.Hit or '' local def = frame.args[19] or frame.args.Def or '' local avd = frame.args[20] or frame.args.Avd or frame.args.Eva or '' local mpw = frame.args[21] or frame.args.Mpw or '' local mef = frame.args[22] or frame.args.Mef or '' local drop = frame.args[23] or frame.args.Drop or '' local resist = frame.args[24] or frame.args.Resist or frame.args.Affinity 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 = styles['smt1table'] .. '\n!width=100|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 = '' elseif not alignment or alignemnt ==  or '-' then categorya =  end if not magdrop or magdrop == '' then magdrop = mag end if cp then cp = ' / cp' else cp = '' end local costt if magdrop then costt = styles['skillc'] .. '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|' .. styles['smt1table'] .. '\n! Race \n! Alignment \n!HP\n!MP\n!' .. magt .. '\n|-' .. styles['statlow'] .. alignment .. styles['statlow'] .. level .. styles['statlow'] .. hp .. styles['statlow'] .. mp .. styles['statlow'] .. magdrop .. '\n|}' .. styles['smt1table'] .. '\n!NOH \n!Strength\n!Intelligence\n!Magic\n!Vitality\n!Agility\n!Luck\n|-' .. styles['statlow'] .. noa .. styles['statlow'] .. str .. styles['statlow'] .. int .. styles['statlow'] .. mgc .. styles['statlow'] .. stm .. styles['statlow'] .. agl .. styles['statlow'] .. lck .. '\n|}' .. styles['smt1table'] .. '\n!Attack\n!Hit\n!Defense\n!Evasion\n!MPower \n!MEffect \n! Drop \n|-' .. styles['statlow'] .. atk .. styles['statlow'] .. hit .. styles['statlow'] .. def .. styles['statlow'] .. avd .. styles['statlow'] .. mpw .. styles['statlow'] .. mef .. styles['statlow'] .. drop .. '\n|}\n|}' .. resist .. styles['smt1table'] .. '\n!colspan="3"| List of Skills \n|-\n' .. styles['skillc'] .. 'Skill' .. costt .. styles['skillc'] .. 'Effect' .. '\n|}\n|}' .. categoryb .. categoryd .. categorya end

return p --