10번째 줄: |
10번째 줄: |
| local quality = tonumber(frame.args.q) | | local quality = tonumber(frame.args.q) |
| local profmult = tonumber(frame.args.pm) | | local profmult = tonumber(frame.args.pm) |
− | local ulang = string.upper(frame.args.ll)
| |
| local toFormatOrNotToFormat = string.lower(frame.args.fm) | | local toFormatOrNotToFormat = string.lower(frame.args.fm) |
| | | |
33번째 줄: |
32번째 줄: |
| elseif ((item == "jelly") or (item == "pickles")) then | | elseif ((item == "jelly") or (item == "pickles")) then |
| artisanprice = (50 + (baseprice * 2)) | | artisanprice = (50 + (baseprice * 2)) |
− | elseif (item == "roe") then
| |
− | artisanprice = (30 + math.floor(baseprice / 2))
| |
− | elseif (item == "aged roe") then
| |
− | artisanprice = (2 * (30 + math.floor(baseprice / 2)))
| |
| elseif (item == "honey") then | | elseif (item == "honey") then |
| --This is a hack that works only because | | --This is a hack that works only because |
45번째 줄: |
40번째 줄: |
| artisanprice = 100 | | artisanprice = 100 |
| end | | end |
− | elseif (item == "pale ale") then artisanprice = 300 | + | elseif (string.find(item, "aged roe") ~= nil) then |
| + | artisanprice = (2 * (30 + math.floor(baseprice / 2))) |
| + | elseif (string.find(item, "roe") ~= nil) then |
| + | artisanprice = (30 + math.floor(baseprice / 2)) |
| + | --[[elseif (item == "pale ale") then artisanprice = 300 |
| elseif ((item == "beer") or (item == "mead")) then artisanprice = 200 | | elseif ((item == "beer") or (item == "mead")) then artisanprice = 200 |
| elseif (item == "green tea") then artisanprice = 100 | | elseif (item == "green tea") then artisanprice = 100 |
− | --[[elseif (item == "caviar") then artisanprice = 500 | + | elseif (item == "caviar") then artisanprice = 500 |
| elseif (item == "cheese") then artisanprice = 230 | | elseif (item == "cheese") then artisanprice = 230 |
| elseif (item == "goat cheese") then artisanprice = 400 | | elseif (item == "goat cheese") then artisanprice = 400 |
66번째 줄: |
65번째 줄: |
| | | |
| local formattedSum = mw.language.getContentLanguage():formatNum(sum) | | local formattedSum = mw.language.getContentLanguage():formatNum(sum) |
| + | local ulang = string.upper(mw.language.getContentLanguage():getCode()) |
| | | |
| if ulang == "DE" then return formattedSum .. " G" | | if ulang == "DE" then return formattedSum .. " G" |
− | elseif (ulang == "EN" or ulang == "HU" or ulang == "TR") then | + | elseif (ulang == "EN" or ulang == "JA" or ulang == "HU" or ulang == "TR") then |
| return formattedSum .. "g" | | return formattedSum .. "g" |
− | elseif ulang == "ES" then return formattedSum .. "[[File:Gold.png|18px|link=]]" | + | elseif ulang == "ES" then |
| + | if (sum < 1000) then return formattedSum .. "[[File:Gold.png|18px|link=]]" |
| + | elseif (sum < 10000) then |
| + | local length = #(tostring(sum)) |
| + | local temp = string.sub(tostring(sum), -3) |
| + | return string.sub(tostring(sum), 1, (length-3)) .. "." .. temp .. "[[File:Gold.png|18px|link=]]" |
| + | else |
| + | local temp = {mw.ustring.gsub(tostring(formattedSum), "%s" , ".")} |
| + | return temp[1] .. "[[File:Gold.png|18px|link=]]" |
| + | end |
| elseif ulang == "FR" then return formattedSum .. "po" | | elseif ulang == "FR" then return formattedSum .. "po" |
| elseif ulang == "IT" then return formattedSum .. "o" | | elseif ulang == "IT" then return formattedSum .. "o" |