全站通知:
模块:Tag检索
刷
历
编
跳到导航
跳到搜索
此模块的文档可以在模块:Tag检索/doc创建
local p={}
function setDefault (t, d)
local mt = {__index = function () return d end}
setmetatable(t, mt)
end
function addToSet(set, key)
set[key] = true
end
p["事件标签"]=function(frame)
local text = frame.args["text"]
local tags = ""
local tag_table = {["体力+"]={"体力+",0},["体力-"]={"体力-",0},["やる気ダウン"]={"干劲-",0},["やる気アップ"]={"干劲+",0}
,["愛嬌○"]={"爱娇",0},["切れ者"]={"切者",0},["注目株"]={"注目株",0}
}
local debuff_table = {"夜ふかし気味", "なまけ癖", "肌あれ", "太り気味", "片頭痛",
"練習ベタ", "小さなほころび", "ガラスの脚"
}
local is_first = true
for tkey,tag in pairs(tag_table)do
mw.log(tag[1])
if string.find(text, tkey, 1, true) and tag[2] == 0 then
if is_first then
tags = tags .. tag[1]
is_first = false
else
tags = tags .. ","..tag[1]
end
tag[2] = tag[2] + 1
end
end
for _,debuff in pairs(debuff_table)do
if string.find(text, debuff, 1, true) then
if is_first then
tags = tags .. "debuff"
is_first = false
break
else
tags = tags .. ",".. "debuff"
break
end
end
end
frame:callParserFunction{name='#vardefine',args={'tags',tags}}
return
end
return p