Jump to content

Module:Calcgrangepoints

From HourGlass: The Game Wiki
Revision as of 19:08, April 5, 2025 by PolyFox (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Calcgrangepoints/doc

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
Cookies help us deliver our services. By using our services, you agree to our use of cookies.