此模块的文档可以在模块:Common/doc创建

local p = {}
local get_data = require('Module:Common/Utility.lua').get_data
local count_data = require('Module:Common/Utility.lua').count_data
local set_style = require('Module:Common/Utility.lua').set_style
local getArgs = require('Module:Arguments').getArgs
local versions = require('Module:Common/Utility.lua').versions
local floor = require('Module:Common/Utility.lua').floor

-- 成员
p.tooltip_style = 'background:#222;padding:16px 32px 16px 32px;color:#fff;max-width:400px;list-style: none;font-size: 14px; border: 2px solid #14796c;'

function p.item_tip(data)
	return 
	'[[Item:'
	..data.main_category
	..'/'
	..data.key
	..'|'
	..data.zhcn_name
	..']]'
end

-- 查询数据
function p.query_data(key, key_type, namespace)
	local result = get_data(key, key_type, namespace)
	return result
end

-- 查询数量
function p.query_count(key, key_type, namespace)
	local result = count_data(key, key_type, namespace)
	return result
end

-- 格式化数据
function p.format_data(result, func)
	local html = mw.html.create()
	if #result ~= 1 then  
		local table_html = html:tag('table'):addClass('wikitable')
		for _, data in ipairs(result) do
			table_html:tag('tr'):tag('td'):wikitext(set_style(func(data))):done()
		end
	else
		local local_html = html:tag('span'):wikitext(set_style(func(result[1]))):done()
	end
	return tostring(html)
end

function p.func_info_result(result)
	local html = mw.html.create()

	if #result ~= 1 then  
		local table_html = html:tag('table'):addClass('wikitable'):cssText(p.tooltip_style)
		for _, data in ipairs(result) do
			table_html:tag('tr'):tag('td'):wikitext(set_style(p.set_info(data))):done()
		end
	else
		local local_html = html:wikitext(set_style(p.set_info(result[1]))):done()
	end
	return tostring(html)
end

-- 建筑图标,Building_icon
function p.output_building_icon(frame)
	local frame_args = getArgs(frame)
	local key_type = frame_args[2] or 'key'
	local key = frame_args[1] or 'building_paradise_dome'
	local result = p.query_data(key, key_type, 'Data:Buildings/')
	local html = mw.html.create()

	if #result ~= 1 then  
		local table_html = html:tag('table')
			:addClass('wikitable')
			:cssText('background:#222;padding:0px 0px 0px 0px;color:#fff;max-width:400px;list-style: none;font-size: 14px;')
		for _, data in ipairs(result) do
			table_html:tag('tr'):tag('td'):wikitext(set_style(p.set_building_str(data))):done()
		end
	else
		local local_html = html:wikitext(set_style(p.set_building_str(result[1]))):done()
	end
	return frame:preprocess(tostring(html))
end

-- 建筑分类,Normal_buildings
function p.output_building_cat_table(frame)
	local frame_args = getArgs(frame)
	local key = frame_args[1] or 'normal'
	local result = p.query_data('buildings', 'main_category', 'Data:Buildings/')
	local html = mw.html.create()
 
	if #result ~= 1 then  
		local table_html = html:tag('table')
			:addClass('wikitable')
			:cssText(p.tooltip_style)
		for _, data in ipairs(result) do
			if key == 'normal' then
				condition = (not (data.potential and data.potential.owner and (
						data.potential.owner.has_authority == 'auth_machine_intelligence' or data.potential.owner.has_non_swapped_tradition 
						or data.potential.owner.has_swapped_tradition or data.potential.owner.has_ascension_perk))) 
					and (not (data.potential and data.potential.planet and data.potential.planet.is_planet_class == 'pc_habitat'))
					and (not (data.event_building == 'yes'))
			elseif key == 'machine_intelligence' then
				condition = data.potential and data.potential.owner and data.potential.owner.has_authority == 'auth_machine_intelligence'
			elseif key == 'habitat_building' then
				condition = data.potential and data.potential.planet and data.potential.planet.is_planet_class == 'pc_habitat'
			elseif key == 'event_building' then 
				condition = data.event_building == 'yes'
			elseif key == 'tradition_building' then
				condition = data.potential and data.potential.owner and (data.potential.owner.has_non_swapped_tradition or data.potential.owner.has_swapped_tradition)
			elseif key == 'ascension_building' then
				condition = data.potential and data.potential.owner and data.potential.owner.has_ascension_perk
			end
			if condition then
				table_html:tag('tr'):tag('td'):wikitext(set_style(p.set_building_str(data))):done()
			end
		end
	else
		local local_html = html:wikitext(set_style(p.set_building_str(result[1]))):done()
	end
	return frame:preprocess(tostring(html))
end

-- 宜居星球,Planet_info
function p.planet_table(frame)
	local frame_args = getArgs(frame)
	local colonizable = frame_args[1] or 'yes'
	local result = p.query_data('no', 'star', 'Data:Planet_classes/')
	local html = mw.html.create()

	if #result ~= 1 then  
		local table_html = html:tag('table'):addClass('wikitable'):cssText(p.tooltip_style)
		for _, data in ipairs(result) do
			if data.colonizable == colonizable then
				table_html:tag('tr'):tag('td'):wikitext(set_style(p.set_info(data))):done()
			end
		end
	else
		local local_html = html:wikitext(set_style(p.set_info(result[1]))):done()
	end
	return frame:preprocess(tostring(html))
end

-- 国家理念,Normal_civics
function p.output_civics_table(frame)
	local frame_args = getArgs(frame)
	local key = frame_args[1] or 'normal'
	local result = p.query_data('civics', 'main_category', 'Data:Civics/')
	local html = mw.html.create()
 
	if #result ~= 1 then  
		local table_html = html:tag('table')
			:addClass('wikitable')
			:cssText(p.tooltip_style)
		for _, data in ipairs(result) do
			if key == 'normal' then
				condition = (not data.potential.country_type) 
					and ((data.potential.authority and data.potential.authority.value ~= 'auth_hive_mind' 
					and data.potential.authority.value ~= 'auth_machine_intelligence') or (not data.potential.authority))
					and ((not data.potential.always) or data.potential.always ~='no')
			elseif key == 'hive_mind' then
				condition = data.potential.authority and data.potential.authority.value == 'auth_hive_mind'
			elseif key == 'machine_intelligence' then
				condition = (not data.potential.country_type) and data.potential.authority and data.potential.authority.value == 'auth_machine_intelligence'
			elseif key == 'fallen_empire' then
				condition = data.potential.country_type and data.potential.country_type.value == 'fallen_empire'
			elseif key == 'awakened_fallen_empire' then 
				condition = data.potential.country_type and data.potential.country_type.value == 'awakened_fallen_empire'
			elseif key == 'primitive' then
				condition = data.potential.country_type and data.potential.country_type.value == 'primitive'
			elseif key == 'special' then
				condition = data.potential.always and data.potential.always =='no'
			end
			if condition then
				table_html:tag('tr'):tag('td'):wikitext(set_style(p.set_info(data))):done()
			end
		end
	else
		local local_html = html:tag('span'):wikitext(set_style(p.set_info(result[1]))):done()
	end
	return frame:preprocess(tostring(html))
end

-- 科技
function p.tech_category(frame)
	local frame_args = getArgs(frame)
	local key = frame_args[1] or 'rare'
	local result = p.query_data('technology', 'main_category', 'Data:Technology/')
	local html = mw.html.create()
 
	if #result ~= 1 then  
		local table_html = html:tag('table')
			:addClass('wikitable')
			:cssText(p.tooltip_style)
		for _, data in ipairs(result) do
			if key == 'physics' then
				condition = (data.area == 'physics')
			elseif key == 'society' then
				condition = (data.area == 'society')
			elseif key == 'engineering' then
				condition = (data.area == 'engineering')
			elseif key == 'rare' then
				condition = (data.is_rare == 'yes')
			elseif key == 'dangerous' then
				condition = (data.is_dangerous == 'yes')
			end
			if condition then
				table_html:tag('tr'):tag('td'):wikitext(set_style(p.set_tech_card(data))):done()
			end
		end
	else
		local local_html = html:tag('span'):wikitext(set_style(p.set_tech_card(result[1]))):done()
	end
	return frame:preprocess(tostring(html))
end

-- 战略资源,Normal_resources
function p.output_resources_table(frame)
	local frame_args = getArgs(frame)
	local key = frame_args[1] or 'normal'
	local result = p.query_data('strategic_resources', 'main_category', 'Data:Strategic_resources/')
	local html = mw.html.create()
 
	if #result ~= 1 then  
		local table_html = html:tag('table')
			:addClass('wikitable')
			:cssText(p.tooltip_style)
		for _, data in ipairs(result) do
			if key == 'normal' then
				condition = data.AI_category ~='strategic_resource' or data.is_planet_local == 'yes'
			elseif key == 'strategic_resource' then
				condition = data.AI_category =='strategic_resource' and data.is_planet_local ~= 'yes'
			end
			if condition then
				table_html:tag('tr'):tag('td'):wikitext(set_style(p.set_info(data))):done()
			end
		end
	else
		local local_html = html:tag('span'):wikitext(set_style(p.set_info(result[1]))):done()
	end
	return frame:preprocess(tostring(html))
end
 

-- 详细数据,Common
function p.common_detail(frame)
	local frame_args = getArgs(frame)
	local key_type = frame_args[2] or 'key'
	local key = frame_args[1] or 'building_paradise_dome'
	local result = p.query_data(key, key_type, 'Data:')
	return frame:preprocess(p.format_data(result, p.set_common))
end

-- 图标+名称,Info3
function p.info_table(frame)
	local frame_args = getArgs(frame)
	local key_type = frame_args[2] or 'key'
	local key = frame_args[1] or 'building_paradise_dome'
	return p.func_info(key, key_type, 'Data:')
end

-- 图标,Icon3
function p.icon_table(frame)
	local frame_args = getArgs(frame)
	local key_type = frame_args[2] or 'key'
	local key = frame_args[1] or 'ethic_gestalt_consciousness'
	local result = p.query_data(key, key_type, 'Data:')
	return p.format_data(result, p.set_icon)
end

-- 科技卡片
function p.tech_card(frame)
	local frame_args = getArgs(frame)
	local key_type = frame_args[2] or 'key'
	local key = frame_args[1] or 'tech_jump_drive_1'
	local result = p.query_data(key, key_type, 'Data:Technology')
	return frame:preprocess(p.format_data(result, p.set_tech_card))
end

-- 科技数量
function p.tech_count(frame)
	local frame_args = getArgs(frame)
	local key_type = frame_args[2] or 'area'
	local key = frame_args[1] or 'engineering'
	local result = p.query_count(key, key_type, 'Data:Technology')
	return tostring(result)
end

-- 政策列表
function p.policies_table(frame)
	local frame_args = getArgs(frame)
	local key_type = frame_args[2] or 'key'
	local key = frame_args[1] or 'war_doctrine'
	local result = p.query_data(key, key_type, 'Data:Policies')
	return p.format_data(result, p.set_policies_list)
end

-- 替换传统,Info3版本
function p.swap_tradition_table(frame)
	local frame_args = getArgs(frame)
	local swap_type = frame_args[2] or 'none'
	local key_type = frame_args[3] or 'key'
	local key = frame_args[1] or 'tr_diplomacy_alien_tourism'
	local result = p.query_data(key, key_type, 'Data:Traditions/')
	local html = mw.html.create()

	if #result ~= 1 then  
		local table_html = html:tag('table'):addClass('wikitable'):cssText(p.tooltip_style)
		for _, data in ipairs(result) do
			table_html:tag('tr'):tag('td'):wikitext(set_style(p.set_swap_tradition(data, swap_type))):done()
		end
	else
		local local_html = html:wikitext(set_style(p.set_swap_tradition(result[1], swap_type))):done()
	end
	return tostring(html)
end

-- 替换传统Info样式
function p.set_swap_tradition(data, swap_type)
	local name = data.zhcn_name
	local icon = (data.icon or data.key)
	if swap_type ~= 'none' then
		if data.tradition_swap then
			for _, item in ipairs(data.tradition_swap) do
				if item.trigger and (
					item.trigger.has_authority == swap_type 
					or item.trigger.has_valid_civic == swap_type 
					or (item.trigger.OR 
						and (item.trigger.OR.has_valid_civic == swap_type 
							or item.trigger.OR.has_authority == swap_type ))
				)then
					name = item.zhcn_name
					if item.inherit_icon == 'yes' then
						icon = (data.icon or data.key)
					else
						icon = (item.icon or (data.icon or data.key))
					end
				elseif item.trigger and item.trigger.OR and item.trigger.OR.has_valid_civic then
					for _, civic in ipairs(item.trigger.OR.has_valid_civic) do
						if swap_type == civic then
							name = item.zhcn_name
							if item.inherit_icon == 'yes' then
								icon = (data.icon or data.key)
							else
								icon = (item.icon or (data.icon or data.key))
							end
						end
					end
				elseif item.trigger and item.trigger.OR and item.trigger.OR.has_authority then
					for _, civic in ipairs(item.trigger.OR.has_authority) do
						if swap_type == civic then
							name = item.zhcn_name
							if item.inherit_icon == 'yes' then
								icon = (data.icon or data.key)
							else
								icon = (item.icon or (data.icon or data.key))
							end
						end
					end
				end
			end
		end
	end
	local newstring = '<span class="huiji-tt" data-type="'
			..data.main_category
			..'" data-name="'
			..data.key
			..'" style="display:inline-block;position:relative">'
			..'[[文件:'
			..icon
			..'.png|'
			..name
			..'|29px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]'
			..'<span style="padding:8px 0px 0px 6px">'
			..'[[Item:'
			..data.main_category
			..'/'
			..data.key
			..'|'
			..name
			..']]'
			..'</span></span>'
	return newstring
end

-- 科技卡片样式
function p.set_tech_card(data)
	newstring='<div class="huiji-tt" data-type="technology" data-name="'
		..data.key
		..'" style="background:#222;padding:0px 0px 0px 0px;color:#fff;width:452px;height:85px;list-style: none;font-size:12px; border: 0px solid #14796c;position:relative;overflow:hidden">'
		..'<div class="link-block">'
		..'[[文件:'
		if data.is_dangerous == 'yes' then
			newstring = newstring..'tech_bg_dangerous'
		elseif data.is_rare == 'yes' then
			newstring = newstring..'tech_bg_rare'
		elseif data.area == 'physics' then
			newstring = newstring..'tech_bg_physics'
		elseif data.area == 'society' then
			newstring = newstring..'tech_bg_society'
		elseif data.area == 'engineering' then
			newstring = newstring..'tech_bg_engineering'
		end
	newstring = newstring
		..'.png|link=Item:'
		..data.main_category
		..'/'
		..data.key
		..']]'
		..'<div style="position:absolute;width:452px;top:0px;text-align:right;color:#00ff00">'
		..(data.tier == '0' and '起始科技' or data.cost)
		..'</div>'
		..'<div style="position:absolute;left:7px;top:4px;color:#fff">'
		..data.zhcn_name
		..' ('
		..data.en_name
		..')</div>'
		..'<div style="position:absolute;background:#3a6656;left:4px;top:28px;width:54px;height:54px;border: 1px solid #3a6656">[[文件:'
		..(data.icon or data.key)
		..'.png|52px|link=Item:'
		..data.main_category
		..'/'
		..data.key
		..']]</div><div style="position:absolute;left:70px;top:30px;color:#fff;width:340px;height:50px;list-style: none;font-size:12px; border: 0px solid #14796c">'
		..(data.zhcn_modifier or '')
		..'</div><div style="position:absolute;left:415px;top:30px;width:29px;height:29px;border: 0px solid #3a6656">[[文件:leader_trait_expertise_'
		..data.category
		..'.png|29px|link=]]</div></div></div>'
	return newstring
