2023年政策修订增补工作正在进行中,欢迎参与!
  • Moegirl.ICU:萌娘百科流亡社群 581077156(QQ),欢迎对萌娘百科运营感到失望的编辑者加入
  • Moegirl.ICU:账号认领正在试运行,有意者请参照账号认领流程

Module:Sandbox/Greykid/psk

萌娘百科,万物皆可萌的百科全书!转载请标注来源页面的网页链接,并声明引自萌娘百科。内容不可商用。
跳转到导航 跳转到搜索
Template-info.svg 模块文档  [创建] [刷新]
local getArgs = require('Module:Arguments').getArgs
local getGames = require('Module:psk/Gamedata')
 
local p = {}
 
local function makeInvokeFunction(funcName)
	return function (frame)
		local args = getArgs(frame, {parentOnly = true})
		return p[funcName](args)
	end
end
 
local styles = {
	['skill'] = '\n|-\n!style="background:#000;color:#fff"|',
	['skillc'] = '\n!style="background:#000;color:#fff"|',
	['skill3'] = '\n!style="background:#000;color:#fff;',
	['skill3m'] = '\n!style="background:transparent"|',
	['cost1'] = '\n|style="background:#222"|',
	['cost2'] = '\n|style="background:#282828"|',
	['effect1'] = '\n|style="background:#222;text-align:left;padding-left:5px"|',
	['effect2'] = '\n|style="background:#282828;text-align:left;padding-left:5px"|',
	['effect1p'] = '\n|colspan=2 style="background:#222;text-align:left;padding-left:5px"|',
	['effect2p'] = '\n|colspan=2 style="background:#282828;text-align:left;padding-left:5px"|',
	['order'] = '\n|style="background:#000;color:#fff;text-align:left;padding-left:5px"|',
	['table2h'] = '\n{|width="100%" class="customtable ',
	['table2'] = '\n{|width="100%" class="customtable"',
	['table2b'] = '\n{|cellpadding=0 cellspacing=0 style="width:100%;background:transparent" ',
	['statlow'] = '\n|style="background:#000;color:#fff"|',
	['statlow2'] = '\n|style="background:#fff;color:#000"|',
	['statlow3'] = '\n|style="background:#000;',
	['quote'] = '\n|-\n|style="background:#000;color:#fff;text-align:center;border-radius:3.5px;',
	}
 
local function frac(numerator,denominator)
	return '<span style="font-size:9px;position:relative;top:2px"><span style="position:relative;top:-5px;right:-3px">' .. numerator .. '</span><span style="position:relative;top:-2px">/</span>' .. denominator .. '</span>'
end
 
local function resoutput(v,denominator,game)
	if not denominator then denominator = 8 end
	if v == 'dr' or v == 'ab' then
		v = 'color:lime" title="吸"|Dr'
	elseif v == '.5dr' or v == '.5ab' or v == '50dr' or v == '50ab' or v == 'dr50' or v == 'ab50' then
		v = 'color:lime" title="50% 吸"|<span style="color:white">½</span>Dr'
	elseif v == '2dr' or v == '2ab' then
		v = 'color:lime" title="2x 吸"|<span style="color:white">2×</span>Dr'
	elseif v == 'rp' or v == 'rf' then
		v = 'color:cyan" title="反"|Rf'
	elseif v == '.5rp' or v == '.5rf' or v == '50rp' or v == '50rf' or v == 'rp50' or v == 'rf50' then
		v = 'color:cyan" title="50% 反"|<span style="color:white">½</span>Rf'
	elseif v == '1.5rp' or v == '1.5rf' or v == '150rp' or v == '150rf' or v == 'rp150' or v == 'rf150' then
		v = 'color:cyan" title="150% 反"|<span style="color:white">1.5×</span>Rf'
	elseif v == '2rp' or v == '2rf' then
		v = 'color:cyan" title="2x 反"|<span style="color:white">2×</span>Rf'
	elseif tonumber(v) == 0 then
		v = 'color:white" title="无"|Nu'
	elseif tonumber(v) == 1 then
		v = '" title="—"| -'
	elseif tonumber(v) < 1 then
		v = 'color:teal"  title="抗"|' .. frac((tonumber(v) * denominator),denominator)
	elseif tonumber(v) > 2 then
		v = 'color:red" title="弱"|' .. v .. '×'
	elseif tonumber(v) > 1.3 then
			v = 'color:red" title="弱"|' .. v .. '×'
	elseif tonumber(v) > 1.1 then
			v = 'color:orange" title="感"|' .. v .. '×'
	end
	return styles.statlow3 .. v
end
 
local function cate(catename)
	if mw.title.getCurrentTitle():inNamespace('') then 
		return '[[Category:' .. catename .. ']]'
	else
		return ''
	end
end
 
local function noskill(skill,gamed)
	local result = '\n|-\n!colspan=5 style="background:#300;width:600px"|<strong style="color:red;font-size:150%">'
	if skill and gamed then
		result = result .. '未找到技能名称 "' .. skill .. '" 。查阅 [[模块:psk/' .. gamed .. ']] 以确定正确的技能名称。'
	else
		result = result .. '技能名称不能为空(可能为空白行)。'
	end
	return result .. '.</strong>' .. cate('错误引用 模块:psk 的条目') .. '\n|-style="display:none"\n'
end
 
local function getArcana(arcana,game,gamen)
	local result
	if not arcana or arcana == '' or arcana == '-' or arcana == '无' or arcana == 'None' or arcana == 'none'
		then result = '-'
	elseif arcana == 'Coin' or arcana == 'Coins' then result = '{{ruby|星幣|Pentacles}}' -- .. cate('星幣阿爾卡那')
	elseif arcana == 'Pentacle' then result = '{{ruby|星幣|Pentacles}}' -- .. cate('星幣阿爾卡那')
	elseif arcana == 'Sword' or arcana == 'Swords' then result = '{{ruby|寶劍|Swords}}' -- .. cate('寶劍阿爾卡那')
	elseif arcana == 'Cup' or arcana == 'Cups' then result = '{{ruby|聖杯|Cups}}' -- .. cate('聖杯阿爾卡那')
	elseif arcana == 'Wand' or arcana == 'Wands' then result = '{{ruby|權杖|Wands}}' -- .. cate('權杖阿爾卡那')
	elseif arcana == 'Rod' then result = '{{ruby|權杖|Wands}}' -- .. cate('權杖阿爾卡那')
	else result = arcana -- .. cate(arcana .. '阿爾卡那')
	end
	return result
end
 
local function bar(color,stat,ratio,cap,stat2,old,new) -- ratio is the length (in pixel) of each point. Cap times ratio equals max length of the stat bar.
	local stat_st, stat_width
	if stat == 'i' then
		stat = 'i'
	elseif not tonumber(stat) then
		stat_st = '<span style="color:#666">--</span>'
		stat = 0
		stat_width = 0
	elseif stat2 then
		stat_st = '<span style="color:#aff;cursor:help" title="' .. old .. ': ' .. stat .. '; ' .. new .. ': ' .. stat2 .. '">' .. stat2 .. '</span>'
	else stat_st = stat
	end
	if stat == 'i' then
	elseif tonumber(stat) > cap then
		stat_width = cap * ratio
		color = '#aaf'
	elseif stat_width ~= 0 then
		stat_width = tonumber(stat) * ratio
	end
		inherit = '继承'
	if tostring(stat_st) == '+0' then stat_st = '<span style="color:#666">--</span>' end
	if stat == 'i' then
		return '--\n|继承\n|-'
	elseif stat2 then
		return stat_st .. '\n|style="border-radius:10px;background-color:#000;background:linear-gradient(90deg, #2c2a46, #000);width:' .. cap * ratio + 3 .. 'px"|<div style="overflow:hidden"><div style="cursor:help;float:left;border-top:5px solid ' .. color .. ';width:' .. stat_width .. 'px" title="' .. old .. ': '.. stat ..'"></div><div style="cursor:help;float:left;border-top:5px solid #aff;width:' .. tonumber(stat2) * ratio - stat_width .. 'px" title="' .. new .. ': '.. stat2 ..'"></div></div>\n|-'
	else return stat_st .. '\n|style="border-radius:10px;background-color:#000;background:linear-gradient(90deg, #2c2a46, #000);width:' .. cap * ratio + 3 .. 'px"|<div style="overflow:hidden"><div style="float:left;border-top:5px solid ' .. color .. ';width:' .. stat_width .. 'px"></div><div style="float:left;border-top:5px solid transparent;width:' .. (cap - tonumber(stat)) * ratio .. 'px"></div></div>\n|-'
	end
end
 
local function get_prop(args)
	local prop = {}
	for k, v in pairs(require('Module:psk/Property_names')) do
		for _, name in ipairs(v) do
			if args[name] then
				prop[k] = args[name]
				break
			end
		end
		prop[k] = prop[k] or v.default
	end
	return prop
end
 
p.stats = makeInvokeFunction('_stats')
 
