模块

词典:修订间差异

来自卡厄思梦境WIKI

律Rhyme留言 | 贡献
创建页面,内容为“local p = {} local data = require('模块:词典/data') function p.main(frame) local args = frame:getParent().args local category = args[1] or "" local term = args[2] or "" local color = args["颜色"] or "black" local description = "" if category == "卡牌机制" then description = data.cardMechanics[term] or "未找到说明" end -- 构建HTML local html = string.format([[ <span class="dictionary-te…”
 
律Rhyme留言 | 贡献
无编辑摘要
第1行: 第1行:
local p = {}
local p = {}
local data = require('模块:词典/data')
 
local cardMechanics = {
    ["蒸发"] = "卡牌在回合结束时自动消耗",
    ["终极"] = "卡牌使用后结束当前回合",
    ["天上"] = "使用其他2费以上的卡,立即自动打出本卡",
    ["回收"] = "若此卡牌移动至弃牌堆,会回到手牌。发动效果时,移除回收",
    ["保留"] = "卡牌不会在回合结束时进入弃牌堆",
    ["唯一"] = "此卡牌无法复制",
    ["开战"] = "此卡牌在战斗开始时置于抽牌堆顶端",
    ["连击"] = "使用其他同伴的卡牌时,发动此卡牌",
    ["弱点攻击"] = "对韧性耗尽敌弱点伤害",
    ["快速"] = "使用卡牌时不会影响敌人的行动计数器",
    ["主导"] = "回合开始时,有50%的机率使本卡牌费用减少1<br>使用其他卡牌时,移除效果",
    ["储存"] = "保留费用,生效时层数减少1",
    ["金属化"] = "使用卡牌获得护盾时,对随机敌人造成80%的制伤害",
    ["消灭"] = "使用后消耗卡牌,不会进入弃牌堆,持续到战斗结束",
    ["封锁"] = "卡牌发动时不会触发效果<br>触发此卡牌后移除封锁",
    ["粉碎"] = "攻击持有护盾的目标时,伤害量+20%"
}


function p.main(frame)
function p.main(frame)
第11行: 第29行:
      
      
     if category == "卡牌机制" then
     if category == "卡牌机制" then
         description = data.cardMechanics[term] or "未找到说明"
         description = cardMechanics[term] or "未找到说明"
     end
     end
      
      

2025年10月2日 (四) 15:38的版本

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

local p = {}

local cardMechanics = {
    ["蒸发"] = "卡牌在回合结束时自动消耗",
    ["终极"] = "卡牌使用后结束当前回合",
    ["天上"] = "使用其他2费以上的卡,立即自动打出本卡",
    ["回收"] = "若此卡牌移动至弃牌堆,会回到手牌。发动效果时,移除回收",
    ["保留"] = "卡牌不会在回合结束时进入弃牌堆",
    ["唯一"] = "此卡牌无法复制",
    ["开战"] = "此卡牌在战斗开始时置于抽牌堆顶端",
    ["连击"] = "使用其他同伴的卡牌时,发动此卡牌",
    ["弱点攻击"] = "对韧性耗尽敌弱点伤害",
    ["快速"] = "使用卡牌时不会影响敌人的行动计数器",
    ["主导"] = "回合开始时,有50%的机率使本卡牌费用减少1<br>使用其他卡牌时,移除效果",
    ["储存"] = "保留费用,生效时层数减少1",
    ["金属化"] = "使用卡牌获得护盾时,对随机敌人造成80%的制伤害",
    ["消灭"] = "使用后消耗卡牌,不会进入弃牌堆,持续到战斗结束",
    ["封锁"] = "卡牌发动时不会触发效果<br>触发此卡牌后移除封锁",
    ["粉碎"] = "攻击持有护盾的目标时,伤害量+20%"
}

function p.main(frame)
    local args = frame:getParent().args
    local category = args[1] or ""
    local term = args[2] or ""
    local color = args["颜色"] or "black"
    
    local description = ""
    
    if category == "卡牌机制" then
        description = cardMechanics[term] or "未找到说明"
    end
    
    -- 构建HTML
    local html = string.format([[
<span class="dictionary-term" style="position: relative; display: inline-block;">
    <span style="color: %s; text-decoration: underline; cursor: help;">%s</span>
    <span class="dictionary-tooltip">
        <span class="dictionary-tooltip-bar"></span>
        <span class="dictionary-tooltip-content">
            <span class="dictionary-tooltip-title">%s</span><br/>
            %s
        </span>
    </span>
</span>]], color, term, term, description)
    
    return html
end

return p