七日内新公告:全站维护公告
  • 你好~!欢迎来到萌娘百科镜像站!如需查看或编辑,请联系本站管理员注册账号。
  • 本镜像站和其他萌娘百科的镜像站无关,请注意分别。

Module:SkillString

猛汉♂百科,万男皆可猛的百科全书!转载请标注来源页面的网页链接,并声明引自猛汉百科。内容不可商用。
跳转到导航 跳转到搜索
模块文档  [查看] [编辑] [历史] [刷新]

模板来源:*MOONCELL

local p = {}

local target_icon_class = 
{
	["自身"] = 'nptarget nptar-self',
	["己方单体"] = 'nptarget nptar-friendly',
	["己方全体"] = 'nptarget nptar-friendly-all',
	["除自身外的己方全体"] = 'nptarget nptar-friendly-all-noself',
	["敌方单体"] = 'nptarget nptar-enemy',
	["敌方全体"] = 'nptarget nptar-enemy-all',
	["获得暴击星"] = 'nptarget nptar-stars'
}

function p.target_icon(frame)
	local args = (frame == mw.getCurrentFrame() and frame.args) or frame
	
	local str_des = (args.str_des or "")
	local target_type = (args.target or "")
	
	if target_type ~= "" then
		return frame:callParserFunction('#vardefine:currentclass', target_icon_class[target_type])
	end
	
	if string.find(str_des, "己方全体") ~= nil then return frame:callParserFunction('#vardefine:currentclass', target_icon_class["己方全体"]) end
	if string.find(str_des, "自身") ~= nil then return frame:callParserFunction('#vardefine:currentclass', target_icon_class["自身"]) end
	if string.find(str_des, "获得") ~= nil and string.find(str_des, "暴击星") ~= nil then return frame:callParserFunction('#vardefine:currentclass', target_icon_class["获得暴击星"]) end
	if string.find(str_des, "敌方全体") ~= nil then return frame:callParserFunction('#vardefine:currentclass', target_icon_class["敌方全体"]) end
	if string.find(str_des, "敌方单体") ~= nil then return frame:callParserFunction('#vardefine:currentclass', target_icon_class["敌方单体"]) end
	
	return ""
end

return p