function p._stats(args)
	local game = args[1] or args.game or args.Game or ''
	game = game:lower()
	if args.FES then game = 'p3f' end
	if args.P3P then game = 'p3p' end
	if args.P4G then game = 'p4g' end
	if args.P5R then game = 'p5r' end
	local gameg -- Game general style
	if getGames.games[game].fallback then
		gameg = getGames.games[game].fallback -- e.g. 'p3f' and 'p3p' will fall back to 'p3' if applicable.
		else gameg = game
	end
	local gamen = getGames.games[game].name -- Full game name
	local gamegn = getGames.games[gameg].name -- e.g. '女神異聞錄3 FES' will fall back to '女神異聞錄3' if applicable.
	local gamed
	if gameg then gamed = gameg:upper() end
	local data
	data = require('Module:psk/' .. gamed)
	local prop = get_prop(args)
	styles.h = '\n!style="background: ' .. getGames.games[gameg].colorbg .. ';color: ' .. getGames.games[gameg].font .. '" '
	styles.spanc = '<span style="color:' .. getGames.games[gameg].font .. '">'
	if not getGames.games[gameg].statt then getGames.games[gameg].statt = '#529488' end
	styles.barh = '\n|style="color:' .. getGames.games[gameg].statt .. '" '
	styles.bart11 = '\n|rowspan=2 style="padding:0" width='
	styles.bart12 = '|\n{|cellspacing=2 cellpadding=0 style="background:transparent;font-size:11px;font-family:monospace;letter-spacing:-1px;line-height:'
	styles.bard = '\n|style="text-align:right;padding:0 3px" '
	styles.bard1 = styles.bard .. 'width=12px|'
	styles.bard2 = styles.bard .. 'width=17px|'
	local result = '{|align="center" style="min-width:650px;text-align:center; background: #222; border:2px solid ' .. getGames.games[gameg].colorb .. '; border-radius:10px; font-size:75%; font-family:verdana;"\n|-\n|' .. styles.table2b
	if getGames.games[gameg].statb == nil then
		styles.barc = 'orange'
	else
		styles.barc = getGames.games[gameg].statb
	end
	if prop.image then
		result = result .. '\n!style="width:20px;border:#333 solid 2px;border-radius:7px;background:'
		if gameg == 'p1' or gameg == 'p2is' or gameg == 'p2ep' or gameg == 'p3' then result = result .. 'transparent'
		else result = result .. '#000'
		end
		result = result .. '"|' .. prop.image
	end
	result = result .. '\n|'
	if prop.location then prop.location = '[[' .. prop.location .. ']]' else prop.location = '' end
	if gameg == 'p1' then
		if prop.vit2 then
			prop.p1vi = '|<span style="color:#aff;cursor:help" title="在 PSX 和 PSP 平台上的属性值可能不同。">Vitality</span>' .. styles.bard2 .. bar(styles.barc,prop.vit,2.4,99,prop.vit2,'PSX 版','PSP 版')
		else prop.p1vi = '|Vitality' .. styles.bard2 .. bar(styles.barc,prop.vit,2.4,99)
		end
		if prop.dex2 then
			prop.p1dx = '|<span style="color:#aff;cursor:help" title="在 PSX 和 PSP 平台上的属性值可能不同。">Dexterity</span>' .. styles.bard2 .. bar(styles.barc,prop.dex,2.4,99,prop.dex2,'PSX 版','PSP 版')
		else prop.p1dx = '|Dexterity' .. styles.bard2 .. bar(styles.barc,prop.dex,2.4,99)
		end
		if prop.boss or prop.enemy or prop.hp then
			if prop.order2 then
				prop.p1order = getRace(prop.race,gameg,'PSX 版') .. ' / ' .. getRace(prop.order2,gameg,'PSP 版')
				else prop.p1order = getRace(prop.race,gameg)
			end
			if not prop.etype then prop.etype = '' end
			if not prop.element then prop.element = '' end
			if not prop.hp then prop.hp = '' end
			if not prop.mp then prop.mp = '' end
			result = result .. styles.table2 .. styles.h .. '|[[人格面具/种族|' .. styles.spanc .. 'Order</span>]]' .. styles.h .. '|Type' .. styles.h .. '|Subtype' .. styles.h .. '|Level' .. styles.h .. '|HP' .. styles.h .. '|SP'
			if prop.normal then result = result .. styles.h .. '|[[' .. gamen .. '/物品|' .. styles.spanc .. '掉落</span>]]' end
			result = result .. '\n|-' .. styles.statlow .. prop.p1order .. styles.statlow .. prop.etype .. styles.statlow .. prop.element .. styles.statlow .. prop.level .. styles.statlow .. prop.hp .. styles.statlow .. prop.mp
			if prop.normal then result = result .. styles.statlow .. prop.normal end
			result = result .. '\n|}' .. bossdemoncat(prop.boss,gamen)
			if prop.matk == '' and prop.mdef == '' and prop.str == '' and prop.vit == '' and prop.dex == '' and prop.agl == '' and prop.luc == '' then
			else
				result = result .. styles.table2 .. styles.h .. 'title="Magical Power"|MAtk' .. styles.h .. 'title="Magical Defense"|MDef' .. styles.bart11 .. '324px' .. styles.bart12 .. '0.8"' .. styles.barh .. '|Strength' .. styles.bard2 .. bar(styles.barc,prop.str,2.4,99) .. styles.barh .. prop.p1vi .. styles.barh .. prop.p1dx .. styles.barh .. '|Agility' .. styles.bard2 .. bar(styles.barc,prop.agl,2.4,99) .. styles.barh .. '|Luck' .. styles.bard2 .. bar(styles.barc,prop.luc,2.4,99) .. '\n|}\n|-' .. styles.statlow .. prop.matk .. styles.statlow .. prop.mdef .. '\n|}'
			end
			if prop.traits or prop.convo then
				result = result .. styles.table2
				if prop.traits then result = result .. styles.h .. 'width=50px|[[Personality|' .. styles.spanc .. 'Traits</span>]]' .. styles.order .. prop.traits end
				if prop.convo then result = result .. styles.h .. 'width=50px|[[Special conversation|' .. styles.spanc .. '<abbr title="If equipped with the listed Persona, there is a chance it will talk to this demon if encountered.">Ptalk</abbr>]]' .. styles.order .. prop.convo end
				result = result .. '\n|}'
			end
		else
			if not prop.etype then prop.etype = '' end
			if not prop.element then prop.element = '' end
			if not prop.mp then prop.mp = '' end
			result = result .. styles.table2 .. styles.h .. '|[[Arcana|' .. styles.spanc .. 'Arcana</span>]]' .. styles.h .. '|Type' .. styles.h .. '|Subtype' .. styles.h .. '|Level' .. styles.h .. '|SP cost'
			if prop.totem then result = result .. styles.h .. '|[[Totem|' .. styles.spanc .. 'Totem</span>]]' end
			if prop.preturn then result = result .. styles.h .. '|[[Mystic Change|' .. styles.spanc .. 'Returns</span>]] [[List of ' .. gamen .. ' Items|' .. styles.spanc .. '°</span>]]' end
			result = result .. '\n|-' .. styles.statlow .. getArcana(prop.arcana,gameg,gamen) .. styles.statlow .. prop.etype .. styles.statlow .. prop.element .. styles.statlow .. prop.level .. styles.statlow .. prop.mp
			if prop.totem then result = result .. styles.statlow .. prop.totem end
			if prop.preturn then result = result .. styles.statlow .. prop.preturn end
			result = result .. '\n|}' .. styles.table2 .. styles.h .. 'title="Magical Power"|MAtk' .. styles.h .. 'title="Magical Defense"|MDef' .. styles.bart11 .. '324px' .. styles.bart12 .. '0.8"' .. styles.barh .. '|Strength' .. styles.bard2 .. bar(styles.barc,prop.str,2.4,99) .. styles.barh .. '|Vitality' .. styles.bard2 .. bar(styles.barc,prop.vit,2.4,99) .. styles.barh .. prop.p1dx .. styles.barh .. '|Agility' .. styles.bard2 .. bar(styles.barc,prop.agl,2.4,99) .. styles.barh .. '|Luck' .. styles.bard2 .. bar(styles.barc,prop.luc,2.4,99) .. '\n|}\n|-' .. styles.statlow .. prop.matk .. styles.statlow .. prop.mdef .. '\n|}'
			if args.Affinity or prop.convo then
				result = result .. styles.table2
					if args.Affinity then result = result .. styles.h .. 'width=60px title="Characters with ' .. "'Best'" .. ' Affinity"|[[Affinity (Persona)|' .. styles.spanc .. '<abbr>Affinity</abbr></span>]]' .. styles.order .. args.Affinity end
					if prop.convo then result = result .. styles.h .. 'width=50px|[[Special conversation|' .. styles.spanc .. '<abbr title="If equipped with this Persona, there is a chance it will talk to listed demon if encountered.">Ptalk</abbr>]]' .. styles.order .. prop.convo end
				result = result .. '\n|}' .. cate(gamen .. ' Personas')
			end
		end
	end
	if (gameg == 'p2is' or gameg == 'p2ep' or gameg == 'p5') and prop.quote then
		result = result .. styles.table2b .. styles.quote .. 'font-style:italic"|' .. string.gsub(prop.quote, '!!', '‼') .. '\n|}'
	end -- replace exclamation mark otherwise it will be interpreted as wiki table seperator.
	if gameg == 'p2is' or gameg == 'p2ep' then
		result = result .. styles.table2 .. styles.h .. '|[[Arcana|' .. styles.spanc .. 'Arcana</span>]]'
		if prop.enemy or prop.boss or prop.hp then
			if prop.etype then result = result .. styles.h .. '|Type' end
			result = result .. styles.h .. '|Level'
			if prop.hp then result = result .. styles.h .. '|HP' end
			if prop.normal then result = result .. styles.h .. '|[[List of ' .. gamen .. ' Items|' .. styles.spanc .. 'Normal Drop]]' end
			if prop.rare then result = result .. styles.h .. 'style="background:#8E283D"|Rare Drop' end
			result = result .. '\n|-' .. styles.statlow .. getArcana(prop.arcana,gameg,gamen)
			if prop.etype then result = result .. styles.statlow .. prop.etype end
			result = result .. styles.statlow .. prop.level
			if prop.hp then result = result .. styles.statlow .. prop.hp end
			if prop.normal then result = result .. styles.statlow .. prop.normal end
			if prop.rare then result = result .. styles.statlow .. prop.rare end
			result = result .. bossdemoncat(prop.boss,gamen)
		else
			if not prop.etype then prop.etype = '' end
			if not prop.mp then prop.mp = '' end
			if not prop.bonus then prop.bonus = '' end
			if not prop.preturn then prop.preturn = '' end
			result = result .. styles.h .. '|Type' .. styles.h .. '|Level' .. styles.h .. '|SP cost' .. styles.h .. 'title="Extra stats that are conferred upon every level up with the Persona equipped"|Bonus' .. styles.h .. '|[[Mystic Change|' .. styles.spanc .. 'Returns</span>]] ' .. '[[List of ' .. gamen .. ' Items|' .. styles.spanc .. '°</span>]]' .. '\n|-' .. styles.statlow .. getArcana(prop.arcana,gameg,gamen) .. styles.statlow .. prop.etype .. styles.statlow .. prop.level .. styles.statlow .. prop.mp .. styles.statlow .. prop.bonus .. styles.statlow .. prop.preturn .. cate(gamegn .. ' Personas')
		end
		result = result .. '\n|}'
	end
	if gameg == 'p3' or gameg == 'p4' or gameg == 'p5' then
		result = result .. styles.table2
		if gameg == 'p5' and (prop.arcana == nil or prop.arcana == "" or prop.arcana == "-") then
		else result = result ..  styles.h .. '|{{人格面具/阿爾卡那|' .. styles.spanc .. 'Arcana</span>]]'
		end
		result = result .. styles.h .. 'width="50px"|Level'
		if prop.hp then result = result .. styles.h .. 'width="40px"|HP' end
		if prop.mp then result = result .. styles.h .. 'width="40px"|SP' end
		if prop.traits then result = result .. styles.h .. '|[[人格面具/個性|<span style="color:#fff">Type</span>]]' end
		result = result .. styles.bart11 .. '324px' .. styles.bart12 .. '0.8"' .. styles.barh .. '|力' .. styles.bard2 .. bar(styles.barc,prop.str,2.4,99) .. styles.barh .. '|魔' .. styles.bard2 .. bar(styles.barc,prop.magic,2.4,99) .. styles.barh .. '|耐' .. styles.bard2 .. bar(styles.barc,prop.vit,2.4,99) .. styles.barh .. '|速' .. styles.bard2 .. bar(styles.barc,prop.agl,2.4,99) .. styles.barh .. '|運' .. styles.bard2 .. bar(styles.barc,prop.luc,2.4,99) .. '\n|}\n|-'
		if gameg == 'p5' and (prop.arcana == nil or prop.arcana == "" or prop.arcana == "-") then
		else result = result .. styles.statlow .. getArcana(prop.arcana,gameg,gamegn)
		end
		result = result .. styles.statlow .. prop.level
		if prop.hp then result = result .. styles.statlow .. prop.hp .. '<div style="position:relative;top:-4px;border:2.5px solid ' .. getGames.games[gameg].hp2 .. '"></div>' end
		if prop.mp then result = result .. styles.statlow .. prop.mp .. '<div style="position:relative;top:-4px;border:2.5px solid ' .. getGames.games[gameg].mp2 .. '"></div>' end
		if prop.traits then result = result .. styles.statlow .. prop.traits end
		result = result .. '\n|}'
		-- if gameg == 'p3' then
			-- if prop.hp then
				-- if prop.boss then
					-- if game == 'p3p' then
						-- result = result .. cate('P3P Bosses')
					-- elseif game == 'p3f' then
						-- result = result .. cate(gamegn .. ' Bosses')
					-- else result = result .. cate(gamegn .. ' Bosses') .. cate('P3P Bosses')
					-- end
				-- else result = result .. cate(gamegn .. ' Shadows')
				-- end
			-- else
				-- if game == 'p3p' or game == 'p3f' then
					-- result = result .. cate('P3F Personas') .. cate('P3P Personas')
				-- else result = result .. cate(gamegn .. ' Personas') .. cate('P3F Personas') .. cate('P3P Personas')
				-- end
			-- end
		-- end
		-- if gameg == 'p4' then
			-- if prop.hp then
				-- if prop.boss then
					-- if prop.vanilla then
						-- result = result .. cate(gamen .. ' Bosses')
					-- elseif game == 'p4g' then
						-- result = result .. cate(gamen .. ' Bosses')
					-- else result = result .. cate(gamegn .. ' Bosses') .. cate('P4G Bosses')
					-- end
				-- else
					-- if prop.vanilla then
						-- result = result .. cate(gamen .. ' Shadows')
					-- elseif game == 'p4g' then
						-- result = result .. cate(gamen .. ' Shadows')
					-- else result = result .. cate(gamegn .. ' Shadows') .. cate('P4G Shadows')
					-- end
				-- end
			-- else
				-- if game == 'p4g' then
					-- result = result .. cate(gamen .. ' Personas')
				-- else result = result .. cate(gamegn .. ' Personas') .. cate('P4G Personas')
				-- end
			-- end
		-- end
		-- if gameg == 'p5' then
			-- if prop.hp then
				-- if prop.boss then
					-- result = result .. cate(gamen .. ' Bosses')
				-- elseif prop.shadow then
					-- result = result .. cate(gamen .. ' Shadows')
				-- else
					-- result = result .. cate(gamen .. ' Enemies')
				-- end
			-- else
				-- result = result .. cate(gamen .. ' Personas')
			-- end
		-- end
	-- end
	if gameg == 'pq' or gameg == 'pq2' then
		if not prop.arcana then
			if not prop.drop1 then prop.drop1 = '-' end
			if not prop.drop2 then prop.drop2 = '-' end
			if not prop.drop3 then prop.drop3 = '-' end
			result = result .. styles.table2 .. styles.h .. 'width=12%|Level' .. styles.h .. 'width=12%|HP' .. styles.h .. 'width=12%|攻' .. styles.h .. 'width=12%|防'
			result = result .. styles.bart11 .. '324px' .. styles.bart12 .. '0.8"' .. styles.barh .. '|力' .. styles.bard2 .. bar(styles.barc,prop.str,2.4,99) .. styles.barh .. '|魔' .. styles.bard2 .. bar(styles.barc,prop.magic,2.4,99) .. styles.barh .. '|耐' .. styles.bard2 .. bar(styles.barc,prop.vit,2.4,99) .. styles.barh .. '|速' .. styles.bard2 .. bar(styles.barc,prop.agl,2.4,99) .. styles.barh .. '|運' .. styles.bard2 .. bar(styles.barc,prop.luc,2.4,99) .. '\n|}\n|-' .. styles.statlow .. prop.level .. styles.statlow .. prop.hp .. styles.statlow .. prop.atk .. styles.statlow .. prop.def .. '\n|}'
			result = result .. styles.table2 .. styles.h .. 'width=16%|Exp' .. styles.h .. 'width=28%|掉落品 1' .. styles.h .. 'width=28%|掉落品 2' .. styles.h
			if prop.dropc and prop.condition then result = result .. 'width=28%|Conditional' else result = result .. 'width=28%|掉落品 3' end
			result = result .. '\n|-\n' .. styles.statlow .. prop.xp .. styles.statlow .. prop.drop1 .. styles.statlow .. prop.drop2 .. styles.statlow
			if prop.dropc and prop.condition then result = result .. '<abbr title="' .. prop.condition .. '">' .. prop.dropc .. '</abbr>'
			else result = result .. prop.drop3 end
			-- if prop.boss then
				-- result = result .. cate(gamegn .. ' Bosses')
			-- else result = result .. cate(gamegn .. ' Shadows')
			-- end
		elseif prop.hp or prop.mp then -- sub-persona
			if not prop.inherit then prop.inherit = '-' end
			if not prop.card then prop.card = '-' end
			if not prop.fragment then prop.fragment = '-' end
			if gameg == 'pq' then
			    result = result .. styles.table2 .. styles.h .. '|[[Arcana|' .. styles.spanc .. 'Arcana</span>]]' .. styles.h .. 'width=10%|Level' .. styles.h .. 'title="HP bonus. Replenishes after battle." width=10%|HP +' .. styles.h .. 'title="SP bonus. Replenishes after battle." width=10%|SP +' .. styles.h .. '|Inherit' .. styles.h .. '|[[Skill Card|' .. styles.spanc .. 'Extract</span>]]' .. styles.h .. '|[[Sacrificial fusion|' .. styles.spanc .. 'Fragment]]\n|-\n'
			    result = result .. styles.statlow .. getArcana(prop.arcana,gameg,gamen) .. styles.statlow .. prop.level .. styles.statlow .. prop.hp .. styles.statlow .. prop.mp .. styles.statlow .. prop.inherit .. styles.statlow .. prop.card .. styles.statlow .. prop.fragment .. cate(gamegn .. ' Personas')
		    else
		        result = result .. styles.table2 .. styles.h .. '|[[Arcana|' .. styles.spanc .. 'Arcana</span>]]' .. styles.h .. 'width=10%|Level' .. styles.h .. 'title="HP bonus. Replenishes after battle." width=10%|HP +' .. styles.h .. 'title="SP bonus. Replenishes after battle." width=10%|SP +' .. styles.h .. '|Type' .. styles.h .. '|[[Skill Card|' .. styles.spanc .. 'Extract</span>]]\n|-\n'
		        result = result .. styles.statlow .. getArcana(prop.arcana,gameg,gamen) .. styles.statlow .. prop.level .. styles.statlow .. prop.hp .. styles.statlow .. prop.mp .. styles.statlow .. prop.inherit .. styles.statlow .. prop.card .. cate(gamegn .. ' Personas')
	        end
		else -- main persona
			result = result .. styles.table2 .. styles.h .. '|[[Arcana|' .. styles.spanc .. 'Arcana</span>]]' .. styles.h .. 'width=10%|Level'
			result = result .. styles.bart11 .. '324px' .. styles.bart12 .. '0.8"' .. styles.barh .. '|Strength' .. styles.bard2 .. bar(styles.barc,prop.str,2.4,99) .. styles.barh .. '|Magic' .. styles.bard2 .. bar(styles.barc,prop.magic,2.4,99) .. styles.barh .. '|Endurance' .. styles.bard2 .. bar(styles.barc,prop.vit,2.4,99) .. styles.barh .. '|Agility' .. styles.bard2 .. bar(styles.barc,prop.agl,2.4,99) .. styles.barh .. '|Luck' .. styles.bard2 .. bar(styles.barc,prop.luc,2.4,99) .. '\n|}\n|-' .. styles.statlow .. getArcana(prop.arcana,gameg,gamegn) .. styles.statlow .. prop.level
			if not prop.nocat then result = result .. cate(gamegn .. ' Personas') end
		end
		result = result .. '\n|}'
	end
	if gameg == 'p3' or gameg == 'p4' or gameg == 'p5' then
		if prop.sword or prop.strike or prop.pierce or prop.phys or prop.fire or prop.ice or prop.elec or prop.wind or prop.expel or prop.dark or prop.alm or prop.xp or prop.yen then
		result = result .. styles.table2
			if not prop.sword then prop.sword = '-' end
			if not prop.strike then prop.strike = '-' end
			if not prop.pierce then prop.pierce = '-' end
			if not prop.phys then prop.phys = '-' end
			if not prop.gun then prop.gun = '-' end
			if not prop.fire then prop.fire = '-' end
			if not prop.ice then prop.ice = '-' end
			if not prop.elec then prop.elec = '-' end
			if not prop.wind then prop.wind = '-' end
			if not prop.psy then prop.psy = '-' end
			if not prop.nuke then prop.nuke = '-' end
			if not prop.expel then prop.expel = '-' end
			if not prop.dark then prop.dark = '-' end
			if not prop.alm then prop.alm = '-' end
			elseif gameg == 'p3' then result = result .. styles.h .. 'width=10%|斩' .. styles.h .. 'width=10%|擊' .. styles.h .. 'width=10%|貫' .. styles.h .. 'width=10%|火' .. styles.h .. 'width=10%|冰' .. styles.h .. 'width=10%|電' .. styles.h .. 'width=10%|風' .. styles.h .. 'width=10%|光' .. styles.h .. 'width=10%|暗' .. styles.h .. 'width=10%|萬能' .. '\n|-\n'
			elseif gameg == 'p4' then result = result .. styles.h .. 'width=14%|物' .. styles.h .. 'width=12%|火' .. styles.h .. 'width=12%|冰' .. styles.h .. 'width=12%|電' .. styles.h .. 'width=12%|風' .. styles.h .. 'width=12%|光' .. styles.h .. 'width=12%|暗' .. styles.h .. 'width=14%|萬能' .. '\n|-\n'
			elseif gameg == 'p5' then result = result .. styles.h .. 'width=9%|物' .. styles.h .. 'width=9%|槍' .. styles.h .. 'width=9%|火' .. styles.h .. 'width=9%|冰' .. styles.h .. 'width=9%|電' .. styles.h .. 'width=9%|風' .. styles.h .. 'width=9%|念' .. styles.h .. 'width=9%|核' .. styles.h .. 'width=9%|祝' .. styles.h .. 'width=9%|咒' .. styles.h .. 'width=10%|萬能' .. '\n|-\n'
			end
			if gameg == 'p3' then result = result .. styles.statlow .. prop.sword .. styles.statlow .. prop.strike .. styles.statlow .. prop.pierce
			elseif gameg == 'p4' then result = result .. styles.statlow .. prop.phys
			elseif gameg == 'p5' then result = result .. styles.statlow .. prop.phys .. styles.statlow -- .. prop.gun
			end
			result = result .. styles.statlow .. prop.fire .. styles.statlow .. prop.ice .. styles.statlow .. prop.elec
			if gameg == 'p3' or gameg == 'p4' or gameg == 'p5' then result = result .. styles.statlow .. prop.wind end
			if gameg == 'p5' then result = result .. styles.statlow .. prop.psy .. styles.statlow .. prop.nuke end
			result = result .. styles.statlow .. prop.expel .. styles.statlow .. prop.dark .. styles.statlow .. prop.alm
			result = result .. '\n|}'
		elseif prop.inherit or prop.resist or prop.block or prop.absorb or prop.reflect or prop.weak then
			result = result .. styles.table2
			if not prop.inherit then prop.inherit = '-' end
			if not prop.resist then prop.resist = '-' end
			if not prop.block then prop.block = '-' end
			if not prop.absorb then prop.absorb = '-' end
			if not prop.reflect then prop.reflect = '-' end
			if not prop.weak then prop.weak = '-' else prop.weak = '<span style="color:#f22">' .. prop.weak .. '</span>' end
			result = result .. styles.h .. '|繼承' .. styles.h .. '|反' .. styles.h .. '|吸' .. styles.h .. '|無' .. styles.h .. '|抗' .. styles.h .. '|弱\n|-\n' .. styles.statlow .. prop.inherit .. styles.statlow .. prop.reflect .. styles.statlow .. prop.absorb .. styles.statlow .. prop.block .. styles.statlow .. prop.resist .. styles.statlow .. prop.weak .. '\n|}'
		end
	end
	if (gameg == 'p2is' or gameg == 'p2ep') and (prop.exclusive or prop.traits or prop.convo) then
		result = result .. styles.table2
		if prop.exclusive then
			result = result .. styles.h .. 'width=90px|Exclusive to' .. styles.order .. prop.exclusive
		end
		if prop.traits then
			result = result .. styles.h .. 'width=50px|[[Personality|' .. styles.spanc .. 'Traits</span>]]' .. styles.order .. prop.traits
		end
		if prop.convo then
			result = result .. styles.h .. 'width=50px|[[Special conversation|' .. styles.spanc .. '<abbr style="border-bottom:1px dotted black;" title="if equipped with this Persona, there is a chance it will talk to this demon if encountered">Ptalk</abbr>]]' .. styles.order .. prop.convo
		end
		result = result .. '\n|}'
	end
	if (gameg == 'p2is' or gameg == 'p2ep') and prop.profile then
		result = result .. styles.table2b .. styles.quote .. '"|' .. string.gsub(prop.profile, '!!', '‼') .. '\n|}'
	end
	if gameg == 'p3' and (prop.card or prop.preturn) then
		result = result .. styles.table2
		if prop.card then
			result = result .. styles.h .. 'width=100px|[[Skill Card|' .. styles.spanc .. 'Skill Card</span>]]' .. styles.order .. '<abbr title="Portable only">' .. prop.card .. '</abbr>'
		end
		if prop.preturn then
			result = result .. styles.h .. 'width=100px|[[Heart Item|' .. styles.spanc .. 'Heart Item</span>]]' .. styles.order .. prop.preturn
		end
		result = result .. '\n|}'
	end
	if (gameg == 'p4') and prop.hp then
		result = result .. styles.table2
			if not prop.xp then prop.xp = '-' end
			if not prop.yen then prop.yen = '-' end
			if not prop.normal then prop.normal = '-' end
			if not prop.rare then prop.rare = '-' end
			result = result .. styles.h .. '|EXP' .. styles.h .. '|Yen' .. styles.h .. '|[[人格面具/掉落物品/' .. gamegn .. '|' .. styles.spanc .. '普通掉落</span>]]' .. styles.h .. '|[[人格面具/掉落物品/' .. gamegn .. '|' .. styles.spanc .. '稀有掉落</span>]]' .. '\n|-\n'
			result = result .. styles.statlow .. prop.xp .. styles.statlow .. prop.yen .. styles.statlow .. prop.normal .. styles.statlow .. prop.rare
		result = result .. '\n|}'
	end
	if (gameg == 'p5') and prop.hp then
		result = result .. styles.table2
			if not prop.xp then prop.xp = '-' end
			if not prop.yen then prop.yen = '-' end
			if not prop.material then prop.material = '-' end
			if not prop.card then prop.card = '-' end
			result = result .. styles.h .. '|EXP' .. styles.h .. '|Yen' .. styles.h .. '|[[人格面具/掉落物品/' .. gamegn .. '|' .. styles.spanc .. '掉落材料</span>]]' .. styles.h .. '|[[人格面具/技能卡|' .. styles.spanc .. '技能卡</span>]]' .. '\n|-\n'
			result = result .. styles.statlow .. prop.xp .. styles.statlow .. prop.yen .. styles.statlow .. prop.material .. styles.statlow .. prop.card
		result = result .. '\n|}'
	end
	result = result .. '\n|}'