end

-- Info3模块查询
function p.func_info(key, key_type, namespace)
	return p.func_info_result(p.query_data(key, key_type, namespace))
end

-- Normal_buildings样式
function p.set_building_str(data)
	if not (data.produced_resources_string) or data.produced_resources_string == '' then
		produced_resources_string = ' '
	else
		produced_resources_string = data.produced_resources_string
	end
	newstring ='<table style="background:#222;padding:0px 0px 0px 0px;border: 2px solid #14796c;width:98px"><tr><td><span class="huiji-tt" data-type="'
		   ..data.main_category
		..'" data-name="'
		..data.key
		..'" style="display:inline-block;position:relative">[[文件:building_bg.png|98px'
		..data.zhcn_name
		..'|link=Item:'
		..data.main_category
		..'/'
		..data.key
		..']]<span style="position:absolute;left:-20px;top:-7px">[[文件:'
		..(data.icon or data.key)
		..'.png|98px|link=Item:'
		..data.main_category
		..'/'
		..data.key
		..']]</span></span></td></tr><tr><td><div style="text-align:center">'
		..produced_resources_string
		..'</div></td></tr></table>'
	return newstring
end

-- Policies样式
function p.set_policies_list(data)
	newstring='<span class="huiji-tt" data-type="'
		   ..data.main_category
		   ..'" data-name="'
		..data.key
		..'" style="display:inline-block;margin-bottom:12px">[[文件:Menu_icon_policies_and_edicts.png|'
		..data.zhcn_name
		..'|29px|link=Item:'
		..data.main_category
		..'/'
		..data.key
		..']]<span style="margin-left:12px">[[Item:'
		..data.main_category
		..'/'
		..data.key
		..'|'
		..data.zhcn_name
		..']]</span>'
		if data.option then
			for _,options in ipairs(data.option) do
				newstring = newstring
					..'<div style="margin-left:12px">[[文件:Radio_button_normal.png|选项|29px|link=]]§E'
					..options.zhcn_name
					..'§!</div>'
			end
		end
		newstring = newstring..'</span>'
	return newstring
end

function p.icon_string(data, icon_file)
	return '<span class="huiji-tt" data-type="'
		..data.main_category
		..'" data-name="'
		..data.key
		..'" style="display:inline-block">[[文件:'
		..icon_file
		..'.png|24px|link=Item:'
		..data.main_category
		..'/'
		..data.key
		..']]</span>'
end
-- Icon样式
function p.set_icon(data)
	local inlines = '<span class="huiji-tt" data-type="'
			..data.main_category
			..'" data-name="'
			..data.key
			..'" style="display:inline-block;position:relative">'
	if data.main_category =='deposits' then
		newstring = inlines
			..data.zhcn_name
			..'</span>'
	elseif data.main_category =='terraform' then
		newstring = inlines
			..'[[文件:'
			..data.from_icon
			..'.png|24px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]→[[文件:'
			..data.to_icon
			..'.png|24px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]</span>'
	elseif data.main_category =='agendas' then
		newstring = p.icon_string(data, 'Agenda')
	elseif data.main_category =='edicts' or data.main_category =='policies' then
		newstring = p.icon_string(data, 'Menu_icon_policies_and_edicts')
	elseif data.main_category =='casus_belli' then
		newstring = p.icon_string(data, 'Diplomacy_status_casus_belli_holder')
	elseif data.main_category =='war_goals' then
		newstring = p.icon_string(data, 'Diplomacy_war')
	elseif data.main_category =='tile_blockers' then
		newstring = p.icon_string(data, 'Text_icon_tile_blocker')
	elseif data.main_category =='governments' then
		newstring = p.icon_string(data, 'Tech_frontier_commissars')
	elseif data.main_category =='subjects' then
		newstring = p.icon_string(data, 'Diplomacy_isvassal')
	elseif data.main_category =='personalities' then
		newstring = p.icon_string(data, 'Tech_xeno_diplomacy')
	elseif data.main_category =='section_templates' then
		newstring = p.icon_string(data, 'Ship_part_computer_default')
	elseif data.main_category =='ship_behaviors' then
		newstring = p.icon_string(data, 'Ship_part_aura_targeting_grid')
	elseif data.main_category =='strategic_resources' then
		newstring='<span class="huiji-tt" data-type="strategic_resources" data-name="'
			..data.key
			..'" style="display:inline-block">[[文件:'
			..(data.icon or data.key)
			..'.png|link=Item:'
            ..data.main_category
            ..'/'
            ..data.key
            ..']]</span>'
	else
		newstring = inlines
			..'[[文件:'
			..(data.icon or data.key)
			..'.png|29px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]'
			if data.main_category =='planet_modifiers' then
				newstring =newstring
				..'<span style="position:absolute;left:0px;top:0px">[[文件:icon_frame_'
				..(data.icon_frame or '2')
				..'.png|'
				..data.zhcn_name
				..'|29px|link=Item:'
				..data.main_category
				..'/'
				..data.key
				..']]'
				..'</span>'
			elseif data.main_category =='ascension_perks' then
				newstring =newstring
				..'<span style="position:absolute;left:-3px;top:-2px">[[文件:empire_flag_64_frame.png|'
				..data.zhcn_name
				..'|36px|link=Item:'
				..data.main_category
				..'/'
				..data.key
				..']]'
				..'</span>'
			end
			newstring =newstring..'</span>'
	end
	return newstring
end

-- Info样式
function p.set_info(data)
	local newstring = '<span class="huiji-tt" data-type="'
			..data.main_category
			..'" data-name="'
			..data.key
	local normals = '" style="display:inline-block;margin-bottom:12px">'
	local inlines = '" style="display:inline-block;position:relative">'
	local item_name = data.main_category
			..'/'
			..data.key
			..']]<span style="margin-left:12px">'
			..p.item_tip(data)
			..'</span></span>'
	if data.main_category =='agendas' then
		newstring = newstring
			..normals
			..'[[文件:Agenda.png|24px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="margin-left:12px">§E议程:§!'
			..p.item_tip(data)
			..'</span></span>'
	elseif data.main_category =='edicts' or data.main_category =='policies' then
		newstring = newstring
			..normals
			..'[[文件:Menu_icon_policies_and_edicts.png|24px|link=Item:'
			..item_name
	elseif data.main_category =='casus_belli' then
		newstring = newstring
			..normals
			..'[[文件:Diplomacy_status_casus_belli_holder.png|24px|link=Item:'
			..item_name
	elseif data.main_category =='war_goals' then
		newstring = newstring
			..normals
			..'[[文件:Diplomacy_war.png|24px|link=Item:'
			..item_name
	elseif data.main_category =='tile_blockers' then
		newstring = newstring
			..normals
			..'[[文件:Text_icon_tile_blocker.png|18px|link=Item:'
			..item_name
	elseif data.main_category =='governments' 
		or data.main_category =='personalities' 
		or data.main_category =='subjects' 
		or data.main_category =='ship_behaviors' 
		or data.main_category =='section_templates'  then
		newstring = newstring
			..normals
			..''
			..p.item_tip(data)
			..'</span>'
	elseif data.main_category =='buildings' then
		newstring = newstring
			..normals
			..'[[文件:Tooltip_building.png|18px|link=Item:'
			..item_name  
	elseif data.main_category =='strategic_resources' then
		newstring = newstring
			..inlines
			..'[[文件:'
			..(data.icon or data.key)
			..'.png|'
			..data.zhcn_name
			..'|16px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="padding:8px 0px 0px 6px">'
			..p.item_tip(data)
			..'</span></span>'
	elseif data.main_category =='deposits' then
		newstring = newstring
			..inlines
			..'[[Item:'
			..data.main_category
			..'/'
			..data.key
			..'|'
			..data.key
			..']]:'
			..data.zhcn_name
			..'</span>'
	elseif data.main_category =='terraform' then
		newstring = newstring
			..inlines
			..''
			..p.item_tip(data)
			..'</span>'
	else
		newstring = newstring
			..inlines
			..'[[文件:'
			..(data.icon or data.key)
			..'.png|'
			..data.zhcn_name
			..'|29px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]'
			if data.main_category =='planet_modifiers' then
				newstring =newstring
				..'<span style="position:absolute;left:0px;top:0px">[[文件:icon_frame_'
				..(data.icon_frame or '2')
				..'.png|'
				..data.zhcn_name
				..'|29px|link=Item:'
				..data.main_category
				..'/'
				..data.key
				..']]'
				..'</span>'
			elseif data.main_category =='ascension_perks' then
				newstring =newstring
				..'<span style="position:absolute;left:-3px;top:-2px">[[文件:empire_flag_64_frame.png|'
				..data.zhcn_name
				..'|36px|link=Item:'
				..data.main_category
				..'/'
				..data.key
				..']]'
				..'</span>'
			end
		newstring =newstring
			..'<span style="padding:8px 0px 0px 6px">'
			..p.item_tip(data)
			..'</span></span>'
	end
	return newstring
end
function common_title(data, size)
	return '" style="display:inline-block">[[文件:'
		..(data.icon or data.key)
		..'.png|'
		..data.zhcn_name
		..'|'
		..size
		..'px|link=Item:'
		..data.main_category
		..'/'
		..data.key
		..']]<span style="margin-left:12px">'
		..p.item_tip(data)
		..'</span><br /><span style="margin-left:'
		..(size + 12)
		..'px;margin-bottom:12px">§L'
		..data.en_name
		..'§!</span></span><br />'
