欢迎大家来到环行旅舍(克莱因舍)WIKI!本WIKI交流群:587477551
本WIKI正在建设中,欢迎大家一起参与WIKI的建设,可以参考编辑教程BWIKI编辑教程

「人类无知的时代已经过去,一场变革之风将在薰然的曙光里盘旋而上。是扬帆还是止舵,该由你决定了。」

——欢迎来到「克莱因舍」
全站通知:

模块:技能数值计算

来自环行旅舍WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索

其他人
文本为 文本 等级为2 计算结果:文本
文本为 300% 等级为0 计算结果:300%
文本为 300% 等级为1 计算结果:330%
文本为 300% 等级为2 计算结果:360%
文本为 300 等级为3 计算结果:390

极乐
文本为 文本 等级为2 计算结果:文本
文本为 50%*0.2 等级为0 计算结果:50%
文本为 50%*0.2 等级为1 计算结果:60%
文本为 50%*0.2 等级为2 计算结果:70%
文本为 50%*0.2 等级为3 计算结果:80%


local p = {}

function parseArgument(frame)
    local arg = {}
    return arg
end

p["calculate"] = function(frame)
    local baseText = frame.args["baseText"]
    local level = tonumber(frame.args["level"]) or 1
    local base
    local multi = 0.1
    local per = false
    local color = false

    if string.find(baseText, "*") then
        base, multi = string.match(baseText, "(.-)%s*%*%s*(.+)")
    else
        base = baseText
    end

    if string.sub(base, -1) == "%" then
        per = true
        base = string.sub(base, 1, -2)
    end

    if frame.args["颜色"] == "红" then
        color = true
    end

    if tonumber(base) == nil then
        return baseText
    else
        local output = tonumber(base) + tonumber(base) * tonumber(multi) * level
        if per then
            output = output .. "%"
        end
        if color then
            output = '<span style="color:#F88789;">' .. output .. '</span>'
        end
        return output
    end
end

return p