「モジュール:Calcgrangepoints」の版間の差分
ナビゲーションに移動
検索に移動
Margotbean (トーク | 投稿記録) (create) |
(相違点なし)
|
2023年3月28日 (火) 03:12時点における最新版
Description
This module calculates the Grange Display points for an item at the スターデューバレーまつり.
This module can be copy/pasted into all languages without alteration.
Please report any problems or issues with the module on the discussion page for テンプレート:Grangeptsrow.
local p = {}
function p.cgp(frame)
--Template must call Calcsellprice and send result here
local price = tonumber(frame.args.p)
--quality must be 0, 1, 2, or 4
local quality = tonumber(frame.args.q)
local totalpoints = 0
totalpoints = quality + 1
if (price >= 20) then totalpoints = totalpoints + 1 end
if (price >= 90) then totalpoints = totalpoints + 1 end
if (price >= 200) then totalpoints = totalpoints + 1 end
if (price >= 300 and quality < 2) then
totalpoints = totalpoints + 1 end
if (price >= 400 and quality < 1) then
totalpoints = totalpoints + 1 end
return totalpoints
end
return p