end
-- Common样式
function p.set_common(data)
	newstring = '<div style="background:#222;padding:16px 32px 16px 32px;color:#fff;width:400px;list-style: none;font-size: 14px; border: 2px solid #14796c;">'
		..'<span class="huiji-tt" data-type="'
		..data.main_category
		..'" data-name="'
		..data.key
	if data.main_category == 'ethics' then
		newstring = newstring
			..common_title(data, 29)
			..data.instruction
			..'<br /><br />帝国修正<br/><div style="padding-left:20px;padding-top:7.5px">'
			..data.zhcn_country_modifier
			..'</div><div>--------------</div>'
			..data.random_weight_logic
			..'<div>--------------</div>'
			..data.zhcn_desc
	elseif data.main_category == 'authorities' then
		newstring = newstring
			..common_title(data, 44)
		if data.instruction then
			newstring = newstring..data.instruction..'<br /><br />'
		end
		if data.zhcn_country_modifier then
			newstring = newstring
			..'帝国修正<br/><div style="padding-left:20px;padding-top:7.5px">'
			..data.zhcn_country_modifier
			..'</div><br />'
		end
		if data.possible_desc then
			newstring = newstring
			..data.possible_desc
			..'<div>--------------</div>'
		end
		if data.random_weight_logic then
			newstring = newstring
			..data.random_weight_logic
			..'<div>--------------</div>'
		end
		if data.desc_detail then
			newstring = newstring
			..'§E效果:§!<br/>'
			..data.desc_detail
			..'<div>--------------</div>'
		end
		newstring = newstring..'§L'..data.zhcn_desc..'§!'
	elseif data.main_category == 'starbase_levels' then
		newstring = newstring
			..common_title(data, 33)
		if data.ship_size then
			newstring = newstring..'§E舰船大小:§!'..p.func_info(data.ship_size, 'key', 'Data:Ship_sizes/')..'<br />'
		end


		if data.level_weight then
			newstring = newstring..'§E等级:§!'..data.level_weight
		end
		if data.ai_weight_logic then
			newstring = newstring..data.ai_weight_logic
		end
	elseif data.main_category == 'section_templates' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px">'
			..p.item_tip(data)
			..'</span><br />§L'
			..data.en_name
			..'§!<br />'
			..'武器槽位:§Y'
		if data.slot_count.P ~= 0 then
			newstring = newstring..'[[文件:component_slot_p.png|点防|25px|link=]]'..data.slot_count.P
		end
		if data.slot_count.S ~= 0 then
			newstring = newstring..'[[文件:component_slot_s.png|小型|25px|link=]]'..data.slot_count.S
		end
		if data.slot_count.G ~= 0 then
			newstring = newstring..'[[文件:component_slot_g.png|制导|25px|link=]]'..data.slot_count.G
		end
		if data.slot_count.M ~= 0 then
			newstring = newstring..'[[文件:component_slot_m.png|中型|25px|link=]]'..data.slot_count.M
		end
		if data.slot_count.L ~= 0 then
			newstring = newstring..'[[文件:component_slot_l.png|大型|25px|link=]]'..data.slot_count.L
		end
		if data.slot_count.H ~= 0 then
			newstring = newstring..'[[文件:component_slot_h.png|机库|25px|link=]]'..data.slot_count.H
		end
		if data.slot_count.X ~= 0 then
			newstring = newstring..'[[文件:component_slot_x.png|巨型|25px|link=]]'..data.slot_count.X
		end
		if data.slot_count.T ~= 0 then
			newstring = newstring..'[[文件:component_slot_t.png|泰坦|25px|link=]]'..data.slot_count.T
		end
		if data.slot_count.W ~= 0 then
			newstring = newstring..'[[文件:component_slot_w.png|歼星|25px|link=]]'..data.slot_count.W
		end
		newstring = newstring..'§!<br />通用槽位:§Y'
		if data.small_utility_slots and data.small_utility_slots ~= 0 then
			newstring = newstring..'[[文件:component_slot_s.png|小型|25px|link=]]'..data.small_utility_slots
		end
		if data.medium_utility_slots and data.medium_utility_slots ~= 0 then
			newstring = newstring..'[[文件:component_slot_m.png|中型|25px|link=]]'..data.medium_utility_slots
		end
		if data.large_utility_slots and data.large_utility_slots ~= 0 then
			newstring = newstring..'[[文件:component_slot_l.png|大型|25px|link=]]'..data.large_utility_slots
		end
		if data.aux_utility_slots and data.aux_utility_slots ~= 0 then
			newstring = newstring..'[[文件:component_slot_a.png|辅助|25px|link=]]'..data.aux_utility_slots
		end
		newstring = newstring..'§!<br />'..data.zhcn_ship_size..'<br />'
		if data.fits_on_slot ~= 0 then
			newstring = newstring..'§E适用槽位:§!§Y'
			for _, item in ipairs(data.fits_on_slot) do
				newstring = newstring..item..' '
			end
			newstring = newstring..'§!<br />'
		end
		if data.cost and data.cost~= 0 then
			newstring = newstring..'花费:£minerals §H'..data.cost..'§!<br />'
		end
		if data.prerequisites then
			newstring = newstring..'§E前置科技§!<br /><div style="padding-left:14px">'
			for _, item in ipairs(data.prerequisites) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Technology/')..'<br />'
			end
			newstring = newstring..'</div>'
		end
		if data.entity then
			newstring = newstring..'模型:§H'..data.entity..'§!<br />'
		end
		if data.ai_weight_logic then
			newstring = newstring..data.ai_weight_logic..'§!<br />'
		end
	elseif data.main_category == 'ship_sizes' then
		newstring = newstring
			..common_title(data, 44)
			..'分类:§Y'
			..data.zhcn_class
		if data.cost then
			newstring = newstring..'§!<br />基础花费:§Y'..data.cost
		end
		if data.base_buildtime then
			newstring = newstring..'§!<br />基础建造时间:£time §Y'..data.base_buildtime
		end
		if data.build_time then
			newstring = newstring..'§!<br />基础建造时间:£time §Y'..data.build_time
		end

		newstring = newstring..'§!<br />基础维护费:§Y'..(data.zhcn_upkeep or '0')
		if data.class == shipclass_military or data.class == shipclass_military_special then
			newstring = newstring..'§!<br />舰船大小:[[文件:fleet_size_icon.png|舰船大小|20px|link=]]§H'..data.size_multiplier
		end
		newstring = newstring
			..'§!<br />[[文件:hit_points.png|船体值|20px|link=]]基础船体值:§Y'
			..data.max_hitpoints
			..'§!<br />[[文件:armor.png|装甲|20px|link=]]基础装甲:§Y'
			..(data.modifier.ship_armor_add or '0')
			..'§!<br />[[文件:shield.png|护盾|20px|link=]]基础护盾:§Y'
			..(data.modifier.ship_shield_add or '0')
			..'§!<br />[[文件:speed.png|速度|20px|link=]]基础速度:§Y'
			..data.max_speed
			..'§!<br />[[文件:evasion.png|闪避|20px|link=]]基础闪避:§Y'
		if data.modifier.ship_evasion_add then
			if data.modifier.ship_evasion_mult and data.modifier.ship_evasion_mult == -1 then
				newstring = newstring..'0%'
			else
				newstring = newstring..data.modifier.ship_evasion_add..'%'
			end
		end
		newstring = newstring
			..'§!<br />加速度:§Y'
			..(data.acceleration or 0)
			..'§!<br />转身速率:§Y'
			..(data.rotation_speed or 0)
			..'§!<br />碰撞半径:§Y'
			..(data.collision_radius or 0)
			..'§!<br />建造位置:§Y'
			..(data.zhcn_construction_type or '其他')
			..'§!<br /><br />§E修正:'
			..'§!<br />※14舰船维护:§G'
			..((data.modifier.ship_upkeep_mult or 0) * 100)..'%'
			..'§!<br />※14每日船体再生:§Y+'
			..(data.modifier.ship_hull_regen_add_perc or '0')..'%'
			..'§!<br />※14每日装甲再生:§Y+'
			..(data.modifier.ship_armor_regen_add_perc or '0')..'%'
			..'§!<br />※14每日护盾再生:§Y+'
			..(data.modifier.ship_shield_regen_add_static or '0')..'%'
		if data.modifier.starbase_module_capacity_add then
			newstring = newstring..'§!<br />※14恒星基地模组:§Y+'..data.modifier.starbase_module_capacity_add
		end
		if data.modifier.starbase_building_capacity_add then
			newstring = newstring..'§!<br />※14恒星基地建筑:§Y+'..data.modifier.starbase_building_capacity_add
		end
		if data.modifier.starbase_defense_platform_capacity_add then
			newstring = newstring..'§!<br />※14防御平台:§Y+'..data.modifier.starbase_defense_platform_capacity_add
		end
		if data.modifier.ship_shield_mult then
			newstring = newstring..'§!<br />※14护盾承受值:§Y+'..data.modifier.ship_shield_mult
		end
		if data.modifier.ship_weapon_damage then
			newstring = newstring..'§!<br />※14武器伤害:§Y+'..data.modifier.ship_weapon_damage
		end		
		if data.combat_disengage_chance then
			newstring = newstring..'§!<br />※14战斗逃脱几率修正:§Y'..(data.combat_disengage_chance * 100)..'%'
		end
		newstring = newstring..'§!'
		if data.modifier.zhcn_ship_modifier then
			newstring = newstring..'<br />※14'..data.modifier.ship_weapon_damage
		end
		newstring = newstring..'<br />'
		if data.zhcn_section then
			newstring = newstring..'<br />'..data.zhcn_section..'<br />'
		end
		if data.zhcn_required_component_set then
			newstring = newstring..data.zhcn_required_component_set..'<br />'
		end
		if data.prerequisites then
			newstring = newstring..'§E前置科技§!<br /><div style="padding-left:14px">'
			for _, item in ipairs(data.prerequisites) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Technology/')..'<br />'
			end
			newstring = newstring..'</div>'
		end
		if data.default_behavior then
			newstring = newstring..'§E默认行为:§!'..p.func_info('ship_behavior_'..data.default_behavior, 'key', 'Data:Ship_behaviors/')..'<br />'
		end
		if data.fleet_slot_size then
			newstring = newstring..'舰队槽位大小:§Y'..data.fleet_slot_size..'§!<br />'
		end
		if data.num_target_locators then
			newstring = newstring..'目标定位数量:§Y'..data.num_target_locators..'§!<br />'
		end
		if data.formation_priority then
			newstring = newstring..'编队优先级:§Y'..data.formation_priority..'§!<br />'
		end
		if data.combat_size_multiplier then
			newstring = newstring..'战斗尺寸:§Y'..data.combat_size_multiplier..'§!<br />'
		end
		if data.build_block_radius and data.build_block_radius ~= 0 then
			newstring = newstring..'§Y'..data.build_block_radius..'§!半径内禁止建造其他建筑<br />'
		end

		if data.zhcn_limit then
			newstring = newstring..data.zhcn_limit..'<br />'
		end
		if data.possible_starbase_logic then
			newstring = newstring..data.possible_starbase_logic..'<br />'
		end
		if data.can_disable == 'yes' then
			newstring = newstring..'§G常规战斗中,船体值为0时不会被摧毁而是会被禁用§!<br />'
		end
		if data.flip_control_on_disable == 'yes' then
			newstring = newstring..'§G禁用后转移所属权§!<br />'
		end
		if data.is_space_station == 'yes' then
			newstring = newstring..'§G是空间站§!<br />'
		end
		if data.is_civilian == 'yes' then
			newstring = newstring..'§G民用舰船§!<br />'
		end
		if data.is_designable == 'no' then
			newstring = newstring..'§R不可设计§!<br />'
		end
		if data.components_add_to_cost == 'no' then
			newstring = newstring..'§G组件不增加建造费用§!<br />'
		end
		if data.valid_target_aggressive_stance == 'no' then
			newstring = newstring..'§R无主动进攻模式§!<br />'
		end
		if data.auto_upgrade == 'yes' then
			newstring = newstring..'§G自动升级§!<br />'
		end
		if data.can_have_federation_design == 'yes' then
			newstring = newstring..'§G有联邦设计§!<br />'
		end
		if data.enable_default_design == 'yes' then
			newstring = newstring..'§G有默认设计§!<br />'
		end
		if data.has_mineral_upkeep == 'yes' then
			newstring = newstring..'§G需要矿物维护§!<br />'
		end
		if data.uses_name_prefix == 'no' then
			newstring = newstring..'§R不使用前缀§!<br />'
		end
		if data.takes_name_from_ship_design == 'yes' then
			newstring = newstring..'§G使用舰船设计名§!<br />'
		end
		if data.is_listed == 'no' then
			newstring = newstring..'§R不可建造§!<br />'
		end
		if data.can_be_inspected == 'no' then
			newstring = newstring..'§R不可查看细节§!<br />'
		end
		if data.is_space_object == 'yes' then
			newstring = newstring..'§G是太空物体§!<br />'
		end
		if data.graphical_culture and data.graphical_culture ~= 'no' then
			newstring = newstring..'§E画面风格§!<br /><div style="padding-left:14px">'
			for _, item in ipairs(data.graphical_culture) do
				newstring = newstring..item..'<br />'
			end
			newstring = newstring..'</div>'
		end
		if data.entity then
			newstring = newstring..'模型:'..data.entity..'<br />'
		end
		if data.pre_communications_name then
			newstring = newstring..'建立联系前的名称:'..data.pre_communications_name..'<br />'
		end
	elseif data.main_category == 'component_templates' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px">[[文件:'
			..(data.icon or data.key)
			..'.png|'
			..data.zhcn_name
			..'|58px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="margin-left:12px">'
			..p.item_tip(data)
			..''
		if data.slot and data.slot ~= '' then
		newstring = newstring
			..'<div style="display:inline;float:right">[[文件:component_slot_'
			..string.lower(data.slot)
			..'.png|'
			..data.slot
			..'槽组件|link=]]</div>'
		end
		newstring = newstring
			..'</span><br /><span style="margin-left:70px">§L'
			..data.en_name
			..'§!</span></span><br />'
		if data.zhcn_desc and data.zhcn_desc ~= '' then
			newstring = newstring..'§L'..data.zhcn_desc..'§!<br /><br />'
		end
		if data.power > 0 then
			newstring = newstring..'能源产出:§Y'..data.power..'§!<br />'
		elseif data.power < 0 then
			newstring = newstring..'能源消耗:§Y'..data.power..'§!<br />'
		end
		if data.cost and data.cost ~= 0 then
			newstring = newstring..'花费:£minerals §Y'..data.cost..'§!<br />'
		end
		if data.category == 'weapon' then
			cooldown = 0.0
			if data.zhcn_instruction then
				newstring = newstring..'<br />类型:§Y'..data.zhcn_instruction..'§!<br />'
			end
			if data.count then
				newstring = newstring..'数量:§Y'..data.count..'('..data.regeneration_per_day..'/ £resource_time )§!<br />'
			end
			if data.max_damage and data.max_damage ~= 0 then
				newstring = newstring..'伤害:§Y'..data.min_damage..'-'..data.max_damage..'§!<br />'
			end
			if data.max_windup then
				if data.max_windup == 0 and data.min_windup ~=0 then
					cooldown = data.cooldown + data.min_windup
					newstring = newstring..'充能时间:§Y'..data.min_windup..'§!£time <br />'
						..'开火时间:§Y'..data.cooldown..'§!£time <br />'
						..'总时间:§Y'..cooldown..'§!£time <br />'
				else
					cooldown = (data.cooldown + (data.min_windup + data.max_windup) / 2.0) / 10
					newstring = newstring..'基础冷却:§Y'..(data.cooldown / 10.0)..'§!£time <br />'
						..'准备时间:§Y'..(data.min_windup/ 10.0)..'-'..(data.max_windup/ 10.0)..'§!£time <br />'
						..'平均冷却时间:§Y'..cooldown..'§!£time <br />'
				end
			end
			if data.max_damage and data.max_damage ~= 0 then
				if data.accuracy then
					newstring = newstring..'命中:§Y'..(data.accuracy * 100)..'%§!<br />'
				end
				if data.tracking then
					newstring = newstring..'索敌:§Y'..(data.tracking * 100)..'%§!<br />'
				end
				if data.range then
					newstring = newstring..'射程:§Y'..data.range..'§!<br />'
				end
			end
			if data.health and data.health ~= 0 then
				newstring = newstring..'船体值:§Y'..data.health..'§!<br />'
			end
			if data.shield and data.shield ~= 0 then
				newstring = newstring..'护盾:§Y'..data.shield..'§!<br />'
			end
			if data.armor and data.armor ~= 0 then
				newstring = newstring..'护甲:§Y'..data.armor..'§!<br />'
			end
			if data.evasion and data.evasion ~= 0 then
				newstring = newstring..'闪避:§Y'..data.evasion..'§!<br />'
			end
			if data.speed and data.speed ~= 0 then
				newstring = newstring..'速度:§Y'..data.speed..'§!<br />'
			end
			if data.attack_range and data.attack_range ~= 0 then
				newstring = newstring..'舰载机起飞距离:§Y'..data.attack_range..'§!<br />'
			end
			if data.launch_time and data.launch_time ~= 0 then
				newstring = newstring..'舰载机发射时间:§Y'..data.launch_time..'§!£time <br />'
			end
			if data.rotation_speed then
				newstring = newstring..'舰载机旋转速度:§Y'..data.rotation_speed..'§!<br />'
			end
			if data.acceleration then
				newstring = newstring..'舰载机加速度:§Y'..data.acceleration..'§!<br />'
			end
			if data.max_damage then
				if data.max_windup ~= 0 then
					newstring = newstring..'平均伤害:§Y'..((data.min_damage + data.max_damage) / 2.0 / cooldown * data.accuracy)..'/§!£time <br />'
				end
			end
			if data.min_range then
				newstring = newstring..'最小距离:§Y'..data.min_range..'§!<br />'
			end
			if data.firing_arc then
				newstring = newstring..'开火角度:§Y'..data.firing_arc..'§!<br />'
			end
			if data.missile_health and data.missile_health ~=0 then
				newstring = newstring..'§H导弹:§!<div style="margin-left:12px">'
					..'船体值:§Y'..data.missile_health..'§!<br />'
					..'闪避:§Y'..data.missile_evasion..'§!<br />'
					..'速度:§Y'..data.missile_speed..'§!<br />'
					..'重定向范围:§Y'..data.missile_retarget_range..'§!'
					..'</div>'
			end
			if data.max_damage and data.max_damage ~= 0 then
				newstring = newstring..'<br />'
				if data.shield_penetration and data.shield_penetration ~= 0 then
					newstring = newstring.."§G+"..(data.shield_penetration * 100)..'%护盾穿透§!<br />'
				end
				if data.shield_damage then
					if data.shield_damage > 1 then
						newstring = newstring.."§G+"..((data.shield_damage - 1) * 100)..'%护盾伤害§!<br />'
					elseif data.shield_damage < 1 then
						newstring = newstring.."§R-"..((1 - data.shield_damage) * 100)..'%护盾伤害§!<br />'
					end
				end
				if data.armor_penetration and data.armor_penetration ~= 0 then
					newstring = newstring.."§G+"..(data.armor_penetration * 100)..'%护甲穿透§!<br />'
				end
				if data.armor_damage then
					if data.armor_damage > 1 then
						newstring = newstring.."§G+"..((data.armor_damage - 1) * 100)..'%护甲伤害§!<br />'
					elseif data.armor_damage < 1 then
						newstring = newstring.."§R-"..((1 - data.armor_damage) * 100)..'%护甲伤害§!<br />'
					end
				end
				if data.hull_damage then
					if data.hull_damage > 1 then
						newstring = newstring.."§G+"..((data.hull_damage - 1) * 100)..'%船体伤害§!<br />'
					elseif data.hull_damage < 1 then
						newstring = newstring.."§R-"..((1 - data.hull_damage) * 100)..'%船体伤害§!<br />'
					end
				end
			end
			newstring = newstring..'<br />'
			if data.ai_task then
				newstring = newstring..'AI任务:§Y'..data.ai_task..'§!<br />'
			end
			if data.static_rotation == 'yes' then
				newstring = newstring..'§R不能自行转向,只能随船体转向§!<br />'
			end
			if data.entity then
				newstring = newstring..'炮台模型:§Y'..data.entity..'§!<br />'
			end
			if data.projectile_gfx then
				newstring = newstring..'弹道模型:§Y'..data.projectile_gfx..'§!<br />'
			end
			if data.prio_projectile == 'yes' then
				newstring = newstring..'§G高优先级弹道§!<br />'
			end
			if data.planet_destruction_gfx then
				newstring = newstring..'行星摧毁动画:§Y'..data.planet_destruction_gfx..'§!<br />'
			end
			if data.ai_tag_weight then
				newstring = newstring..'AI分类权重:§Y'..data.ai_tag_weight..'§!<br />'
			end
			newstring = newstring..'<br />'
		else
			if data.zhcn_ship_modifier then
				newstring = newstring..data.zhcn_ship_modifier..'<br />'
			end
			if data.zhcn_modifier then
				newstring = newstring..data.zhcn_modifier..'<br />'
			end
			if data.sensor_range then
				newstring = newstring..'传感距离:§Y'..data.sensor_range..'§!<br />'
			end
			if data.ftl == 'yes' then
				newstring = newstring..'§G超光速组件§!<br />'
			end
			if data.jumpdrive == 'yes' then
				newstring = newstring..'§G跃迁引擎组件§!<br />'
			end
			if data.should_ai_use == 'no' then
				newstring = newstring..'§GAI不会选择该组件§!<br />'
			end
			if data.ftl_inhibitor == 'yes' then
				newstring = newstring..'§G超光速抑制装置§!<br />'
			end
			if data.friendly_aura == 'yes' then
				newstring = newstring
					..'§Y'..data.friendly_aura.zhcn_name..'§!<br />'
					..data.friendly_aura.zhcn_modifier..'<br />'
			end
			if data.hostile_aura == 'yes' then
				newstring = newstring
					..'§Y'..data.hostile_aura.zhcn_name..'§!<br />'
					..data.hostile_aura.zhcn_modifier..'<br />'
			end
		end
		if data.prerequisites then
			newstring = newstring..'§E前置科技§!<br /><div style="padding-left:14px">'
			for _, item in ipairs(data.prerequisites) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Technology/')..'<br />'
			end
			newstring = newstring..'</div>'
		end
			if data.class_restriction then
				newstring = newstring..'舰船类型限制:§Y'..data.zhcn_class_restriction..'§!<br />'
			end
		if data.size_restriction then
			newstring = newstring..'§E舰船限制§!<br /><div style="padding-left:14px">'
			for _, item in ipairs(data.size_restriction) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Ship_sizes/')..'<br />'
			end
			newstring = newstring..'</div>'
		end
		if data.upgrades_to then
			newstring = newstring..'§E可用升级§!<br /><div style="padding-left:14px">'
			for _, item in ipairs(data.upgrades_to) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Component_templates/')..'<br />'
			end
			newstring = newstring..'</div>'
		end
		if data.ship_behavior then
			newstring = newstring..'§E舰船行为:§!'..p.func_info('ship_behavior_'..data.ship_behavior, 'key', 'Data:Ship_behaviors/')..'<br />'
		end
		if data.hidden == 'yes' then
			newstring = newstring..'§R隐藏组件(无法在舰船设计器中使用)§!<br />'
		end
		if data.ai_weight_logic then
			newstring = newstring
			..data.ai_weight_logic
		end
	elseif data.main_category == 'starbase_buildings' or data.main_category == 'starbase_modules' then
		newstring = newstring
			..common_title(data, 58)
			..data.zhcn_desc
		if data.zhcn_cost then
			newstring = newstring..'基础花费:§Y'..data.zhcn_cost..'§!<br />'
		end
		if data.construction_days then
			newstring = newstring..'基础事件:§Y£time '..data.construction_days..'§!<br />'
		end
		if data.zhcn_upkeep_resources then
			newstring = newstring..'维护费:§Y'..data.zhcn_upkeep_resources..'§!<br />'
		end
		if data.zhcn_produced_resources then
			newstring = newstring..'产出:§Y'..data.zhcn_produced_resources..'§!<br />'
		end
		if data.zhcn_country_modifier then
			newstring = newstring..'帝国修正:<div style="padding:0px 0px 0px 14px">'..data.zhcn_country_modifier..'</div>'
		end
		if data.zhcn_system_modifier then
			newstring = newstring..'星系修正:<div style="padding:0px 0px 0px 14px">'..data.zhcn_system_modifier..'</div>'
		end
		if data.zhcn_orbit_modifier then
			newstring = newstring..'轨道修正:<div style="padding:0px 0px 0px 14px">'..data.zhcn_orbit_modifier..'</div>'
		end
		if data.zhcn_station_modifier then
			newstring = newstring..'恒星基地修正:<div style="padding:0px 0px 0px 14px">'..data.zhcn_station_modifier..'</div>'
		end
		if data.zhcn_ship_modifier then
			newstring = newstring..'船只修正:<div style="padding:0px 0px 0px 14px">'..data.zhcn_ship_modifier..'</div>'
		end
		if data.zhcn_tip then
			newstring = newstring..data.zhcn_tip..'<br />'
		end
		if data.equipped_component then
			newstring = newstring..'§E装备组件§!:<div style="padding-left:14px">'
			for _, item in ipairs(data.equipped_component) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Component_templates/')..'<br />'
			end
			newstring = newstring..'</div>'
		end
		if data.section then
			newstring = newstring
				..'§E对应区块:§!<div style="padding-left:14px">'
				..p.func_info(data.section, 'key', 'Data:Section_templates/')
				..'</div>'
		end
		if data.prerequisites then
			newstring = newstring..'§E前置科技§!<br /><div style="padding-left:14px">'
			for _, item in ipairs(data.prerequisites) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Technology/')..'<br />'
			end
			newstring = newstring..'</div><br />'
		end
		if data.initial == 'yes' then
			newstring = newstring..'§G起始恒星基地自带建筑§!<br />'
		end
		if data.ai_build_at_chokepoint == 'yes' then
			newstring = newstring..'§GAI会在路口星系的恒星基地安装此建筑§!<br />'
		elseif data.ai_build_at_chokepoint == 'no' then
			newstring = newstring..'§RAI不会在路口星系的恒星基地安装此建筑§!<br />'
		end
		if data.ai_build_outside_chokepoint == 'yes' then
			newstring = newstring..'§GAI会在非路口星系的恒星基地安装此建筑§!<br />'
		elseif data.ai_build_outside_chokepoint == 'no' then
			newstring = newstring..'§RAI不会在非路口星系的恒星基地安装此建筑§!<br />'
		end
		newstring = newstring..'<div>--------------</div>'
		if data.triggered_country_modifier_logic then
			newstring = newstring
			..data.triggered_country_modifier_logic..'<br />'
		end
		if data.produced_resource_trigger_logic then
			newstring = newstring
			..data.produced_resource_trigger_logic..'<br />'
		end
		newstring = newstring..'<div>--------------</div>'
		if data.potential_logic then
			newstring = newstring
			..data.potential_logic..'<br />'
		end
		if data.possible_logic then
			newstring = newstring
			..data.possible_logic..'<br />'
		end
		if data.ai_weight_logic then
			newstring = newstring
			..data.ai_weight_logic
		end
	elseif data.main_category == 'armies' then
		newstring = newstring
			..common_title(data, 44)
		if data.zhcn_cost then
			newstring = newstring..data.zhcn_cost..'<br />'
		end
		newstring = newstring
			..'伤害:§Y'
			..(data.min_damage or '0.00')
			..'-'
			..(data.max_damage or '0.00')
			..'§!<br />'
		if data.has_morale ~= 'no' then
			newstring = newstring..'士气伤害:§Y'..data.min_morale_damage..'-'..data.max_morale_damage..'§!<br />'
		end
		if data.collateral and data.collateral ~= '0' then
			newstring = newstring..'附加伤害:§Y'..data.collateral..'§!<br />'
		end
		newstring = newstring..'生命值:§Y'..data.max_health..'§!<br />'
		if data.has_morale ~= 'no' then
			newstring = newstring..'士气:§Y'..data.max_morale..'§!<br />'
		else
			newstring = newstring..'§G这种部队没有士气值且不受士气伤害影响。§!<br />'
		end
		if data.maintenance then
			newstring = newstring..'维护费:£energy§Y'..data.maintenance..'§!<br />'
		end
		if data.war_exhaustion then
			newstring = newstring..'被击杀获得厌战度:§Y'..data.war_exhaustion..'§!<br />'
		end
		if data.defensive == 'yes' then
			newstring = newstring..'§G防御部队§!<br />'
		end
		if data.is_building_spawned == 'yes' then
			newstring = newstring..'§G由建筑生成的部队§!<br />'
		end
		if data.has_species == 'yes' then
			newstring = newstring..'§G有种族(会受到特质加成)§!<br />'
		end
		if data.prerequisites then
			newstring = newstring..'§E前置科技§!<br /><div style="padding-left:14px">'
			for _, item in ipairs(data.prerequisites) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Technology/')..'<br />'
			end
			newstring = newstring..'</div><br />'
		end
		if data.pop_limited == 'no' then
			newstring = newstring..'§G不受人口数量限制§!<br />'
		end
		if data.rebel == 'yes' then
			newstring = newstring..'§G是叛军§!<br />'
		end
		if data.occupation == 'yes' then
			newstring = newstring..'§G是占领军§!<br />'
		end
		newstring = newstring
			..'<div>--------------</div>'
		if data.zhcn_desc then
			newstring = newstring..data.zhcn_desc..'<div>--------------</div>' or ''
		end
		if data.potential_logic then
			newstring = newstring..data.potential_logic..'<br />'
		end
		if data.show_tech_unlock_if_logic then
			newstring = newstring..data.show_tech_unlock_if_logic..'<br />'
		end
		if data.allow_logic then
			newstring = newstring..data.allow_logic..'<br />'
		end
	elseif data.main_category == 'war_goals' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px">[[文件:Diplomacy_war.png|'
			..data.zhcn_name
			..'|44px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="margin-left:12px">'
			..p.item_tip(data)
			..'</span><br /><span style="margin-left:56px">§L'
			..data.en_name
			..'§!</span></span><br />'
		if data.zhcn_desc then
			newstring = newstring..'§L'..data.zhcn_desc..'§!<br /><div>--------------</div>'
		end
		if data.casus_belli then
			newstring = newstring..'§E所需宣战借口:§!'..p.func_info(data.casus_belli, 'key', 'Data:Casus_belli/')..'<br />'
		end
		if data.hide_if_no_cb == 'yes' then
			newstring = newstring..'§G没有对应宣战借口时隐藏§!'..'<br />'
		elseif data.hide_if_no_cb == 'no' then
			newstring = newstring..'§G没有对应宣战借口时依然显示§!'..'<br />'
		end
		if data.set_defender_wargoal then
			newstring = newstring..'§E防御方可用战争目标:§!'..p.func_info(data.set_defender_wargoal, 'key', 'Data:War_goals/')..'<br />'
		end
		if data.total_war == 'yes' then
			newstring = newstring..'§G全面战争§!'..'<br />'
		end
		if data.surrender_acceptance then
			newstring = newstring..'§E投降接受度修正:§!'..data.surrender_acceptance..'<br />'
		end
		if data.war_exhaustion then
			newstring = newstring..'§E厌战度修正:§!'..data.war_exhaustion..'<br />'
		end
		if data.threat_multiplier then
			newstring = newstring..'§E威胁度系数修正:§!'..data.threat_multiplier..'<br />'
		end
		if data.defender_default == 'yes' then
			newstring = newstring..'§G防御方默认战争目标§!'..'<br />'
		end
		if data.cede_claims == 'occupied_only' then
			newstring = newstring..'§G仅占领§!'
		end
		newstring = newstring..'<div>--------------</div>' 
		if data.on_accept_logic then
			newstring = newstring..data.on_accept_logic..'<br />'
		end
		if data.on_status_quo_logic then
			newstring = newstring..data.on_status_quo_logic..'<br />'
		end
		if data.on_wargoal_set_logic then
			newstring = newstring..data.on_wargoal_set_logic
		end
		newstring = newstring..'<div>--------------</div>'
		if data.potential_logic then
			newstring = newstring..data.potential_logic..'<br />'
		end
		if data.ai_weight_logic then
			newstring = newstring..data.ai_weight_logic..'<br />'
		end
		if data.possible_logic then
			newstring = newstring..data.possible_logic
		end
	elseif data.main_category == 'casus_belli' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px">[[文件:Diplomacy_status_casus_belli_holder.png|'
			..data.zhcn_name
			..'|44px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="margin-left:12px">'
			..p.item_tip(data)
			..'</span><br /><span style="margin-left:56px">§L'
			..data.en_name
			..'§!</span></span><br />'
		if data.zhcn_desc then
			newstring = newstring..'§L'..data.zhcn_desc..'§!<br /><div>--------------</div>'
		end
		if data.war_goals then
			newstring = newstring..'§E战争目标:§!<br />'
			for _,item in ipairs(data.war_goals) do
				newstring = newstring..p.func_info(item, 'key', 'Data:War_goals/')..'<br />'
			end
		end
		if data.show_in_diplomacy == 'yes' then
			newstring = newstring..'§G在外交中显示§!'..'<br />'
		elseif data.show_in_diplomacy == 'no' then
			newstring = newstring..'§R在外交中不显示§!'..'<br />'
		end
		if data.show_notification == 'yes' then
			newstring = newstring..'§G显示通知§!'..'<br />'
		elseif data.show_notification == 'no' then
			newstring = newstring..'§R不显示通知§!'..'<br />'
		end

		newstring = newstring..'<div>--------------</div>'
		if data.potential_logic then
			newstring = newstring..data.potential_logic..'<br />'
		end
		if data.is_valid_logic then
			newstring = newstring..data.is_valid_logic
		end
	elseif data.main_category == 'subjects' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px">'
			..p.item_tip(data)
			..'<br />§L'
			..data.en_name
			..'§!</span><br />'
		if data.zhcn_desc then
			newstring = newstring..'§L'..data.zhcn_desc..'§!<br /><div>--------------</div>'
		end
		if data.zhcn_tax_rate then
			newstring = newstring..'§E为宗主国纳贡:§!'..data.zhcn_tax_rate..'<br />'
		end
		if data.can_expand == 'yes' then
			newstring = newstring..'§G可以扩张§!<br />'
		elseif data.can_expand == 'no' then
			newstring = newstring..'§R不能扩张§!<br />'
		end
		if data.can_be_integrated == 'yes' then
			newstring = newstring..'§G可被§!§Y合并附庸§!<br />'
		elseif data.can_be_integrated == 'no' then
			newstring = newstring..'§R不能被合并§!<br />'
		end
		if data.joins_overlord_wars == 'yes' then
			newstring = newstring..'§R必须加入宗主国的战争§!<br />'
		elseif data.joins_overlord_wars == 'no' then
			newstring = newstring..'§G不必加入宗主国的战争§!<br />'
		end
		if data.calls_overlord_to_war == 'yes' then
			newstring = newstring..'§G召唤宗主国加入战争§!<br />'
		elseif data.calls_overlord_to_war == 'no' then
			newstring = newstring..'§R不召唤宗主国加入战争§!<br />'
		end
		if data.can_do_diplomacy == 'yes' then
			newstring = newstring..'§G极大的外交权§!<br />'
		elseif data.can_do_diplomacy == 'no' then
			newstring = newstring..'§R有限的外交权§!<br />'
		end
		if data.diplo_threat then
			newstring = newstring..'§E外交威胁度系数:§!'..data.diplo_threat..'<br />'
		end
		if data.research_agreement == 'no' then
			newstring = newstring..'§R不可交换科研协议§!<br />'
		else
			newstring = newstring..'§R可交换科研协议§!<br />'
		end
		if data.research_sharing == 'yes' then
			newstring = newstring..'§G与宗主国分享科研协议§!<br />'
		end
		if data.tech_cost_mult then
			newstring = newstring..'§E研究宗主国已有科技时减少消耗:§!'..data.tech_cost_mult..'<br />'
		end
		if data.overlord_influence then
			newstring = newstring..'§E每月为宗主国提供影响力:§!'..data.overlord_influence..'<br />'
		end
		if data.can_switch_to then
			newstring = newstring..'§E可转化为:§!<br />'
			for _,item in ipairs(data.can_switch_to) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Subjects/')..'<br />'
			end
		end
		newstring = newstring..'<div>--------------</div>'
		if data.become_vassal_logic then
			newstring = newstring..data.become_vassal_logic..'<br />'
		end
		if data.potential_logic then
			newstring = newstring..data.potential_logic..'<br />'
		end
		if data.effect_logic then
			newstring = newstring..data.effect_logic
		end
	elseif data.main_category == 'pop_faction_types' then
		newstring = newstring
			..common_title(data, 64)
		if data.zhcn_desc then
			newstring = newstring..data.zhcn_desc..'<br /><br />'
		end
		if data.guiding_ethic then
			newstring = newstring..'指引思潮:'..p.func_info(data.guiding_ethic, 'key', 'Data:Ethics/')..'<br />'
		end
		if data.unique == 'yes' then
			newstring = newstring..'§G派系唯一§!<br/>'
		end
		if data.support_multiplier then
			newstring = newstring..'§E支持率系数:§!'..data.support_multiplier..'<br />'
		end
		if data.demand then
			newstring = newstring..'§E派系诉求:§!<div style="padding:0px 0px 0px 14px">'
			for _, demand in ipairs(data.demand) do
				newstring = newstring
					..'满足要求时的诉求名称:§H'..demand.zhcn_name..'§!<br />'
					..'不满足要求时的诉求名称:§H'..demand.un_name..'§!<br />'
					..demand.desc..'<br />'
					..'满足要求时派系幸福度:§G+'..(demand.fulfilled_effect or '0')..'%§!<br />'
					..'不满足要求时派系幸福度:§R'..(demand.unfulfilled_effect or '0') ..'%§!<br />'
					..demand.potential_logic..'<br />'
					..demand.trigger_logic..'<br />'
					..'<div>--------------</div>'
			end
			newstring = newstring..'</div>'
		end
		if data.actions then
			newstring = newstring..'§E管理派系:§!<div style="padding:0px 0px 0px 14px">'
			for _, actions in ipairs(data.actions) do
				newstring = newstring
					..'§E'..actions.zhcn_name..'§!<br />'
				if actions.zhcn_cost then
					newstring = newstring..'消耗:'..actions.zhcn_cost..'<br />'
				end
				newstring = newstring..actions.potential_logic..'<br />'
				if actions.valid_logic then
					newstring = newstring..actions.valid_logic..'<br />'
				end
				if actions.effect_logic then
					newstring = newstring..actions.effect_logic..'<br />'
				end
				if actions.ai_weight_logic then
					newstring = newstring..actions.ai_weight_logic
				end
				newstring = newstring..'<div>--------------</div>'
			end
			newstring = newstring..'</div>'
		end
		if data.is_potential_logic then
			newstring = newstring
			..data.is_potential_logic
			..'<div>--------------</div>'
		end
		if data.can_join_faction_logic then
			newstring = newstring
			..data.can_join_faction_logic
			..'<div>--------------</div>'
		end
		if data.attraction_logic then
			newstring = newstring
			..data.attraction_logic
			..'<div>--------------</div>'
		end
		if data.leader_logic then
			newstring = newstring
			..data.leader_logic
			..'<div>--------------</div>'
		end
		if data.on_create_logic then
			newstring = newstring
			..data.on_create_logic
			..'<div>--------------</div>'
		end
		if data.on_destroy_logic then
			newstring = newstring
			..data.on_destroy_logic
		end
	elseif data.main_category == 'megastructures' then
		newstring = newstring
			..common_title(data, 52)
		if data.zhcn_cost then
			newstring = newstring..data.zhcn_cost
			if data.build_time then
				newstring = newstring..'£time§H'..data.build_time..'§!'
			end
			newstring = newstring..'<br />'
		end
		if data.zhcn_desc then
			newstring = newstring..data.zhcn_desc..'<br /><br />'
		end
		if data.megastructure_details then
			newstring = newstring..'§E建造提示:§!'..data.megastructure_details..'<br /><br />'
		end
		if data.possible_desc then
			newstring = newstring
			..data.possible_desc
			..'<div>--------------</div>'
		end
		if data.construction_info_delayed then
			newstring = newstring..'§E建造信息:§!'..data.construction_info_delayed..'<br /><br />'
		end
		if data.zhcn_maintenance then
			newstring = newstring..data.zhcn_maintenance..'<br /><br />'
		end
		if data.zhcn_monthly then
			newstring = newstring..data.zhcn_monthly..'<br /><br />'
		end
		if data.upgrade_desc == 'hide' then
			newstring = newstring..'§G隐藏升级提示(系统对其升级进行特殊处理)§!<br />'
		end
		if data.upgrade then
			newstring = newstring..'§E可用升级:§!'
			for _,item in ipairs(data.upgrade) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Megastructures/')..'<br />'
			end
		end
		-- if data.portrait then
		--	 newstring = newstring..data.portrait
		-- end
		if data.construction_entity then
			newstring = newstring..'§E建造时的模型:§!'..data.construction_entity..'<br />'
		end
		if data.zhcn_offset then
			newstring = newstring..data.zhcn_offset..'<br />'
		end
		if data.entity then
			newstring = newstring..'§E模型:§!'..data.entity..'<br />'
		end
		if data.place_entity_on_planet_plane == 'yes' then
			newstring = newstring..'§G模型放在行星平面上§!<br />'
		elseif data.place_entity_on_planet_plane == 'no' then
			newstring = newstring..'§R模型不放在行星平面上§!<br />'
		end
		if data.build_outside_gravity_well == 'yes' then
			newstring = newstring..'§R不能建造在星系的重力井内§!<br />'
		end
		if data.sensor_range then
			newstring = newstring..'§E传感距离§!'..data.sensor_range..'<br />'
		end
		if data.show_galactic_map_icon == 'no' then
			newstring = newstring..'§R不显示银河地图图标§!<br />'
		end
		if data.construction_blocks_others == 'no' then
			newstring = newstring..'§G建造时不影响建造或升级其他巨型建筑§!<br />'
		end
		if data.bypass_type == 'gateway' then
			newstring = newstring..'§E通行方式:§!星门<br />'
		end
		newstring = newstring..'<div>--------------</div>'		
		if data.potential_logic then
			newstring = newstring..data.potential_logic..'<br />'
		end
		if data.ai_weight_logic then
			newstring = newstring..data.ai_weight_logic..'<br />'
		end
		if data.placement_rules_logic then
			newstring = newstring..data.placement_rules_logic..'<br />'
		end
		if data.on_build_start_logic then
			newstring = newstring..data.on_build_start_logic..'<br />'
		end
		if data.on_build_cancel_logic then
			newstring = newstring..data.on_build_cancel_logic..'<br />'
		end
		if data.on_build_complete_logic then
			newstring = newstring..data.on_build_complete_logic..'<br />'
		end
	elseif data.main_category == 'policies' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px">[[文件:Menu_icon_policies_and_edicts.png|'
			..data.zhcn_name
			..'|33px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="margin-left:12px">'
			..p.item_tip(data)
			..'</span><br /><span style="margin-left:56px">§L'
			..data.en_name
			..'§!</span></span><br />'
		if data.zhcn_desc then
			newstring = newstring..data.zhcn_desc
		end
		newstring = newstring..'<div>--------------</div>'
		if data.potential_logic then
			newstring = newstring..data.potential_logic..'<br />'
		end
		if data.allow_logic then
			newstring = newstring..data.potential_logic..'<br />'
		end
		if data.option then
			for _,options in ipairs(data.option) do
				newstring = newstring
					..'<div>--------------</div><div>[[文件:Radio_button_normal.png|选项|32px|link=]]'
					..'§E'
					..options.zhcn_name
					..'§!<br /><span style="padding:0px 0px 0px 32px">§L'
					..options.en_name
					..'§!</span><br />'
					..options.zhcn_desc
					..'</div>'
				if options.zhcn_modifier then
					newstring = newstring..options.zhcn_modifier..'<br />'
				end
				if options.valid_logic then
					newstring = newstring..options.valid_logic..'<br />'
				end
				if options.AI_weight_logic then
					newstring = newstring..options.AI_weight_logic..'<br />'
				end
				if options.on_enabled_logic then
					newstring = newstring..options.on_enabled_logic..'<br />'
				end
				if options.on_disabled_logic then
					newstring = newstring..options.on_disabled_logic..'<br />'
				end
			end
		end
	elseif data.main_category == 'edicts' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px">[[文件:Menu_icon_policies_and_edicts.png|'
			..data.zhcn_name
			..'|33px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="margin-left:12px">'
			..p.item_tip(data)
			..'</span><br /><span style="margin-left:45px">§L'
			..data.en_name
			..'§!</span></span><br />'
		if data.zhcn_desc then
		newstring = newstring..'§L'..data.zhcn_desc..'§!<br /><br />'
		end
		if data.zhcn_modifier then
			newstring = newstring..'§E效果:§!<br />'
			if data.length ~= '0' then
				day = tonumber(data.length)
				month, day =math.modf(day/30)
				year, month =math.modf(month/12)
				newstring = newstring..'持续'
				if year ~= 0 then
					newstring = newstring..'§H'..tostring(year)..'§!年'
				end
				if month ~= 0 then
					newstring = newstring..'§H'..tostring(month)..'§!月'
				end
				if day ~= 0 then
					newstring = newstring..'§H'..tostring(day)..'§!日'
				end
				newstring = newstring..'<br />'
			end
			newstring = newstring..data.zhcn_modifier..'<br />'
		end
		if data.zhcn_cost then
			newstring = newstring..data.zhcn_cost..'<br />'
		end
		if data.sub_category == 'country_edict' then
			newstring = newstring..'国家法令'..'<br />'
		elseif data.sub_category == 'planet_edict' then
			newstring = newstring..'星球法令'..'<br />'
		end
		if data.is_ambition then
			newstring = newstring..'§G野望法案§!<br />'
		end
		if data.prerequisites then
			newstring = newstring..'§E前置科技§!<br /><div style="padding-left:14px">'
			for _, item in ipairs(data.prerequisites) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Technology/')..'<br />'
			end
			newstring = newstring..'</div><br />'
		end
		newstring = newstring..'<div>--------------</div>'
		if data.show_tech_unlock_if_logic then
			newstring = newstring..data.show_tech_unlock_if_logic..'<br />'
		end
		if data.allow_logic then
			newstring = newstring..data.allow_logic..'<br />'
		end
		if data.potential_logic then
			newstring = newstring..data.potential_logic..'<br />'
		end
		if data.ai_weight_logic then
			newstring = newstring..data.ai_weight_logic
		end
	elseif data.main_category == 'bombardment_stances' then
		newstring = newstring
			..common_title(data, 44)
			..(data.zhcn_desc..'<br />' or '')
			..'<div>--------------</div>'
		if data.default == 'yes' then
			newstring = newstring..'§G默认姿态§!<br />'
		end
		if data.stop_when_armies_dead == 'yes' then
			newstring = newstring..'§G陆军死亡时停止轰炸§!<br />'
		elseif data.stop_when_armies_dead == 'no' then
			newstring = newstring..'§R陆军死亡时不停止轰炸§!<br />'
		end
		if data.abduct_pops == 'yes' then
			newstring = newstring..'§G劫掠人口§!<br />'
		end
		if data.planet_damage then
			newstring = newstring..'§E对星球防御伤害修正:§!'..data.planet_damage..'<br />'
		end
		if data.army_damage then
			newstring = newstring..'§E对陆军伤害修正:§!'..data.army_damage..'<br />'
		end
		if data.kill_pop_chance then
			newstring = newstring..'§E人口击杀概率修正:§!'..data.kill_pop_chance..'<br />'
		end
		if data.min_pops_to_kill_pop then
			newstring = newstring..'§E击杀人口所需最小人口数量:§!'..data.min_pops_to_kill_pop..'<br />'
		end
		if data.add_blocker_chance then
			newstring = newstring..'§E制造地块障碍修正:§!'..data.add_blocker_chance..'<br />'
		end
		if data.max_blockers == '-1' then
			newstring = newstring..'§E地块障碍最大数量:§!无限制<br />'
		elseif data.max_blockers then
			newstring = newstring..'§E地块障碍最大数量:§!'..data.max_blockers..'<br />'
		end
		newstring = newstring..'<div>--------------</div>'
		if data.trigger_logic then
			newstring = newstring..data.trigger_logic..'<br />'
		end
		if data.ai_weight_logic then
			newstring = newstring..data.ai_weight_logic..'<br />'
		end
	elseif data.main_category == 'traits' then
		newstring = newstring
			..common_title(data, 29)
		if data.zhcn_modifier then
			newstring = newstring..data.zhcn_modifier..'<br />'
		end
		if data.immortal_leaders == 'yes' then
			newstring = newstring..'§G不朽§!<br />'
		end
		newstring = newstring..'<div>--------------</div>'
		if data.zhcn_desc and data.zhcn_desc~='' then
			newstring = newstring..data.zhcn_desc..'<div>--------------</div>'
		end
		if data.cost then
			newstring = newstring..'§E点数:§!'..data.cost..'<br />'
		end
		if data.opposites then
			newstring = newstring..'§E互斥特性:§!<div style="padding:0px 0px 0px 28px>'
			for _,item in ipairs(data.opposites) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Traits/')..'<br />'
			end
			newstring = newstring..'</div>'
		end
		if data.initial == 'no' then
			newstring = newstring..'§R非初始特性§!<br />'
		else
			newstring = newstring..'§G可成为初始特性§!<br />'
		end
		if data.randomized == 'no' then
			newstring = newstring..'§R非随机出现的特性§!<br />'
		else
			newstring = newstring..'§G可随机出现特性§!<br />'
		end
		if data.leader_trait == 'yes' then
			if data.zhcn_leader_class then
				newstring = newstring..'§E所属领袖类型:§!'
				for _,item in ipairs(data.zhcn_leader_class) do
					newstring = newstring..item..' '
				end
				newstring = newstring..'<br />'
			end 
			if data.ai_categories then
				newstring = newstring..'§E特性分类:§!'
				for _,item in ipairs(data.ai_categories) do
					newstring = newstring..item..' '
				end
				newstring = newstring..'<br />'
			end
			if data.hide_age == 'yes' then
				newstring = newstring..'§G不显示年龄§!(因为是不朽的)<br />'
			end
			if data.prerequisites then
				newstring = newstring..'§E前置科技§!<br /><div style="padding-left:14px">'
				for _, item in ipairs(data.prerequisites) do
					newstring = newstring..p.func_info(item, 'key', 'Data:Technology/')..'<br />'
				end
				newstring = newstring..'</div><br />'
			end
			newstring = newstring..'<div>--------------</div>'
			if data.leader_potential_add_logic then
				newstring = newstring..data.leader_potential_add_logic..'<br />'
			end
		else
			if data.zhcn_archetypes then
				newstring = newstring..'§E允许的种族类型:§!'
				for _,item in ipairs(data.zhcn_archetypes) do
					newstring = newstring..item..' '
				end
				newstring = newstring..'<br />'
			end
			if data.forced_happiness == 'yes' then
				newstring = newstring..'§G不受幸福度影响§!<br />'
			end
			if data.alters_species_identity == 'yes' then
				newstring = newstring..'§G改变种族基础ID§!<br />'
			end
			if data.sapient == 'no' then
				newstring = newstring..'§G未开智物种特性§!<br />'
			end
			if data.advanced_trait == 'yes' then
				newstring = newstring..'§G高级特性§!<br />'
			end
			if data.sorting_priority then
				newstring = newstring..'§E图标排列优先级:§!'..data.sorting_priority..'<br />'
			end
			newstring = newstring..'<div>--------------</div>'
			if data.species_potential_add_logic then
				newstring = newstring
				..data.species_potential_add_logic..'<br />'
			end
		end
		if data.ai_weight_logic then
			newstring = newstring
			..data.ai_weight_logic..'<br />'
		end
	elseif data.main_category == 'ascension_perks' then
		newstring = newstring
			..'" style="display:inline-block;position:relative;left:0px;top:0px">[[文件:'
			..(data.icon or data.key)
			..'.png|'
			..data.zhcn_name
			..'|52px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="position:absolute;left:-9px;top:-5px">[[文件:empire_flag_64_frame.png|'
			..data.zhcn_name
			..'|70px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]'
			..'</span><span style="padding:8px 0px 0px 30px">'
			..p.item_tip(data)
			..'</span><br /><span style="margin-left:82px">§L'
			..data.en_name
			..'§!</span></span><br /><br />'
		if data.zhcn_desc then
			newstring = newstring..data.zhcn_desc..'<br /><br />'
		end
		if data.zhcn_modifier then
			newstring = newstring..'§E效果:§!<br/>'..data.zhcn_modifier..'<br /><br />'
		end
		if data.possible_desc then
			newstring = newstring..data.possible_desc..'<br /><br />'
		end
			newstring = newstring..'<div>--------------</div>'
		if data.potential_logic then
			newstring = newstring..data.potential_logic..'<br /><br />'
		end
		if data.ai_weight_logic then
			newstring = newstring..data.ai_weight_logic
		end
	elseif data.main_category == 'agendas' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px">[[文件:Agenda.png|24px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="margin-left:12px">§E议程:§!'
			..p.item_tip(data)
			..'</span><br /><span style="margin-left:41px">§L'
			..data.en_name
			..'§!</span></span><br />'
			..data.zhcn_modifier
			..'<div>--------------</div>'
			..data.weight_modifier_logic
	elseif data.main_category == 'tile_blockers' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px;width:332px;position:relative">[[文件:'
			..(data.icon or data.key)
			..'.png|'
			..data.zhcn_name
			..'|98px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="position:absolute;left:0px;top:0px">[[文件:Tile_blocked_frame.png|'
			..data.zhcn_name
			..'|98px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]'
			..'</span><span style="position:absolute;left:110px;top:18px">'
			..p.item_tip(data)
			..'<br />§L'
			..data.en_name
			..'§!</span></span><br /><span style="display:inline-block;position:relative">'
		if data.zhcn_cost then
			newstring = newstring..data.zhcn_cost..'<br />'
		end
		if data.prerequisites then
			newstring = newstring..'前置科技:<br /><div style="padding-left:14px">'
			for _, item in ipairs(data.prerequisites) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Technology/')..'<br />'
			end
			newstring = newstring..'</div><br />'
		end
		if data.from_planet_damage == 'yes' then
			newstring = newstring..'▲来自轨道轰炸<br />'
		end
		if data.zhcn_adjacency_bonus then
			newstring = newstring..'§E毗邻效应:§!'..data.zhcn_adjacency_bonus..'<br />'
		end
		if data.zhcn_desc then
			newstring = newstring..'<div>--------------</div>'..data.zhcn_desc..'<br />'
		end
		if data.spawn_chance_logic then
			newstring = newstring
			..data.spawn_chance_logic
		end
		newstring = newstring..'</span>'
	elseif data.main_category == 'terraform' then
		newstring = newstring
			..'" style="display:inline-block;position:relative">'
			..p.item_tip(data)
			..'<br />§L'
			..data.en_name
			..'§!</span><br /><br />§E改造选项:§!'
		if data.from then
			newstring = newstring..p.func_info(data.from, 'key', 'Data:Planet_classes/')..'→'
		end
		if data.to then
			newstring = newstring..p.func_info(data.to, 'key', 'Data:Planet_classes/')..'<br />'
		end
		newstring = newstring..'§E花费:§!'
		if data.energy then
			newstring = newstring..'£energy'..data.energy
		end
		if data.duration then
			newstring = newstring..'£time'..data.duration
		end
		newstring = newstring..'<br /><br />'
		if data.condition_logic then
			newstring = newstring..data.condition_logic..'<br /><br />'
		end
		if data.potential_logic then
			newstring = newstring..data.potential_logic
		end
		if data.effect and data.effect.from and data.effect.from.remove_modifier == 'terraforming_candidate' then
			newstring = newstring..'<br /><br />§H改造完成后会移除"地貌改造候选"星球修正§!'
		end
		newstring = newstring..'<div>--------------</div>'
		if data.ai_weight_logic then
			newstring = newstring..data.ai_weight_logic
		end
	elseif data.main_category == 'ship_behaviors' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px">'
			..p.item_tip(data)
			..'</span><br />§L'
			..data.en_name
			..'§!<br />'
		newstring = newstring..'§L'..data.zhcn_desc..'§!<br /><br />'
		if data.preferred_attack_range then
			newstring = newstring..'最佳攻击距离:§Y'
			if data.preferred_attack_range == 'max' then
				newstring = newstring..'最大射程'
			elseif data.preferred_attack_range == 'median' then
				newstring = newstring..'中位射程'
			else
				newstring = newstring..data.preferred_attack_range
			end
			newstring = newstring..'§!<br />'
		end
		if data.formation_distance then
			newstring = newstring..'编队距离:§Y'..data.formation_distance..'§!<br />'
		end
		if data.return_to_formation_distance then
			newstring = newstring..'返回编队距离:§Y'..data.return_to_formation_distance..'§!<br />'
		end
		if data.collision_radius then
			newstring = newstring..'碰撞半径:§Y'..data.collision_radius..'§!<br />'
		end
		if data.collision_strafe then
			newstring = newstring..'碰撞惩罚:§Y'..data.collision_strafe..'§!<br />'
		end
		if data.collision_awareness then
			newstring = newstring..'碰撞意识:§Y'..data.collision_awareness..'§!<br />'
		end
		if data.attack_move_pattern then
			newstring = newstring..'主动模式:§Y'
			if data.attack_move_pattern == 'none' then
				newstring = newstring..'无'
			elseif data.attack_move_pattern == 'charge' then
				newstring = newstring..'冲锋'
			elseif data.attack_move_pattern == 'orbit' then
				newstring = newstring..'环绕'
			elseif data.attack_move_pattern == 'stay_at_range' then
				newstring = newstring..'远程狙击'
			elseif data.attack_move_pattern == 'stationary' then
				newstring = newstring..'固定'
			elseif data.attack_move_pattern == 'flee' then
				newstring = newstring..'逃跑'
			else
				newstring = newstring..data.attack_move_pattern
			end
			newstring = newstring..'§!<br />'
		end
		if data.passive_move_pattern then
			newstring = newstring..'被动模式:§Y'
			if data.passive_move_pattern == 'none' then
				newstring = newstring..'无'
			elseif data.passive_move_pattern == 'charge' then
				newstring = newstring..'冲锋'
			elseif data.passive_move_pattern == 'orbit' then
				newstring = newstring..'环绕'
			elseif data.passive_move_pattern == 'stay_at_range' then
				newstring = newstring..'远程狙击'
			elseif data.passive_move_pattern == 'stationary' then
				newstring = newstring..'固定'
			elseif data.passive_move_pattern == 'flee' then
				newstring = newstring..'逃跑'
			else
				newstring = newstring..data.passive_move_pattern
			end
			newstring = newstring..'§!<br />'
		end
		if data.combat_target_anchor == 'root' then
			newstring = newstring..'战斗位置计算点:§Y舰队旗舰§!<br />'
		end
		if data.source_target_anchor_factor then
			newstring = newstring..'战斗距离系数:§Y'..data.source_target_anchor_factor..'§!<br />'
		end
		if data.ignore_combat_movement == 'yes' then
			newstring = newstring..'§G该模式将忽视战斗继续之前的指令§!<br />'
		end
	elseif data.main_category == 'personalities' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px">'
			..p.item_tip(data)
			..'<br />§L'
			..data.en_name
			..'§!</span><br />'
		if data.zhcn_desc then
			newstring = newstring..'§L'..data.zhcn_desc..'§!<br /><div>--------------</div>'
		end
		if data.zhcn_behaviour then
			newstring = newstring..'§L'..data.zhcn_behaviour..'§!<br /><div>--------------</div>'
		end
		newstring = newstring..'§E属性修正:§!<br />'
			..'§L侵略性:§!§Y'..(data.aggressiveness or '0')..'§!<br />'
			..'§L贸易意愿:§!§Y'..(data.trade_willingness or '0')..'§!<br />'
			..'§L勇气:§!§Y'..(data.bravery or '0')..'§!<br />'
			..'§L战斗勇气:§!§Y'..(data.combat_bravery or '0')..'§!<br />'
			..'§L军事开销:§!§Y'..(data.military_spending or '0')..'§!<br />'
			..'§L殖民开销:§!§Y'..(data.colony_spending or '0')..'§!<br />'
			..'§L威胁修正:§!§Y'..(data.threat_modifier or '0')..'§!<br />'
			..'§L威胁其他人修正:§!§Y'..(data.threat_others_modifier or '0')..'§!<br />'
			..'§L边境摩擦修正:§!§Y'..(data.friction_modifier or '0')..'§!<br />'
			..'§L宣称修正:§!§Y'..(data.claims_modifier or '0')..'§!<br />'
			..'§L优势开局几率:§!§Y'..(data.advanced_start_chance or '0')..'§!<br />'
			..'<div>--------------</div>§E外交修正:§!<br />'
			..'§L联邦接受度:§!§Y'..(data.federation_acceptance or '0')..'§!<br />'
			..'§L互不侵犯条约接受度:§!§Y'..(data.nap_acceptance or '0')..'§!<br />'
			..'§L移民条约接受度:§!§Y'..(data.migration_pact_acceptance or '0')..'§!<br />'
			..'§L共同防御条约接受度:§!§Y'..(data.defensive_pact_acceptance or '0')..'§!<br />'
			..'<div>--------------</div>'
		if data.zhcn_weapon then
			newstring = newstring
				..'§E舰船选择修正:§!<br />'
				..'§L武器偏好:§!§Y'..(data.zhcn_weapon or '采用特殊设计')..'§!<br />'
				..'§L装甲比重:§!§Y'..(data.armor_ratio or '0')..'§!<br />'
				..'§L护盾比重:§!§Y'..(data.shields_ratio or '0')..'§!<br />'
				..'§L船体比重:§!§Y'..(data.hull_ratio or '0')..'§!<br />'
		else
			newstring = newstring..'§E舰船选择修正:§!采用特殊全局舰船设计(§GGlobal Ship Design§!)<br />'
		end
		newstring = newstring..'<div>--------------</div>'
		if data.allow_logic then
			newstring = newstring..data.allow_logic..'<br />'
		end
		if data.weight_modifier_logic then
			newstring = newstring..data.weight_modifier_logic
		end
	elseif data.main_category == 'governments' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px">'
			..p.item_tip(data)
			..'<br />§L'
			..data.en_name
			..'§!</span><br />'
		if data.zhcn_desc then
			newstring = newstring..'§L'..data.zhcn_desc..'§!<br /><div>--------------</div>'
		end
		if data.ruler_title_desc then
			if data.ruler_title_female_desc then
				newstring = newstring..'§E统治者头衔(♂):§!'..data.ruler_title_desc..'<br />'
			else
				newstring = newstring..'§E统治者头衔:§!'..data.ruler_title_desc..'<br />'
			end
		end
		if data.ruler_title_female_desc then
			newstring = newstring..'§E统治者头衔(♀):§!'..data.ruler_title_female_desc..'<br />'
		end
		if data.heir_title_desc then
			newstring = newstring..'§E继承人头衔(♂):§!'..data.heir_title_desc..'<br />'
		end
		if data.heir_title_female_desc then
			newstring = newstring..'§E继承人头衔(♀):§!'..data.heir_title_female_desc..'<br />'
		end
		if data.leader_class_desc then
			newstring = newstring..'§E统治者阶级:§!'..data.leader_class_desc..'<br />'
		end
		if data.use_regnal_names == 'yes' then
			newstring = newstring..'§H使用帝王名字§!<br />'
		end
		if data.dynastic_last_names == 'yes' then
			newstring = newstring..'§H使用王朝姓氏§!<br />'
		end
		if data.should_force_rename == 'yes' then
			newstring = newstring..'§H系统强制改名§!<br />'
		end
		newstring = newstring..'<div>--------------</div>'
		if data.weight_logic then
			newstring = newstring..data.weight_logic..'<br />'
		end
		if data.possible_desc then
			newstring = newstring..data.possible_desc
		end
	elseif data.main_category == 'planet_classes' then
		newstring='<div style="padding:0px 0px 0px 0px;color:#fff;width:566px;height:620px;list-style: none;font-size: 14px; border: 0px solid #14796c;position:relative">'
			..'<div style="position:absolute;left:0px;top:-46px;display:inline">[[文件:'
			..(data.picture or data.key)
			..'_sky_view.png|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]</div><div style="position:absolute;left:0px;top:-46px;display:inline">[[文件:planet_view_box.png|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]'
			..'<div style="position:absolute;left:23px;top:50px">'
			..'<div class="huiji-tt" data-type="planet_classes" data-name="'
			..data.key
			..'" style="display:inline">[[文件:'
			..(data.icon or data.key)
			..'.png|'
			..data.zhcn_name
			..'|29px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="margin-left:12px">'
			..p.item_tip(data)
			..'('
			..data.en_name
			..')</span></div>'
			..'<div style="position:absolute;left:-10px;top:240px;display:inline;height:35px;width:190px">'
			..'<div style="text-align:center">'
		if data.star == 'yes' then
			newstring = newstring..'恒星'
		elseif data.colonizable == 'yes' then
			if data.ideal == 'yes' then
				if data.ringworld == 'yes' then
					newstring = newstring..'§B理想宜居环世界§!'
				elseif data.habitat == 'yes' then
					newstring = newstring..'§B理想宜居栖息地§!'
				else
					newstring = newstring..'§B理想可宜居行星§!'
				end
			else
				newstring = newstring..'§G可宜居行星§!'
				if data.climate_desc then
					newstring = newstring..data.climate_desc
				end
			end
		else
			if data.ringworld == 'yes' then
				newstring = newstring..'§H不可居住环世界§!'
			elseif data.habitat == 'yes' then
				newstring = newstring..'§H不可居住栖息地§!'
			else
				newstring = newstring..'§H不可居住行星§!'
			end
		end
		newstring = newstring..'</div></div>'
		if data.atmosphere_color then
			newstring = newstring
			..'<div style="position:absolute;left:-10px;top:282px;display:inline;height:35px;width:190px">'
			..'<div style="text-align:center">大气颜色:#'
			..data.atmosphere_color
			..'</div></div>'
		end
		if data.habitable_odds then
			newstring = newstring
			..'<div style="position:absolute;left:-10px;top:324px;display:inline;height:35px;width:190px">'
			..'<div style="text-align:center">'
			..data.habitable_odds
			..'</div></div>'
		end
		newstring = newstring
			..'<div style="position:absolute;left:349px;top:240px;width:170px">'
			..data.desc_detail
			..'</div><div style="position:absolute;left:24px;top:370px;width:470px">'
			..data.zhcn_desc
	 
		newstring = newstring..'</div></div></div>'
	elseif data.main_category == 'planet_modifiers' then	
		newstring = newstring
			..'" style="display:inline-block;position:relative">[[文件:'
			..(data.icon or data.key)
			..'.png|'
			..data.zhcn_name
			..'|60px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]<span style="position:absolute;left:0px;top:0px">[[文件:icon_frame_'
			..(data.icon_frame or '2')
			..'.png|'
			..data.zhcn_name
			..'|60px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]'
			..'</span><span style="padding:8px 0px 0px 12px">'
			..p.item_tip(data)
			..'</span><br /><span style="margin-left:72px">§L'
			..data.en_name
			..'§!</span></span><br /><br />'
			..data.zhcn_modifier
			..'<div>--------------</div>§L'
			..data.zhcn_desc
			..'§!<div>--------------</div>'
			..data.spawn_chance_logic
	elseif data.main_category == 'deposits' then	
		newstring = newstring
			..'" style="display:inline-block">§H'
			..data.zhcn_name
			..'§!</span><br />[[Item:'
			..data.main_category
			..'/'
			..data.key
			..'|'
			..data.key
			..']]<br /><br />'
		if data.zhcn_station then
			newstring=newstring..'轨道采集需要§H'..data.zhcn_station..'§!<br />'
		end
		if data.is_orbital_slot == 'no' then
			newstring = newstring..'§R非轨道资源站点§!<br />'
		end
		if data.orbital_weight_logic then
			newstring = newstring..'<div>--------------</div>'
				..data.orbital_weight_logic
				..'<br />'
		end
		if data.drop_weight_logic then
			newstring = newstring..'<div>--------------</div>'
				..data.drop_weight_logic
				..'<br />'
		end
	elseif data.main_category == 'civics' then
		newstring = newstring
			..common_title(data, 29)
		if data.zhcn_desc~='' then
			newstring=newstring..data.zhcn_desc
			..'<br />'
		end
		if data.zhcn_modifier then
			newstring = newstring..'<br />§E效果:§!<br />'..data.zhcn_modifier..'<br /><br />'
		end
		if data.possible_desc then
			newstring = newstring
			..data.possible_desc
			..'<br />'
		end
		if data.modification == 'no' then
			newstring = newstring
			..'<br />§H这个国家理念在游戏开始后不能被添加或删除。§!'
			..'<br />'
		end
		if data.potential_logic then
			newstring = newstring..'<div>--------------</div>'
			..data.potential_logic
		end
		if data.random_weight_logic then
			newstring = newstring..'<div>--------------</div>'
			..data.random_weight_logic
		end
	elseif data.main_category == 'strategic_resources' then
		newstring = newstring
			..common_title(data, 29)
		if data.zhcn_desc~='' then
			newstring=newstring..data.zhcn_desc
			..'<br /><br />'
		end
		if data.zhcn_modifier then
			newstring = newstring..'§E效果:§!<br />'..data.zhcn_modifier..'<br />'
		end
		if data.AI_category then
			newstring = newstring..'§E资源分类:§!'..data.zhcn_AI_category..'<br />'
		end
		if data.max then
			newstring = newstring..'§E初始上限:§!'..data.max..'<br />'
		end
		if data.base_income then
			newstring = newstring..'§E基础收入:§!'..data.base_income..'<br />'
		end
		if data.prerequisites then
			newstring = newstring.. '§E前置科技:§!'
			for _,item in ipairs(data.prerequisites) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Technology/')..'<br />'
			end
		end
		newstring = newstring..'<br />'
		if data.capital_building_resource == 'yes' then
			newstring = newstring.. '▲§G是首府建筑资源§!<br />'
		end
		if data.is_rare == 'yes' then
			newstring = newstring.. '▲§M稀有资源§!<br />'
		end
		if data.is_global == 'yes' then
			newstring = newstring.. '▲§G全国生效§!<br />'
		end
		if data.is_planet_local == 'yes' then
			newstring = newstring.. '▲§G星球当地资源§!<br />'
		end
		if data.accumulative == 'yes' then
			newstring = newstring.. '▲§G可累积§!<br />'
		else
			newstring = newstring.. '△§R不可累积§!<br />'
		end
		if data.collect_if_wrong_building == 'no' then
			newstring = newstring.. '△§R错误建筑无法收集该资源§!<br />'
		end
		if data.accumulated_by_sectors == 'yes' then
			newstring = newstring.. '▲§G星区可累积§!<br />'
		else
			newstring = newstring.. '△§R星区不可累积§!<br />'
		end
		if data.tradable == 'yes' then
			newstring = newstring.. '▲§G可交易§!<br />'
		else
			newstring = newstring.. '△§R不可交易§!<br />'
		end
		if data.sector_ignore_cost == 'yes' then
			newstring = newstring.. '▲§G星区建设忽略该资源的消耗§!<br />'
		end
		if data.is_affected_by_war_exhaustion == 'yes' then
			newstring = newstring.. '△§R该资源满厌战度时无收入§!<br />'
		end
	elseif data.main_category == 'traditions' then
		newstring = newstring
			..common_title(data, 45)
		if data.zhcn_desc then
			newstring = newstring..data.zhcn_desc..'<br /><br />'
		end
		if data.zhcn_modifier then
			newstring = newstring..data.zhcn_modifier..'<br /><br />'
		end
		if data.ai_weight_logic then
			newstring = newstring..data.ai_weight_logic
		end
		if data.tradition_swap then
			for _, item in ipairs(data.tradition_swap) do
				newstring = newstring
					..'<div>--------------</div><div>§G替换传统§!</div><div style="margin-left:41px">[[文件:'
				if item.inherit_icon == 'yes' then
					newstring = newstring..(data.icon or data.key)
				else
					newstring = newstring..(item.icon or item.name)
				end
				newstring = newstring
					..'.png|'
					..item.zhcn_name
					..'|45px|link=Item:'
					..data.main_category
					..'/'
					..data.key
					..']]<span style="margin-left:12px">[[Item:'
					..data.main_category
					..'/'
					..data.key
					..'|'
					..item.zhcn_name
					..']]</span><br /><span style="margin-left:57px">§L'
					..item.en_name
					..'§!</span><br />'
					..(item.zhcn_desc or data.zhcn_desc)
					..'<br />'
				if item.inherit_effects == 'yes' then
					newstring = newstring..'§G继承原来传统的效果§!<br />'
				end
				if item.trigger_logic then
					newstring = newstring..item.trigger_logic..'<br />'
				end
				if item.weight_logic then
					newstring = newstring..item.weight_logic..'<br />'
				end
				newstring = newstring..'</div>'
			end
		end
	elseif data.main_category == 'buildings' then
		newstring = newstring
			..'" style="display:inline-block;margin-bottom:12px;width:332px;position:relative"><span style="position:absolute;left:-20px;top:0px;width:100px">[[文件:'
			..(data.icon or data.key)
			..'.png|'
			..data.zhcn_name
			..'|98px|link=Item:'
			..data.main_category
			..'/'
			..data.key
			..']]</span><span style="position:absolute;left:90px;top:26px;width:232px">'
			..p.item_tip(data)
			..'<br />§L'
			..data.en_name
			..'§!</span></span><br /><span style="display:inline-block;margin-top:90px;position:relative">'
		if data.cost_string or data.base_buildtime then
			newstring = newstring..'花费:§H'
			if data.cost_string then
				newstring = newstring..data.cost_string
			end
			if data.base_buildtime then
				newstring = newstring..'£time'..data.base_buildtime
			end
			newstring = newstring..'§!<br />'
		end
		if data.required_resources_string then
			newstring = newstring..'维护费:§H'..data.required_resources_string..'§!<br />'
		end
		if data.empire_unique == 'yes' then
			newstring = newstring..'帝国唯一<br />'
		end
		if data.planet_unique == 'yes' then
			newstring = newstring..'星球唯一<br />'
		end
		if data.defense_armies then
			newstring = newstring..'提供§H'..data.defense_armies..'§!只卫戍部队<br />'
		end
		if data.produced_resources_string then
			newstring = newstring..'生产:§H'..data.produced_resources_string..'§!<br />'
		end
		if data.adjacency_bonus_string then
			newstring = newstring..'毗邻效应:<br /><div style="padding-left:14px">'..data.produced_resources_string..'</div>'
		end
		if data.zhcn_country_modifier then
			newstring = newstring..'帝国修正:<br /><div style="padding-left:14px">'..data.zhcn_country_modifier..'</div>'
		end
		if data.zhcn_planet_modifier then
			newstring = newstring..'行星修正:<br /><div style="padding-left:14px">'..data.zhcn_planet_modifier..'</div>'
		end
		if data.zhcn_army_modifier then
			newstring = newstring..'部队修正:<br /><div style="padding-left:14px">'..data.zhcn_army_modifier..'</div>'
		end
		if data.produced_resource_trigger_logic then
			newstring = newstring..'<div>--------------</div>'..data.produced_resource_trigger_logic
		end
		if data.zhcn_desc then
			newstring = newstring..'<div>--------------</div>§L'..data.zhcn_desc..'§!'
		end
		newstring = newstring..'<div>--------------</div>'
		if data.prerequisites or data.upgrades then
			if data.prerequisites then
				newstring = newstring..'前置科技:<br /><div style="padding-left:14px">'
				for _, item in ipairs(data.prerequisites) do
					newstring = newstring..p.func_info(item, 'key', 'Data:Technology/')..'<br />'
				end
				newstring = newstring..'</div><br />'
			end
			if data.upgrades then
				newstring = newstring..'可用升级:<br /><div style="padding-left:14px">'
				for _, item in ipairs(data.upgrades) do
					newstring = newstring..p.func_info(item, 'key', 'Data:Buildings/')..'<br />'
				end
				newstring = newstring..'</div><br />'
			end
			newstring = newstring..'<div>--------------</div>'
		end
		if data.capital == 'yes' then
			newstring = newstring..'£trigger_yes是首府建筑<br />'
		end
		if data.level then
			newstring = newstring..'等级:§H'..data.level..'§!<br />'
		end
		if data.is_listed == 'no' then
			newstring = newstring..'£trigger_no不在建筑列表中<br />'
		else
			newstring = newstring..'£trigger_yes在建筑列表中<br />'
		end
		if data.ai_replace == 'no' then
			newstring = newstring..'£trigger_noAI不会拆除该建筑<br />'
		end
		if data.immune_to_bombardment == 'yes' then
			newstring = newstring..'£trigger_yes对轨道轰炸免疫<br />'
		end
		if data.protects_from_bombardment == 'yes' then
			newstring = newstring..'£trigger_yes保护军队免受轨道轰炸<br />'
		end
		if data.planetary_ftl_inhibitor == 'yes' then
			newstring = newstring..'£trigger_yes提供超光速抑制<br />'
		end
		if data.event_building == 'yes' then
			newstring = newstring..'£trigger_yes事件建筑<br />'
		end
		if data.requires_pop == 'no' then
			newstring = newstring..'£trigger_no不需要人口维护<br />'
		end
		if data.can_demolish == 'no' then
			newstring = newstring..'£trigger_no不能拆除<br />'
		end
		if data.active_logics then
			newstring = newstring..data.active_logics..'<br />'
		end
		newstring = newstring..'<div>--------------</div>'
		if data.show_tech_unlock_if_logic then
			newstring = newstring..data.show_tech_unlock_if_logic..'<br />'
		end
		if data.potential_logic then
			newstring = newstring..data.potential_logic..'<br />'
		end
		if data.allow_logic then
			newstring = newstring..data.allow_logic..'<br />'
		end
		if data.destroy_if_logic then
			newstring = newstring..data.destroy_if_logic..'<br />'
		end
		if data.ai_allow_logic then
			newstring = newstring..data.ai_allow_logic..'<br />'
		end
		if data.ai_weight_logic then
			newstring = newstring..data.ai_weight_logic..'<br />'
		end
	 
		newstring = newstring..'</span>'
	elseif data.main_category == 'technology' then
		newstring = newstring
			..common_title(data, 52)
		if data.zhcn_modifier then
			newstring = newstring..data.zhcn_modifier..'<br /><br />'
		end
		if data.area then
			newstring = newstring..'§E领域§!:'
			if data.area == 'physics' then
				newstring = newstring..'§E物理学§!'
			elseif data.area == 'society' then
				newstring = newstring..'§G社会学§!'
			elseif data.area == 'engineering' then
				newstring = newstring..'§H工程学§!'
			end
			newstring = newstring..'<br />'
		end
		if data.zhcn_category then
			newstring = newstring..'§E分类§!:[[文件:leader_trait_expertise_'
				..data.category
				..'.png|20px|link=]]'
				..data.zhcn_category..'<br />'
		end
		if data.weight_groups then
			for _, item in ipairs(data.weight_groups) do
				newstring = newstring..'§E分组§!:'
				if item == 'repeatable' then
					newstring = newstring..'循环科技<br />'
				elseif item == 'tile_blockers' then
					newstring = newstring..'地块障碍<br />'
				else
					newstring = newstring..data.weight_groups..'<br />'
				end
			end
		end
		if data.tier == '0' then
			newstring = newstring..'§G起始科技§!,无花费'..'<br />'
		elseif data.cost then
			newstring = newstring..'§E花费§!:§G'..data.cost..'§!(基础)'
			if data.cost_per_level then
				newstring = newstring..' + §H'..data.cost_per_level..'§!(每级)'
			end
			newstring = newstring..'<br />'
		end
		if data.levels == '-1' or ((not data.levels) and data.weight_groups == 'repeatable') then
			newstring = newstring..'§E循环上限§!:∞<br />'
		elseif data.levels then
			newstring = newstring..'§E循环上限§!:'..data.levels..'<br />'
		end
		if data.tier then
			newstring = newstring..'§E科技等级§!:'..data.tier..'<br />'
		end
		if data.is_dangerous == 'yes' then
			newstring = newstring..'§R危险科技§!'..'<br />'
		end
		if data.is_rare == 'yes' then
			newstring = newstring..'§M稀有科技§!'..'<br />'
		end
		if data.is_reverse_engineerable == 'yes' then
			newstring = newstring..'§G可逆向科技§!'..'<br />'
			elseif data.is_reverse_engineerable == 'no' then
			newstring = newstring..'§R不可逆向科技§!'..'<br />'
		end
		if data.ai_update_type == 'all' then
			newstring = newstring..'§H升级类型§!:全部<br />'
		elseif data.ai_update_type then
			newstring = newstring..'§H升级类型§!:'..data.ai_update_type..'<br />'
		end
		if data.prerequisites then
			newstring = newstring..'前置科技:<div style="padding-left:14px">'
			for _, item in ipairs(data.prerequisites) do
				newstring = newstring..p.func_info(item, 'key', 'Data:Technology/')..'<br />'
			end
			newstring = newstring..'</div><br />'
		end
		if data.zhcn_desc then
			newstring = newstring..'<div>--------------</div>§L'..data.zhcn_desc..'§!<br />'
		end
		newstring = newstring..'<div>--------------</div>'
		if data.weight then
			newstring = newstring..'§E基础权重:§!'..data.weight..'<br />'
		end
		if data.mod_weight_if_group_picked then
			newstring = newstring..'§E同组科技已选取时权重系数:§!'
			if data.mod_weight_if_group_picked.repeatable then
				newstring = newstring..data.mod_weight_if_group_picked.repeatable
			elseif data.mod_weight_if_group_picked.tile_blockers then
				newstring = newstring..data.mod_weight_if_group_picked.tile_blockers
			end
			newstring = newstring..'<br />'
		end		
		if data.potential_logic then
			newstring = newstring..data.potential_logic..'<br />'
		end	
		if data.weight_modifier_logic then
			newstring = newstring..data.weight_modifier_logic..'<br />'
		end
		if data.ai_weight_logic then
			newstring = newstring..data.ai_weight_logic
		end
	else
		newstring = '<div>错误:该模板尚不支持'..data.key..'(主分类为:'..data.main_category..')'
	end
	local ver = versions()
	if data.version ~=  ver[1] then
		newstring = newstring.. '<div>--------------</div>§R该项目已经被移除游戏或未被更新<br />最后更新的版本为:'..data.version..'§!<br />(§G当前最新版本:'..ver[1]..'§!)'
	end
	newstring = newstring..'</div>'
	return newstring
