sorcery  Diff

Differences From Artifact [04ca2e071b]:

To Artifact [6a40bd16e3]:


50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
...
161
162
163
164
165
166
167










168
169
170
171
172
173
174

sorcery.liquid.mktrough = function(liq)
	-- troughs are used for collecting liquid from the environment,
	-- like rainwater and tree sap. they hold twice as much as a bucket
	local Q = constants.glasses_per_bottle
	local trough_mkid = function(l,i)
		if type(l) == 'string' then l = sorcery.register.liquid.db[l] end
		if not l or not i then return 'sorcery:trough' end
		return string.format('%s:trough_%s_%u', l.mod,l.sid,i)
	end
	local lid = function(l) return trough_mkid(liq, l) end

	local M = constants.bottles_per_trough
	local mkbox = function(lvl)
		local pxl = function(tbl) -- for mapping to txcoords
................................................................................
	end
end
sorcery.liquid.mktrough()

sorcery.liquid.measure_default = function(amt)
	return string.format('%s drams', amt*constants.drams_per_glass)
end










sorcery.liquid.register = function(liq)
	local fmt = string.format
	local Q = constants.glasses_per_bottle
	liq.sid = liq.sid or liq.id:gsub('^[^:]+:','')
	liq.mod = liq.mod or liq.id:gsub('^([^:]+):.*','%1')
	if not liq.measure then
		liq.measure = sorcery.liquid.measure_default







|







 







>
>
>
>
>
>
>
>
>
>







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
...
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184

sorcery.liquid.mktrough = function(liq)
	-- troughs are used for collecting liquid from the environment,
	-- like rainwater and tree sap. they hold twice as much as a bucket
	local Q = constants.glasses_per_bottle
	local trough_mkid = function(l,i)
		if type(l) == 'string' then l = sorcery.register.liquid.db[l] end
		if (not l) or (not i) or i < 1 then return 'sorcery:trough' end
		return string.format('%s:trough_%s_%u', l.mod,l.sid,i)
	end
	local lid = function(l) return trough_mkid(liq, l) end

	local M = constants.bottles_per_trough
	local mkbox = function(lvl)
		local pxl = function(tbl) -- for mapping to txcoords
................................................................................
	end
end
sorcery.liquid.mktrough()

sorcery.liquid.measure_default = function(amt)
	return string.format('%s drams', amt*constants.drams_per_glass)
end

sorcery.liquid.container = function(liq, ctr)
	return liq.containers[({
		bottle = 'vessels:glass_bottle';
		glass = 'vessels:drinking_glass';
		keg = 'sorcery:keg';
		trough = 'sorcery:trough';
	})[ctr] or ctr]
end

sorcery.liquid.register = function(liq)
	local fmt = string.format
	local Q = constants.glasses_per_bottle
	liq.sid = liq.sid or liq.id:gsub('^[^:]+:','')
	liq.mod = liq.mod or liq.id:gsub('^([^:]+):.*','%1')
	if not liq.measure then
		liq.measure = sorcery.liquid.measure_default