打开主菜单
首页
随机
登录
设置
关于Stardew Valley Wiki
免责声明
Stardew Valley Wiki
搜索
查看“模块:Calcedibility”的源代码
←
模块:Calcedibility
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您没有权限编辑
模块
名字空间内的页面。
您可以查看和复制此页面的源代码。
local p = {} --ceh = calculate edibility (energy/health) function p.ce(frame) local item = string.lower(frame.args.im) local edibility = tonumber(frame.args.ed) local quality = tonumber(frame.args.q) local ulang = string.upper(frame.args.ll) local result, formattedresult, temp, length if edibility == 0 then return 0 end if item == "energy" then result = math.floor(math.ceil(edibility*2.5) + edibility*quality) else result = math.floor(math.floor(math.ceil(edibility*2.5) + edibility*quality)*0.45) end formattedresult = mw.language.getContentLanguage():formatNum(result) if ((result < 1000) or (ulang ~= "ES")) then return formattedresult end --replace space with dot --Problem: ES doesn't add a space for 4 digits, only for 5+ if (result < 10000) then length = #(tostring(result)) temp = string.sub(tostring(result), -3) return string.sub(tostring(result), 1, (length-3)) .. "." .. temp else temp = {mw.ustring.gsub(tostring(formattedresult), "%s" , ".")} return temp[1] end end return p
该页面使用的模板:
模块:Calcedibility/doc
(
查看源代码
)
返回至
模块:Calcedibility
。