-- End of image span.
	if gameg == 'p1' and (prop.onehand or prop.twohand or prop.spear or prop.axe or prop.whip or prop.thrown or prop.arrow or prop.fist or prop.handgun or prop.machinegun or prop.shotgun or prop.rifle or prop.tech or prop.rush or prop.fire or prop.ice or prop.wind or prop.earth or prop.elec or prop.nuke or prop.blast or prop.gravity or prop.expel or prop.miracle or prop.death or prop.curse or prop.nerve or prop.hiero) then
		if not prop.onehand then prop.onehand = '-' end
		if not prop.twohand then prop.twohand = '-' end
		if not prop.spear then prop.spear = '-' end
		if not prop.axe then prop.axe = '-' end
		if not prop.whip then prop.whip = '-' end
		if not prop.thrown then prop.thrown = '-' end
		if not prop.arrow then prop.arrow = '-' end
		if not prop.fist then prop.fist = '-' end
		if not prop.handgun then prop.handgun = '-' end
		if not prop.machinegun then prop.machinegun = '-' end
		if not prop.shotgun then prop.shotgun = '-' end
		if not prop.rifle then prop.rifle = '-' end
		if not prop.tech then prop.tech = '-' end
		if not prop.rush then prop.rush = '-' end
		if not prop.fire then prop.fire = '-' end
		if not prop.ice then prop.ice = '-' end
		if not prop.wind then prop.wind = '-' end
		if not prop.earth then prop.earth = '-' end
		if not prop.elec then prop.elec = '-' end
		if not prop.nuke then prop.nuke = '-' end
		if not prop.blast then prop.blast = '-' end
		if not prop.gravity then prop.gravity = '-' end
		if not prop.expel then prop.expel = '-' end
		if not prop.miracle then prop.miracle = '-' end
		if not prop.death then prop.death = '-' end
		if not prop.curse then prop.curse = '-' end
		if not prop.nerve then prop.nerve = '-' end
		if not prop.hiero then prop.hiero = '-' end
		result = result .. styles.table2 .. '\n!style="background:#a9a9a9" title="Weapons" colspan="8"|\n!title="Firearms" style="background:#898989" colspan="4"|\n!style="background:#a9a9a9" title="Havoc" colspan="2"|\n|-' .. styles.h .. 'title="Weapons"|<abbr title="1-handed Sword">1h</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="2-handed Sword">2h</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Spear">Sp</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Axe">Ax</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Whip">Wp</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Thrown">Th</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Arrows">Ar</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Fist">Fs</abbr>' .. styles.h .. 'title="Firearms" style="background:#898989;width:7.12%"|<abbr title="Handgun">HG</abbr>' .. styles.h .. 'title="Firearms" style="background:#898989;width:7.12%"|<abbr title="Machinegun">MG</abbr>' .. styles.h .. 'title="Firearms" style="background:#898989;width:7.12%"|<abbr title="Shotgun">SG</abbr>' .. styles.h .. 'title="Firearms" style="background:#898989;width:7.12%"|<abbr title="Rifle">Ri</abbr>' .. styles.h .. 'title="Havoc"|<abbr title="Tech">Te</abbr>' .. styles.h .. 'title="Havoc"|<abbr title="Rush">Ru</abbr>\n|-\n' .. styles.statlow .. prop.onehand .. styles.statlow .. prop.twohand .. styles.statlow .. prop.spear .. styles.statlow .. prop.axe .. styles.statlow .. prop.whip .. styles.statlow .. prop.thrown .. styles.statlow .. prop.arrow .. styles.statlow .. prop.fist .. styles.statlow .. prop.handgun .. styles.statlow .. prop.machinegun .. styles.statlow .. prop.shotgun .. styles.statlow .. prop.rifle .. styles.statlow .. prop.tech .. styles.statlow .. prop.rush
		result = result .. '\n|-\n!style="background:#a9a9a9" title="Element" colspan="4"|\n!style="background:#898989" title="Force" colspan="4"|\n!style="background:#a9a9a9" title="Light" colspan="2"|\n!style="background:#898989" title="Dark" colspan="3"|\n!style="background:#a9a9a9" title="Special" colspan="1"|\n|-' .. styles.h .. 'width="7.12%" title="Element"|<abbr title="Fire">Fi</abbr>' .. styles.h .. 'width="7.12%" title="Element"|<abbr title="Ice">Ic</abbr>' .. styles.h .. 'width="7.12%" title="Element"|<abbr title="Wind">Wi</abbr>' .. styles.h .. 'width="7.12%" title="Element"|<abbr title="Earth">Er</abbr>' .. styles.h .. 'style="background:#898989;width:7.12%" title="Force"|<abbr title="Electricity">El</abbr>' .. styles.h .. 'style="background:#898989;width:7.12%" title="Force"|<abbr title=.nuke">Nc</abbr>' .. styles.h .. 'style="background:#898989;width:7.12%" title="Force"|<abbr title="Blast">Bl</abbr>' .. styles.h .. 'style="background:#898989;width:7.12%" title="Force"|<abbr title="Gravity">Gr</abbr>' .. styles.h .. 'title="Light"|<abbr title="Expel">Ex</abbr>' .. styles.h .. 'title="Light"|<abbr title="Miracle">Mi</abbr>' .. styles.h .. 'style="background:#898989" title="Dark"|<abbr title="Death">De</abbr>' .. styles.h .. 'style="background:#898989" title="Dark"|<abbr title="Curse">Cu</abbr>' .. styles.h .. 'style="background:#898989;width:7.12%" title="Dark (Ailments)"|<abbr title="Nerve">Nr</abbr>' .. styles.h .. 'width="7.12%" title="Special"|<abbr title="Resistance to Hieroglyphein">???</abbr>\n|-\n' .. styles.statlow .. prop.fire .. styles.statlow .. prop.ice .. styles.statlow .. prop.wind .. styles.statlow .. prop.earth .. styles.statlow .. prop.elec .. styles.statlow .. prop.nuke .. styles.statlow .. prop.blast .. styles.statlow .. prop.gravity .. styles.statlow .. prop.expel .. styles.statlow .. prop.miracle .. styles.statlow .. prop.death .. styles.statlow .. prop.curse .. styles.statlow .. prop.nerve .. styles.statlow .. prop.hiero .. '\n|}'
	end
	if (gameg == 'p2is' or gameg == 'p2ep') and (prop.atk or prop.def or prop.matk or prop.mdef or prop.str or prop.vit or prop.dex or prop.agl or prop.luc) then
		if gameg == 'p2is' then prop.dx_h = '|Dexterity' else prop.dx_h = '|Technique' end
		result = result .. styles.table2 .. styles.h .. 'title="Physical Attack Power"|Atk' .. styles.h .. 'title="Physical Defense"|Def' .. styles.h .. 'title="Magical Power"|Matk' .. styles.h .. 'title="Magical Defense"|Mdef' .. styles.bart11 .. '324px' .. styles.bart12 .. '0.8"' .. styles.barh .. '|Strength' .. styles.bard2 .. bar(styles.barc,prop.str,2.4,99) .. styles.barh .. '|Vitality' .. styles.bard2 .. bar(styles.barc,prop.vit,2.4,99) .. styles.barh .. prop.dx_h .. styles.bard2 .. bar(styles.barc,prop.dex,2.4,99) .. styles.barh .. '|Agility' .. styles.bard2 .. bar(styles.barc,prop.agl,2.4,99) .. styles.barh .. '|Luck' .. styles.bard2 .. bar(styles.barc,prop.luc,2.4,99) .. '\n|}\n|-'
		if not prop.atk or prop.atk == '' then prop.atk = '?' end
		if not prop.def or prop.def == '' then prop.def = '?' end
		if not prop.matk or prop.matk == '' then prop.matk = '?' end
		if not prop.mdef or prop.mdef == '' then prop.mdef = '?' end
		result = result .. '\n|-\n' .. styles.statlow .. prop.atk .. styles.statlow .. prop.def .. styles.statlow .. prop.matk .. styles.statlow .. prop.mdef .. '\n|}'
	end
	if (gameg == 'p2is' or gameg == 'p2ep') and (prop.resist or prop.block or prop.absorb or prop.reflect or prop.weak or prop.boost or prop.wild) then
		result = result .. styles.table2
		if not prop.resist then prop.resist = '-' end
		if not prop.block then prop.block = '-' end
		if not prop.absorb then prop.absorb = '-' end
		if not prop.reflect then prop.reflect = '-' end
		if not prop.weak then prop.weak = '-' else prop.weak = '<span style="color:#f22">' .. prop.weak .. '</span>' end
		result = result .. styles.h .. '|Reflects' .. styles.h .. '|Absorbs' .. styles.h .. '|Void' .. styles.h .. '|Resists' .. styles.h .. '|Weak'
		if prop.boost then
			result = result .. styles.h .. '|Boost'
		end
		result = result .. '\n|-\n' .. styles.statlow .. prop.reflect .. styles.statlow .. prop.absorb .. styles.statlow .. prop.block .. styles.statlow .. prop.resist .. styles.statlow .. prop.weak
		if prop.boost then
			result = result .. styles.statlow .. prop.boost
		end
		result = result .. '\n|}'
	end
	if (gameg == 'p2is' or gameg == 'p2ep') and (prop.sword or prop.pierce or prop.strike or prop.thrown or prop.rush or prop.fire or prop.water or prop.wind or prop.earth or prop.ice or prop.elec or prop.nuke or prop.expel or prop.dark or prop.alm or prop.nerve or prop.mind) then
		result = result .. styles.table2
		if not prop.sword then prop.sword = '-' end
		if not prop.pierce then prop.pierce = '-' end
		if not prop.strike then prop.strike = '-' end
		if not prop.thrown then prop.thrown = '-' end
		if not prop.rush then prop.rush = '-' end
		if not prop.fire then prop.fire = '-' end
		if not prop.water then prop.water = '-' end
		if not prop.wind then prop.wind = '-' end
		if not prop.earth then prop.earth = '-' end
		if not prop.ice then prop.ice = '-' end
		if not prop.elec then prop.elec = '-' end
		if not prop.nuke then prop.nuke = '-' end
		if not prop.expel then prop.expel = '-' end
		if not prop.dark then prop.dark = '-' end
		if not prop.alm then prop.alm = '-' end
		if not prop.nerve then prop.nerve = '-' end
		if not prop.mind then prop.mind = '-' end
		if prop.etype == 'Fire' then prop.Fi = '<span style="color:#8B668B">Fi</span>' else prop.Fi = 'Fi' end
		if prop.etype == 'Water' then prop.Wt = '<span style="color:#8B668B">Wt</span>' else prop.Wt = 'Wt' end
		if prop.etype == 'Wind' then prop.Wi = '<span style="color:#8B668B">Wi</span>' else prop.Wi = 'Wi' end
		if prop.etype == 'Earth' then prop.Er = '<span style="color:#8B668B">Er</span>' else prop.Er = 'Er' end
		if gameg == 'p2ep' then
			prop.name_Rn = 'title="Shot"|Sh'
			prop.name_Hv = 'title="Attack"|Ak'
			prop.name_El = 'title="Lightning"|Ln'
			prop.name_Li = 'title="Holy"|Ho'
		else
			prop.name_Rn = 'title="Ranged"|Rn'
			prop.name_Hv = 'title="Havoc"|Hv'
			prop.name_El = 'title="Electricity"|El'
			prop.name_Li = 'title="Light"|Li'
		end
		result = result .. styles.h .. 'title="Sword"|Sw' .. styles.h .. prop.name_Rn .. styles.h .. 'title="Strike"|Sk' .. styles.h .. 'title="Thrown"|Th' .. styles.h .. prop.name_Hv .. styles.h .. 'style="background:#8E283D" title="Fire"|' .. prop.Fi .. styles.h .. 'style="background:#8E283D" title="Water"|' .. prop.Wt .. styles.h .. 'style="background:#8E283D" title="Wind"|' .. prop.Wi .. styles.h .. 'style="background:#8E283D" title="Earth"|' .. prop.Er .. styles.h .. 'title="Ice"|Ic' .. styles.h .. prop.name_El .. styles.h .. 'title=.nuke"|Nc' .. styles.h .. prop.name_Li .. styles.h .. 'title="Dark"|Dk' .. styles.h .. 'title="Almighty"|Al' .. styles.h .. 'title="Nerve"|Nr' .. styles.h .. 'title="Mind"|Mn\n|-\n'
		result = result .. styles.statlow .. prop.sword .. styles.statlow .. prop.pierce .. styles.statlow .. prop.strike .. styles.statlow .. prop.thrown .. styles.statlow .. prop.rush .. styles.statlow .. prop.fire .. styles.statlow .. prop.water .. styles.statlow .. prop.wind .. styles.statlow .. prop.earth .. styles.statlow .. prop.ice .. styles.statlow .. prop.elec .. styles.statlow .. prop.nuke .. styles.statlow .. prop.expel .. styles.statlow .. prop.dark .. styles.statlow .. prop.alm .. styles.statlow .. prop.nerve .. styles.statlow .. prop.mind .. '\n|}'
	end
	if gameg == 'pq' or gameg == 'pq2' and (prop.sword or prop.pierce or prop.strike or prop.phys or prop.fire or prop.water or prop.elec or prop.wind or prop.nuke or prop.psy or prop.expel or prop.dark or prop.alm or prop.ko or prop.sleep or prop.panic or prop.poison or prop.paralyze or prop.down or prop.stbind or prop.mabind or prop.agbind) then
		result = result .. styles.table2
		if not prop.sword then prop.sword = '-' end
		if not prop.pierce then prop.pierce = '-' end
		if not prop.strike then prop.strike = '-' end
		if not prop.phys then prop.phys = '-' end
		if not prop.fire then prop.fire = '-' end
		if not prop.ice then prop.ice = '-' end
		if not prop.elec then prop.elec = '-' end
		if not prop.wind then prop.wind = '-' end
		if not prop.nuke then prop.nuke = '-' end
		if not prop.psy then prop.psy = '-' end
		if not prop.expel then prop.expel = '-' end
		if not prop.dark then prop.dark = '-' end
		if not prop.alm then prop.alm = '-' end
		if not prop.sleep then prop.sleep = '-' end
		if not prop.panic then prop.panic = '-' end
		if not prop.poison then prop.poison = '-' end
		if not prop.curse then prop.curse = '-' end
		if not prop.paralyze then prop.paralyze = '-' end
		if not prop.stbind then prop.stbind = '-' end
		if not prop.mabind then prop.mabind = '-' end
		if not prop.agbind then prop.agbind = '-' end
		if not prop.down then prop.down = '-' end
		if not prop.ko then prop.ko = '-' end
		if not (prop.arcana and (prop.hp or prop.mp)) then
		    if gameg == 'pq' then
		        result = result .. styles.h .. 'width=10%|Cut' .. styles.h .. 'width=10%|Stab' .. styles.h .. 'width=10%|Bash' .. styles.h .. 'width=10%|Fire' .. styles.h .. 'width=10%|Ice' .. styles.h .. 'width=10% title="Electricity"|Elec' .. styles.h .. 'width=10%|Wind' .. styles.h .. 'width=10%|Light' .. styles.h .. 'width=10%|Dark' .. styles.h .. 'width=10% title="Almighty"|Alm\n|-\n' .. styles.statlow .. prop.sword .. styles.statlow .. prop.pierce .. styles.statlow .. prop.strike .. styles.statlow .. prop.fire .. styles.statlow .. prop.ice .. styles.statlow .. prop.elec .. styles.statlow .. prop.wind .. styles.statlow .. prop.expel .. styles.statlow .. prop.dark .. styles.statlow .. prop.alm .. '\n|}'
	        else
	            result = result .. styles.h .. 'width=10%|Phys' .. styles.h .. 'width=10%|Fire' .. styles.h .. 'width=10%|Ice' .. styles.h .. 'width=10% title="Electricity"|Elec' .. styles.h .. 'width=10%|Wind' .. styles.h .. 'width=10% title="Psychokinesis"|Psy' .. styles.h .. 'width=10% title=.nuke"|Nuke' .. styles.h .. 'width=10%|Bless' .. styles.h .. 'width=10%|Curse' .. styles.h .. 'width=10% title="Almighty"|Alm\n|-\n' .. styles.statlow .. prop.phys .. styles.statlow .. prop.fire .. styles.statlow .. prop.ice .. styles.statlow .. prop.elec .. styles.statlow .. prop.wind .. styles.statlow .. prop.psy .. styles.statlow .. prop.nuke .. styles.statlow .. prop.expel .. styles.statlow .. prop.dark .. styles.statlow .. prop.alm .. '\n|}'
	            end
            end
		if not prop.arcana then --enemy only
		    if gameg == 'pq' then
		        result = result .. styles.table2 .. styles.h .. 'width=10%|Sleep' .. styles.h .. 'width=10%|Panic' .. styles.h .. 'width=10%|Poison' .. styles.h .. 'width=10%|Curse' .. styles.h .. 'width=10%|Paralysis' .. styles.h .. 'width=10% title="Strength Bind"|S-Bind' .. styles.h .. 'width=10% title="Magic Bind"|M-Bind' .. styles.h .. 'width=10% title="Agility Bind"|A-Bind' .. styles.h .. 'width=10%|Down' .. styles.h .. 'width=10% title="Instant Kill"|KO\n|-' .. styles.statlow .. prop.sleep .. styles.statlow .. prop.panic .. styles.statlow .. prop.poison .. styles.statlow .. prop.curse .. styles.statlow .. prop.paralyze .. styles.statlow .. prop.stbind .. styles.statlow .. prop.mabind .. styles.statlow .. prop.agbind .. styles.statlow .. prop.down .. styles.statlow .. prop.ko .. '\n|}'
	        else
	            result = result .. styles.table2 .. styles.h .. 'width=10%|Sleep' .. styles.h .. 'width=10%|Confuse' .. styles.h .. 'width=10%|Poison' .. styles.h .. 'width=10%|Hex' .. styles.h .. 'width=10%|Paralysis' .. styles.h .. 'width=10% title="Strength Bind"|S-Bind' .. styles.h .. 'width=10% title="Magic Bind"|M-Bind' .. styles.h .. 'width=10% title="Agility Bind"|A-Bind' .. styles.h .. 'width=10%|Down' .. styles.h .. 'width=10% title="Instant Kill"|KO\n|-' .. styles.statlow .. prop.sleep .. styles.statlow .. prop.panic .. styles.statlow .. prop.poison .. styles.statlow .. prop.curse .. styles.statlow .. prop.paralyze .. styles.statlow .. prop.stbind .. styles.statlow .. prop.mabind .. styles.statlow .. prop.agbind .. styles.statlow .. prop.down .. styles.statlow .. prop.ko .. '\n|}'
                end
	        end
        end
	if prop.restype then
		if game == 'p1' then
			result = result .. styles.table2 .. '\n!style="background:#a9a9a9" title="Weapons" colspan="8"|\n!title="Firearms" style="background:#898989" colspan="4"|\n!style="background:#a9a9a9" title="Havoc" colspan="2"|\n|-' .. styles.h .. 'title="Weapons"|<abbr title="1-handed Sword">1h</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="2-handed Sword">2h</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Spear">Sp</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Axe">Ax</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Whip">Wp</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Thrown">Th</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Arrows">Ar</abbr>' .. styles.h .. 'title="Weapons"|<abbr title="Fist">Fs</abbr>' .. styles.h .. 'title="Firearms" style="background:#898989;width:7.12%"|<abbr title="Handgun">HG</abbr>' .. styles.h .. 'title="Firearms" style="background:#898989;width:7.12%"|<abbr title="Machinegun">MG</abbr>' .. styles.h .. 'title="Firearms" style="background:#898989;width:7.12%"|<abbr title="Shotgun">SG</abbr>' .. styles.h .. 'title="Firearms" style="background:#898989;width:7.12%"|<abbr title="Rifle">Ri</abbr>' .. styles.h .. 'title="Havoc"|<abbr title="Tech">Te</abbr>' .. styles.h .. 'title="Havoc"|<abbr title="Rush">Ru</abbr>\n|-'
		elseif game == 'p2is' or game == 'p2ep' then
			if prop.etype == 'Fire' then prop.Fi = '<span style="color:#8B668B">Fi</span>' else prop.Fi = 'Fi' end
			if prop.etype == 'Water' then prop.Wt = '<span style="color:#8B668B">Wt</span>' else prop.Wt = 'Wt' end
			if prop.etype == 'Wind' then prop.Wi = '<span style="color:#8B668B">Wi</span>' else prop.Wi = 'Wi' end
			if prop.etype == 'Earth' then prop.Er = '<span style="color:#8B668B">Er</span>' else prop.Er = 'Er' end
			if gameg == 'p2ep' then
				prop.name_Rn = 'title="Shot"|Sh'
				prop.name_Hv = 'title="Attack"|Ak'
				prop.name_El = 'title="Lightning"|Ln'
				prop.name_Li = 'title="Holy"|Ho'
			else
				prop.name_Rn = 'title="Ranged"|Rn'
				prop.name_Hv = 'title="Havoc"|Hv'
				prop.name_El = 'title="Electricity"|El'
				prop.name_Li = 'title="Light"|Li'
			end
			result = result .. styles.table2 .. styles.h .. 'title="Sword"|Sw' .. styles.h .. prop.name_Rn .. styles.h .. 'title="Strike"|Sk' .. styles.h .. 'title="Thrown"|Th' .. styles.h .. prop.name_Hv .. styles.h .. 'style="background:#8E283D" title="Fire"|' .. prop.Fi .. styles.h .. 'style="background:#8E283D" title="Water"|' .. prop.Wt .. styles.h .. 'style="background:#8E283D" title="Wind"|' .. prop.Wi .. styles.h .. 'style="background:#8E283D" title="Earth"|' .. prop.Er .. styles.h .. 'title="Ice"|Ic' .. styles.h .. prop.name_El .. styles.h .. 'title=.nuke"|Nc' .. styles.h .. prop.name_Li .. styles.h .. 'title="Dark"|Dk' .. styles.h .. 'title="Almighty"|Al' .. styles.h .. 'title="Nerve"|Nr' .. styles.h .. 'title="Mind"|Mn\n|-'
		end
		if require('Module:psk/' .. gameg .. '/res').restypes[prop.restype] == nil then
			result = result .. '\n|colspan=16 align=center style="color:#f00;font-size:120%;font-weight:bold"|Invalid value of "' .. prop.restype .. '" for restype. Correct value or edit [[Module:psk/' .. gameg .. '/res]].'
		else
			for i, v in ipairs(require('Module:psk/' .. gameg .. '/res').restypes[prop.restype]) do
				if game == 'p1' then
					if i > 14 then break end
					result = result .. resoutput(v,4,gameg)
				elseif game == 'p2is' or game == 'p2ep' then
					result = result .. resoutput(v,4,gameg)
				else
					result = result .. resoutput(v,8,gameg)
				end
			end
		end
		result = result .. '\n|}'
		if game == 'p1' then
			result = result .. styles.table2 .. '\n|-\n!style="background:#a9a9a9" title="Element" colspan="4"|\n!style="background:#898989" title="Force" colspan="4"|\n!style="background:#a9a9a9" title="Light" colspan="2"|\n!style="background:#898989" title="Dark" colspan="3"|\n!style="background:#a9a9a9" title="Special" colspan="1"|\n|-' .. styles.h .. 'width="7.12%" title="Element"|<abbr title="Fire">Fi</abbr>' .. styles.h .. 'width="7.12%" title="Element"|<abbr title="Ice">Ic</abbr>' .. styles.h .. 'width="7.12%" title="Element"|<abbr title="Wind">Wi</abbr>' .. styles.h .. 'width="7.12%" title="Element"|<abbr title="Earth">Er</abbr>' .. styles.h .. 'style="background:#898989;width:7.12%" title="Force"|<abbr title="Electricity">El</abbr>' .. styles.h .. 'style="background:#898989;width:7.12%" title="Force"|<abbr title=.nuke">Nc</abbr>' .. styles.h .. 'style="background:#898989;width:7.12%" title="Force"|<abbr title="Blast">Bl</abbr>' .. styles.h .. 'style="background:#898989;width:7.12%" title="Force"|<abbr title="Gravity">Gr</abbr>' .. styles.h .. 'title="Light"|<abbr title="Expel">Ex</abbr>' .. styles.h .. 'title="Light"|<abbr title="Miracle">Mi</abbr>' .. styles.h .. 'style="background:#898989" title="Dark"|<abbr title="Death">De</abbr>' .. styles.h .. 'style="background:#898989" title="Dark"|<abbr title="Curse">Cu</abbr>' .. styles.h .. 'style="background:#898989;width:7.12%" title="Dark (Ailments)"|<abbr title="Nerve">Nr</abbr>' .. styles.h .. 'width="7.12%" title="Special"|<abbr title="Resistance to Hieroglyphein">???</abbr>\n|-'
			for i , v in ipairs(require('Module:psk/' .. gameg .. '/res').restypes[prop.restype]) do
				if i < 15 then
				else
					result = result .. resoutput(v,4,gameg)
				end
			end
			result = result .. '\n|}'
		end
	end
	if gameg == 'p2is' or gameg == 'p2ep' then
		if prop.card or prop.material or prop.type1 or prop.type2 or prop.type3 then
			result = result .. styles.table2 ..  styles.h .. 'colspan=4|Summon Information\n|-'
			if prop.material then
				result = result .. styles.skill .. '[[Material Card|' .. styles.spanc .. 'Material Card</span>]]' .. styles.effect1 .. '[[File:Material_Card_Icon_(P2ISP).png|alt=|link=]] <span style="color:yellow;font-weight:bold">' .. prop.material .. '</span> Card'
			end
			if prop.card then
				result = result .. styles.skillc .. '[[Tarot Card|' .. styles.spanc .. 'Tarot Cards</span>]]' .. styles.effect1 .. '<span style="color:yellow;font-weight:bold">' .. prop.card .. ' [[File:Tarot_Card_Symbol_2.png|alt=|link=]] ' .. prop.arcana .. '</span> Cards'
			end
			local effect1
			if prop.material then
				effect1 = '\n|colspan=3 style="background:#222;text-align:left"|'
			else
				effect1 = styles.effect1
			end
			if prop.type1 then
				result = result .. styles.skill .. prop.type1 .. effect1 .. prop.desc1
			end
			if prop.type2 then
				result = result .. styles.skill .. prop.type2 .. effect1 .. prop.desc2
			end
			if prop.type3 then
				result = result .. styles.skill .. prop.type3 .. effect1 .. prop.desc3
			end
			result = result .. '\n|}'
		end
	end
	if prop.fusion then
		result = result .. styles.table2 .. styles.h .. 'width=100px|[[Special fusion#' .. gamegn .. '|' .. styles.spanc .. 'Special fusion</span>]]' .. styles.order .. prop.fusion .. '\n|}'
	end
	local skill, alias, skillcell, skille, cost, effect, pre, range, power, target
	if prop.dskills then
		result = result .. styles.table2 .. styles.h .. 'colspan=3|[[List of ' .. gamegn .. ' Skills|' .. styles.spanc .. 'Default Skills</span>]]' .. styles.skill .. 'Skill' .. styles.skillc .. 'Cost' .. styles.skillc .. 'Effect'
		for k, v in ipairs(mw.text.split(prop.dskills, '\n')) do
			skill = data.skills[v]
			if not skill then
				alias = data.aliases[v]
				if alias then
					v = alias
					skill = data.skills[v]
				end
			end
			if v == '' then
				skillcell = ''
				cost = ''
				effect = noskill()
			elseif not skill then
				skillcell = ''
				cost = ''
				effect = noskill(v,gamed)
			elseif skill then
				cost = skill.cost
				effect = skill.effect
				if (k % 2 == 0) then
					cost = styles.cost2 .. cost
					effect = styles.effect2 .. effect
				else
					cost = styles.cost1 .. cost
					effect = styles.effect1 .. effect
				end
				if skill.name then v = skill.name end
				skillcell = styles.skill .. v
			end
			result = result .. skillcell .. cost .. effect
		end
		result = result .. '\n|}'
	end
	if prop.skills then
		result = result .. styles.table2h
		if gameg == 'p5' then
			result = result .. '"\n!colspan=4 style="background-color: ' .. getGames.games[gameg].colorb .. ';background: linear-gradient(120deg, ' .. getGames.games[gameg].colorb .. ' 42%, #000 42.1%, #000 43%, #fff 43.1%, #fff 57%, #000 57.1%, #000 58%, ' .. getGames.games[gameg].colorb .. ' 58.1%"|[[List of ' .. gamegn .. ' Skills|<span style="color:black;text-shadow:-3px 3px 3px #0ff">List of Skills</span>]]'
		else
			result = result .. '"' .. styles.h .. 'colspan=4|[[List of ' .. gamegn .. ' Skills|' .. styles.spanc .. 'List of Skills</span>]]'
		end
		if ((gameg == 'p1' or gameg == 'p2is' or gameg == 'p2ep' or gameg == 'p3' or gameg == 'p4' or gameg == 'p5') and prop.hp) or ((gameg == 'pq' or gameg == 'pq2') and not prop.arcana) or prop.boss or prop.enemy then -- skill - effect (optional: Inheritable Skill or Rumor Skill)
			result = result .. styles.skill .. '技能'  .. styles.skillc .. '效果'
			for k1, v1 in ipairs(mw.text.split(prop.skills, '\n')) do
				for k2, v2 in ipairs(mw.text.split(v1 .. '\\', '\\')) do
					if k2 > 2 then break
					elseif (k2 % 2 == 1) then
						skill = data.skills[v2]
						if not skill then
							alias = data.aliases[v2]
							if alias then
								v2 = alias
								skill = data.skills[v2]
							end
						end
						if skill then
							if skill.combo then
								skill.effect = '<div style="background:' .. getGames.games[gameg].colorbg .. ';border-radius:5px;float:left;margin-right:5px">2x </div> ' .. skill.effect
							elseif skill.smirk then
								skill.effect = skill.effect .. ' <span style="background:' .. getGames.games[gameg].statb .. ';border-radius:5px;padding:3px">Smirk</span> ' .. skill.smirk
							end
						end
						if v2 == '' then
							skillcell = ''
							effect = noskill()
						elseif not skill then
							skillcell = ''
							effect = noskill(v2,gamed)
						elseif skill then
							if (k1 % 2 == 0) then
								effect = styles.effect2 .. skill.effect
							else
								effect = styles.effect1 .. skill.effect
							end
							if skill.name then v2 = skill.name end
							skillcell = styles.skill .. v2
						end
						result = result .. skillcell .. effect
					elseif (k2 % 2 == 0) then
						if v2 == 'I' or v2 == 'i' then
							result = result .. '<div style="float:right;background:#696969;border-radius:15px;padding:0 10px">Inheritable Skill</div>'
						elseif v2 == 'R' or v2 == 'r' then
							result = result .. '<div style="float:right;background:#8E283D;border-radius:15px;padding:0 10px">[[Misc Skills#Rumor Magic|<span style="color:#fff">Rumor Skill</span>]]</div>'
						else
							result = result
						end
					end
				end
			end
		else
			if gameg == 'p1' or gameg == 'p2is' or gameg == 'p2ep' then -- rank - skill - cost - effect
				result = result .. styles.skill .. 'Rank' .. styles.skillc .. 'Skill' .. styles.skillc .. 'Effect'
				for k1, v1 in ipairs(mw.text.split(prop.skills, '\n')) do
					for k2, v2 in ipairs(mw.text.split(v1 .. '\\', '\\')) do
						if k2 > 2 then break
						elseif (k2 % 2 == 1) then
							if v2 == 'M' or v2 == 'm' then
								v2 = '[[突變(女神異聞錄)|<span style="color:#fff">突變</span>]]'
							elseif v2 == 'R' or v2 == 'r' then
								v2 = '[[流言(女神異聞錄)|<span style="color:#fff">流言</span>]]'
							else
								v2 = v2
							end
							result = result .. styles.skill .. v2
						elseif (k2 % 2 == 0) then
							skill = data.skills[v2]
							if not skill then
								alias = data.aliases[v2]
								if alias then
									v2 = alias
									skill = data.skills[v2]
								end
							end
							if v2 == '' then
								skillcell = ''
								cost = ''
								range = ''
								power = ''
								target = ''
								effect = noskill()
							elseif not skill then
								skillcell = ''
								cost = ''
								range = ''
								power = ''
								target = ''
								effect = noskill(v2,gamed)
							elseif skill then
								if (k1 % 2 == 0) then
									if gameg == 'smtim' or gameg == 'ab' then cost = styles.cost2 .. skill.cost else cost = '' end
									if gameg == 'ab' then
										range = styles.cost2 .. skill.range
										power = styles.cost2 .. skill.power
										target = styles.cost2 .. skill.target
									else
										range = ''
										power = ''
										target = ''
									end
									effect = styles.effect2 .. skill.effect
								else
									if gameg == 'smtim' or gameg == 'ab' then cost = styles.cost1 .. skill.cost else cost = '' end
									if gameg == 'ab' then
										range = styles.cost1 .. skill.range
										power = styles.cost1 .. skill.power
										target = styles.cost1 .. skill.target
									else
										range = ''
										power = ''
										target = ''
									end
									effect = styles.effect1 .. skill.effect
								end
								if skill.name then v2 = skill.name end
								skillcell = styles.skillc .. v2
							end
							result = result .. skillcell .. cost .. range .. power .. target .. effect
						end
					end
				end
			else -- skill - cost - effect - level
				result = result .. styles.skill .. 'Skill' .. styles.skillc .. 'Cost' .. styles.skillc .. 'Effect' .. styles.skillc .. 'Level'
				for k1, v1 in ipairs(mw.text.split(prop.skills, '\n')) do -- Any entry on new line within "Skills" parameter is treated as new skill name.
					for k2, v2 in ipairs(mw.text.split(v1 .. '\\', '\\')) do -- Entry after backslash after skill name is treated as "level" for learning new skill per level gain. Any entry starting from second backslash on the same line is ignored until a new line.
						if k2 > 2 then break
						elseif (k2 % 2 == 1) then -- this checks level (false) or skill name (true) divided by the backslash.
							skill = data.skills[v2] -- now v2 represents skill name.
							if not skill then
								alias = data.aliases[v2]
								if alias then
									v2 = alias
									skill = data.skills[v2]
								end
							end
							if v2 == '' then
								skillcell = ''
								cost = ''
								effect = noskill()
							elseif not skill then
								skillcell = ''
								cost = ''
								effect = noskill(v2,gamed)
							elseif skill then
								cost = skill.cost
								if gameg == 'p5' then
									if string.match(skill.cost, 'HP') then
										cost = '<span style="color:' .. getGames.games[gameg].hp2 .. '">' .. skill.cost .. '</span>' -- tints cyan for phys skill
									elseif string.match(skill.cost, 'SP') then
										cost = '<span style="color:' .. getGames.games[gameg].mp2 .. '">' .. skill.cost .. '</span>' -- tints pink for magic skill
									end
								end
								if skill.smirk then
									skill.effect = skill.effect .. ' <span style="background:' .. getGames.games[gameg].statb .. ';border-radius:5px;padding:3px">Smirk</span> ' .. skill.smirk
								end
								if (k1 % 2 == 0) then
									cost = styles.cost2 .. cost
									effect = styles.effect2 .. skill.effect
								else
									cost = styles.cost1 .. cost
									effect = styles.effect1 .. skill.effect
								end
								if skill.name then v2 = skill.name end
								skillcell = styles.skill .. v2
							end
							result = result .. skillcell .. cost .. effect
						elseif (k2 % 2 == 0) then -- this checks level (ture) or skill name (false) divided by the backslash.
							if v2 == 'i' or v2 == 'I' or v2 == 'innate' or v2 == 'default' or v2 == 'Default' -- now v2 represents skill level.
								then v2 = '固有'
							end
							if (k1 % 2 == 0) then -- this checks even (true) or odd (false) number row.
								result = result .. styles.cost2 .. v2 -- "v2" represents "Level" within "Skills" parameter on each new line after the backslash.
							else
								result = result .. styles.cost1 .. v2
							end
						end
					end
				end
			end
		end
		result = result .. '\n|}'
	end
	if prop.fskills then
		result = result .. styles.table2 .. styles.h .. 'colspan="5"'
		if gameg == 'p2is' or gameg == 'p2ep' then
			result = result .. '|[[人格面具/魔法合成/' .. gamegn .. '|' .. styles.spanc .. 'Unique Fusion Spells</span>]]' .. styles.skill .. 'Skill'  .. styles.skillc .. 'Effect' .. styles.skillc .. 'Order/Skill/Persona'
			for k, v in ipairs(mw.text.split(prop.fskills, '\n')) do
				skill = data.skills[v]
				if not skill then
					alias = data.aliases[v]
					if alias then
						v = alias
						skill = data.skills[v]
					end
				end
				if v == '' then
					skillcell = ''
					cost = ''
					effect = noskill()
				elseif not skill then
					skillcell = ''
					cost = ''
					effect = noskill(v,gamed)
				elseif skill then
					if (k % 2 == 0) then
						effect = styles.effect2 .. skill.effect
					else
						effect = styles.effect1 .. skill.effect
					end
					if skill.name then v = skill.name end
					skillcell = styles.skill .. v
					cost = styles.order .. skill.cost
				end
				result = result .. skillcell .. effect .. cost
			end
		elseif gameg == 'p3' then
			local cost, effect, pre
			if not data.skills[prop.fskills] then
				cost = ''
				effect = noskill(prop.fskills,gamed)
				pre = ''
				fskills = ''
			else
				cost = styles.cost1 .. data.skills[prop.fskills].cost
				effect = styles.effect1 .. data.skills[prop.fskills].effect
				pre = styles.cost1 .. data.skills[prop.fskills].pre
				prop.fskills = styles.skill .. prop.fskills
			end
			result = result .. '|[[人格面具/技能/女神異聞錄3|' .. styles.spanc .. '魔法合成</span>]] <abbr title="僅 P3 和 P3F;P3P 使用物品且無需擁有原面具。">*</abbr>' .. styles.skill .. 'Skill'  .. styles.skillc .. 'Cost' .. styles.skillc .. 'Effect' .. styles.skillc .. '<abbr title="僅 P3 和 P3F">先決條件</abbr>' .. prop.fskills .. cost .. effect .. pre
		end
		result = result .. '\n|}'
	end
	if prop.pskills then
		result = result .. styles.table2 .. styles.h .. 'colspan=3|[[人格面具/技能/' .. gamegn .. '#被動技能|' .. styles.spanc .. '被動技能</span>]]' .. '\n|-style="border:0"\n|style="padding:0;width:33%"|\n|style="padding:0;width:33%"|\n|style="padding:0;width:33%"|'
		for k, v in ipairs(mw.text.split(prop.pskills, '\n')) do
			skill = data.skills[v]
			if not skill then
				alias = data.aliases[v]
				if alias then
					v = alias
					skill = data.skills[v]
				end
			end
			if v == '' or v == '-' or v == '--' then
				skillcell = ''
			elseif not skill then
				skillcell = styles.skill3 .. '"|' .. v
			else
				if skill.name then v = skill.name end
				skillcell = styles.skill3 .. '" title="消耗: ' .. skill.cost .. '; ' .. skill.effect .. '"|' .. v
			end
			if (k % 3 == 1) then
				result = result .. '\n|-' .. skillcell
			else
				result = result .. skillcell
			end
		end
		result = result .. '\n|}'
	end
	if gameg == 'p2ep' and prop.unknown then
		result = result .. styles.table2 .. styles.h .. 'colspan="2"|[[Unknown Power|' .. styles.spanc .. 'Unknown Power</span>]]' .. styles.skill
		prop.unknown = prop.unknown:lower()
		if prop.unknown == 'attack type' or prop.unknown == 'attack-type' or prop.unknown == 'attack' then
			result = result .. 'Attack Type' .. styles.cost1 .. 'Deals <abbr title="Equipper has ' .. "'Great'" .. ' affinity with the Persona">500</abbr> or <abbr title="Equipper has ' .. "'Good'" .. ' affinity with the Persona">250</abbr> non-elemental damage to all enemies.'
		elseif prop.unknown == 'defense type' or prop.unknown == 'defense-type' or prop.unknown == 'defense' then
			result = result .. 'Defense Type' .. styles.cost1 .. '<abbr title="Equipper has ' .. "'Great'" .. ' affinity with the Persona">Reflects</abbr> or <abbr title="Equipper has ' .. "'Good'" .. ' affinity with the Persona">nullifies</abbr> the incoming attack.'
		elseif prop.unknown == 'assist type' or prop.unknown == 'assist-type' or prop.unknown == 'assist' then
			result = result .. 'Assist Type' .. styles.cost1 .. 'Bestows Tarukaja + Makakaja <abbr title="Only applicable when the equipper has ' .. "'Great'" .. ' affinity with the Persona">(or Rakukaja + Samakaja in addition)</abbr>'
		elseif prop.unknown == 'recovery type' or prop.unknown == 'recovery-type' or prop.unknown == 'recovery' then
			result = result .. 'Recovery Type' .. styles.cost1 .. 'Fully recovers HP <abbr title="Only applicable when the equipper has ' .. "'Great'" .. ' affinity with the Persona">(or removes ailment in addition)</abbr>.'
		elseif prop.unknown == 'revival type' or prop.unknown == 'revival-type' or prop.unknown == 'revival' then
			result = result .. 'Revival Type' .. styles.cost1 .. 'Revives from unconscious with <abbr title="Equipper has ' .. "'Great'" .. ' affinity with the Persona">full</abbr> or <abbr title="Equipper has ' .. "'Good'" .. ' affinity with the Persona">1/4</abbr> HP.'
		elseif prop.unknown == 'special type' or prop.unknown == 'special-type' or prop.unknown == 'special' then
			result = result .. 'Special Type' .. styles.cost1 .. 'Eliminates all enemies when the user is unconscious.'
		end
		result = result .. '\n|}'
	end
	result = result .. '\n|}'
	return result