end

-- 星球和地块,Tiles
function p.tile_detail(frame)
	local frame_args = getArgs(frame)
	local tile_html = mw.html.create()
	if #frame_args ~= 1 then
		local tile_table_html = tile_html:tag('table'):addClass('wikitable')
			:cssText('background:#222;color:#fff;list-style: none;font-size: 14px; border: 2px solid #14796c;')
		tile_table_html:tag('tr')
		tile_table_html:tag('td'):wikitext('星球类型'):cssText('width: 160px')
		tile_table_html:tag('td'):wikitext('地块样式'):cssText('width: 520px')
		for _, name in ipairs(frame_args) do
			result = p.query_data(name, 'key', 'Data:Planet_classes/')
			if #result == 1 then
				local tile = {}
				tile_table_html:tag('tr')
				tile_table_html:tag('td'):wikitext(p.func_info_result(result))
				for i =1,4,1 do
					tile[i] = '[[File:'..(result[1].tile_set or name)..'_'..i..'.png|link=]]'
				end
				tile_queue = tile[4]..tile[1]..tile[2]..tile[3]..tile[3]..'<br/>'
					..tile[2]..tile[4]..tile[2]..tile[2]..tile[2]..'<br/>'
					..tile[1]..tile[3]..tile[4]..tile[4]..tile[3]..'<br/>'
					..tile[2]..tile[1]..tile[3]..tile[4]..tile[4]..'<br/>'
					..tile[1]..tile[1]..tile[2]..tile[1]..tile[3]
				tile_table_html:tag('td'):wikitext(tile_queue)
			end
		end
		tile_table_html:done()
	end
	return tostring(tile_html)