end
 
p.row = makeInvokeFunction('_row')
 
function p._row(args)
	local row = args[1]
	local game = args[2]
	local code = args[3]
	if not code or code == '' then return '' end
	local level = args[4]
	if not level then level = '' end
	if level == 'i' or level == 'I' or level == 'innate' or level == 'default' or level == 'Default' then level = 'Innate' end
	local data = require('Module:psk/' .. game)
	skill = data.skills[code]
	if not skill then
		alias = data.aliases[code]
		if alias then
			code = alias
			skill = data.skills[code]
		else 
			return noskill(code,game)
		end
	end
	if skill.name then code = skill.name end
	local skillcell = styles.skill .. code
	local cost = skill.cost
	local cost1 = '\n||' .. cost
	local cost2 = styles.cost2 .. cost
	local effect1 = styles.effect1 .. skill.effect
	local effect2 = styles.effect2 .. skill.effect
	local order = styles.order .. skill.cost
	local element1, element2
	if skill.element then
		element1 = '\n||' .. skill.element or ''
		element2 = styles.cost2 .. skill.element or ''
	end
	local level1, level2
	if skill.pre then
		level1 = '\n||' .. skill.pre
		level2 = styles.cost2 .. skill.pre
	elseif level == '' then
		level1 = '\n||'
		level2 = styles.cost2
	elseif level then
		level1 = '\n||' .. level
		level2 = styles.cost2 .. level
	end
	local result
	if row == 'r01' then
		result = skillcell .. effect1 -- Odd number row for enemy whose skill cost is irrelevant.
		elseif row == 'r02' then
		result = skillcell .. effect2 -- Even number row for enemy whose skill cost is irrelevant.
		elseif row == 'r11' then
			result = skillcell .. cost1 .. effect1 -- Odd number row for demon which does not learn new skill on level gain.
		elseif row == 'r12' then
			result = skillcell .. cost2 .. effect2 -- Even number row for demon which does not learn new skill on level gain.
		elseif row == 'r21' then
		result = skillcell .. cost1 .. effect1 .. level1 -- Odd number row for demon/persona which learn new skill on level gain.
		elseif row == 'r22' then
		result = skillcell .. cost2 .. effect2 .. level2 -- Even number row for demon/persona which learn new skill on level gain.
		elseif row == 'r31' then
		result = skillcell .. effect1 .. level1 -- Odd number row for guest who learn new skill on level gain.
		elseif row == 'r32' then
		result = skillcell .. effect2 .. level2 -- Even number row for guest who learn new skill on level gain.
		elseif row == 'p12' then
		result = styles.skill .. level .. styles.skillc .. code .. effect1 -- Row for Persona 1 and 2 persona 
		elseif row == 'rf' then
		result = skillcell .. effect1 .. order -- Row for Persona-specific fusion spell.
		else
		result = '<strong style="color:red;font-size:150%">Invalid parameter 1 of ' .. '"' .. row .. '".</strong>' .. cate('Templates with unrecognizable row value for Module:psk')
	end
	return result
end
 
return p