end

-- AI性格表
function p.personality_table(frame)
	local frame_args = getArgs(frame)
	local key = frame_args[1] or 'modifiers'
	local result = p.query_data('personalities', 'main_category', 'Data:Personalities/')
	local html = mw.html.create()

	local table_html = html:tag('table'):addClass('wikitable sortable'):cssText(tooltip_style)
	if key == 'modifiers' then
		table_html:tag('tr')
			:tag('th'):wikitext(''):cssText('width: 160px'):done()
			:tag('th'):wikitext('{{tooltip|AG|侵略性}}'):done()
			:tag('th'):wikitext('{{tooltip|TW|贸易意愿}}'):done()
			:tag('th'):wikitext('{{tooltip|BR|勇气}}'):done()
			:tag('th'):wikitext('{{tooltip|CB|战斗勇气}}'):done()
			:tag('th'):wikitext('{{tooltip|MS|军事开销}}'):done()
			:tag('th'):wikitext('{{tooltip|CS|殖民开销}}'):done()
			:tag('th'):wikitext('{{tooltip|TM|威胁修正}}'):done()
			:tag('th'):wikitext('{{tooltip|TO|威胁其他人修正}}'):done()
			:tag('th'):wikitext('{{tooltip|FM|边境摩擦修正}}'):done()
			:tag('th'):wikitext('{{tooltip|CM|宣称修正}}'):done()
			:tag('th'):wikitext('{{tooltip|AS|优势开局几率}}'):done()
			:tag('th'):wikitext('{{tooltip|FA|联邦接受度}}'):done()
			:tag('th'):wikitext('{{tooltip|NA|互不侵犯条约接受度}}'):done()
			:tag('th'):wikitext('{{tooltip|DP|移民条约接受度}}'):done()
			:tag('th'):wikitext('{{tooltip|MP|共同防御条约接受度}}'):done()
			:tag('th'):wikitext('[[文件:damage.png|武器偏好|20px|link=]]'):done()
			:tag('th'):wikitext('[[文件:armor.png|装甲比重|20px|link=]]'):done()
			:tag('th'):wikitext('[[文件:shield.png|护盾比重|20px|link=]]'):done()
			:tag('th'):wikitext('[[文件:hit_points.png|船体比重|20px|link=]]'):done()
		for _, data in ipairs(result) do
			if data.weapon_preferences == 'weapon_type_energy' then
				wp = '[[文件:combat_stat_damage_energy.png|能量|28px|link=]]'
			elseif data.weapon_preferences == 'weapon_type_kinetic' then
				wp = '[[文件:combat_stat_damage_kinetic.png|动能|28px|link=]]'
			elseif data.weapon_preferences == 'weapon_type_explosive' then
				wp = '[[文件:combat_stat_damage_explosive.png|炸药|28px|link=]]'
			elseif data.weapon_preferences == 'weapon_type_strike_craft' then
				wp = '[[文件:combat_stat_damage_strike_craft.png|舰载机|28px|link=]]'
			else
				wp = '[[文件:combat_stat_damage_shields.png|定制|28px|link=]]'
			end
			table_html:tag('tr')
				:tag('td'):wikitext('{{Info3|'..data.key..'}}'):done()
				:tag('td'):wikitext(data.aggressiveness):done()
				:tag('td'):wikitext(data.trade_willingness):done()
				:tag('td'):wikitext(data.bravery):done()
				:tag('td'):wikitext(data.combat_bravery):done()
				:tag('td'):wikitext(data.military_spending):done()
				:tag('td'):wikitext(data.colony_spending):done()
				:tag('td'):wikitext(data.threat_modifier):done()
				:tag('td'):wikitext(data.threat_others_modifier):done()
				:tag('td'):wikitext(data.friction_modifier):done()
				:tag('td'):wikitext(data.claims_modifier):done()
				:tag('td'):wikitext(data.advanced_start_chance):done()
				:tag('td'):wikitext(data.federation_acceptance):done()
				:tag('td'):wikitext(data.nap_acceptance):done()
				:tag('td'):wikitext(data.defensive_pact_acceptance):done()
				:tag('td'):wikitext(data.migration_pact_acceptance):done()
				:tag('td'):wikitext(wp):done()
				:tag('td'):wikitext(data.armor_ratio):done()
				:tag('td'):wikitext(data.shields_ratio):done()
				:tag('td'):wikitext(data.hull_ratio):done()
		end
	elseif key == 'behaviour' then 
		table_html:tag('tr')
			:tag('th'):wikitext(''):cssText('width: 160px'):done()
			:tag('th'):wikitext('{{tooltip|CQ|征服者}}'):done()
			:tag('th'):wikitext('{{tooltip|SJ|四海臣服}}'):done()
			:tag('th'):wikitext('{{tooltip|LB|解放者}}'):done()
			:tag('th'):wikitext('{{tooltip|OP|机会主义者}}'):done()
			:tag('th'):wikitext('{{tooltip|SL|奴隶主}}'):done()
			:tag('th'):wikitext('{{tooltip|CS|阶序制度}}'):done()
			:tag('th'):wikitext('{{tooltip|UL|提升者}}'):done()
			:tag('th'):wikitext('{{tooltip|PG|灭绝者}}'):done()
			:tag('th'):wikitext('{{tooltip|DP|迁移者}}'):done()
			:tag('th'):wikitext('{{tooltip|IF|渗透者}}'):done()
			:tag('th'):wikitext('{{tooltip|DM|主宰}}'):done()
			:tag('th'):wikitext('{{tooltip|RE|机械奴役者}}'):done()
			:tag('th'):wikitext('{{tooltip|RL|机械解放者}}'):done()
			:tag('th'):wikitext('{{tooltip|PP|传播者}}'):done()
			:tag('th'):wikitext('{{tooltip|MS|多种族者}}'):done()
			:tag('th'):wikitext('{{tooltip|CF|危机斗士}}'):done()
			:tag('th'):wikitext('{{tooltip|CL|危机斗士领导者}}'):done()
			:tag('th'):wikitext('{{tooltip|WT|想要贸易}}'):done()
			:tag('th'):wikitext('{{tooltip|AN|攻击中立势力}}'):done()
			:tag('th'):wikitext('{{tooltip|DC|颓败}}'):done()
			-- :tag('th'):wikitext('{{tooltip|IS|孤立主义}}'):done()
			-- :tag('th'):wikitext('{{tooltip|HP|重视圣地}}'):done()
			-- :tag('th'):wikitext('{{tooltip|DB|需要边界缓冲区}}'):done()
			-- :tag('th'):wikitext('{{tooltip|EN|神秘态度}}'):done()
			-- :tag('th'):wikitext('{{tooltip|CT|监护者}}'):done()
			-- :tag('th'):wikitext('{{tooltip|LM|限制}}'):done()
			-- :tag('th'):wikitext('{{tooltip|BS|狂暴}}'):done()
		trigger_yes = '[[文件:Trigger_yes.png|link=]]'
		trigger_no = '[[文件:Trigger_no.png|link=]]'
		for _, data in ipairs(result) do
			if data.weapon_preferences == 'weapon_type_energy' then
				wp = '[[文件:combat_stat_damage_energy.png|能量|28px|link=]]'
			elseif data.weapon_preferences == 'weapon_type_kinetic' then
				wp = '[[文件:combat_stat_damage_kinetic.png|动能|28px|link=]]'
			elseif data.weapon_preferences == 'weapon_type_explosive' then
				wp = '[[文件:combat_stat_damage_explosive.png|炸药|28px|link=]]'
			elseif data.weapon_preferences == 'weapon_type_strike_craft' then
				wp = '[[文件:combat_stat_damage_strike_craft.png|舰载机|28px|link=]]'
			else
				wp = '[[文件:combat_stat_damage_shields.png|定制|28px|link=]]'
			end
			table_html:tag('tr')
				:tag('td'):wikitext('{{Info3|'..data.key..'}}'):done()
				:tag('td'):wikitext(data.behaviour.conqueror == 'yes' and trigger_yes or (data.behaviour.conqueror and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.subjugator == 'yes' and trigger_yes or (data.behaviour.subjugator and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.liberator == 'yes' and trigger_yes or (data.behaviour.liberator and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.opportunist == 'yes' and trigger_yes or (data.behaviour.opportunist and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.slaver == 'yes' and trigger_yes or (data.behaviour.slaver and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.caste_system == 'yes' and trigger_yes or (data.behaviour.caste_system and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.uplifter == 'yes' and trigger_yes or (data.behaviour.uplifter and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.purger == 'yes' and trigger_yes or (data.behaviour.purger and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.displacer == 'yes' and trigger_yes or (data.behaviour.displacer and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.infiltrator == 'yes' and trigger_yes or (data.behaviour.infiltrator and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.dominator == 'yes' and trigger_yes or (data.behaviour.dominator and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.robot_exploiter == 'yes' and trigger_yes or (data.behaviour.robot_exploiter and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.robot_liberator == 'yes' and trigger_yes or (data.behaviour.robot_liberator and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.propagator == 'yes' and trigger_yes or (data.behaviour.propagator and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.multispecies == 'yes' and trigger_yes or (data.behaviour.multispecies and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.crisis_fighter == 'yes' and trigger_yes or (data.behaviour.crisis_fighter and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.crisis_leader == 'yes' and trigger_yes or (data.behaviour.crisis_leader and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.wants_tribute == 'yes' and trigger_yes or (data.behaviour.wants_tribute and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.attack_neutrals == 'yes' and trigger_yes or (data.behaviour.attack_neutrals and trigger_no or nil)):done()
				:tag('td'):wikitext(data.behaviour.decadent == 'yes' and trigger_yes or (data.behaviour.decadent and trigger_no or nil)):done()
				-- :tag('td'):wikitext(data.behaviour.isolationist == 'yes' and trigger_yes or (data.behaviour.isolationist and trigger_no or nil)):done()
				-- :tag('td'):wikitext(data.behaviour.holy_planets == 'yes' and trigger_yes or (data.behaviour.holy_planets and trigger_no or nil)):done()
				-- :tag('td'):wikitext(data.behaviour.demands_clear_borders == 'yes' and trigger_yes or (data.behaviour.demands_clear_borders and trigger_no or nil)):done()
				-- :tag('td'):wikitext(data.behaviour.enigmatic == 'yes' and trigger_yes or (data.behaviour.enigmatic and trigger_no or nil)):done()
				-- :tag('td'):wikitext(data.behaviour.custodian == 'yes' and trigger_yes or (data.behaviour.custodian and trigger_no or nil)):done()
				-- :tag('td'):wikitext(data.behaviour.limited == 'yes' and trigger_yes or (data.behaviour.limited and trigger_no or nil)):done()
				-- :tag('td'):wikitext(data.behaviour.berserker == 'yes' and trigger_yes or (data.behaviour.berserker and trigger_no or nil)):done()
		end
	end
	table_html:done()
	return frame:preprocess(tostring(html))
end

-- 直接dump数据
function p.output_query(frame)
	return mw.dumpObject(p.query_data(frame, 'Data:'))
end

return p
0.0
0人评价
avatar