sorcery  Diff

Differences From Artifact [a4fa9f9b09]:

To Artifact [0b54227d82]:


52
53
54
55
56
57
58

59
60
61
62
63
64
65
...
102
103
104
105
106
107
108




109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128

129
130
131
132
133
134
135
...
142
143
144
145
146
147
148




149
150

151
152
153
154
155
156
157
...
201
202
203
204
205
206
207




208
209
210
211

212
213
214
215
216
217
218
...
236
237
238
239
240
241
242




243
244
245
246

247

248
249
250
251
252
253
254
255

256
257
258
259
260
261
262
...
302
303
304
305
306
307
308

309
310


sorcery.register_oil = function(name,label,desc,color,imgvariant,extra)
	local image = 'xdecor_bowl.png^(sorcery_oil_' .. (imgvariant or 'dull') .. '.png^[colorize:'..tostring(color)..':140)'
	sorcery.register.residue.link('sorcery:' .. name, 'xdecor:bowl')
	extra.description = label;
	extra.inventory_image = image;
	if not extra.groups then extra.groups = {} end

	minetest.register_craftitem('sorcery:' .. name, extra)
end

sorcery.register_potion('blood', 'Blood', 'A bottle of sacrificial blood, imbued with stolen (or perhaps donated) life force', u.color(219,19,14), nil, nil, {
	_sorcery = {
		life_store = 4;
		container = {
................................................................................
			output = 'sorcery:' .. id;
			_proto = proto;
		}
	end
end

-- for n,v in pairs(sorcery.data.potions) do




sorcery.register.potions.foreach('sorcery:mknodes',{},function(n,v)
	local color = u.color(v.color)
	local kind = v.style
	local glow = v.glow
	local id = 'potion_' .. string.lower(n)
	local desc = 'A ' .. ((glow and 'glowing ') or '') ..
		'bottle of ' .. string.lower(n) .. 
		((kind == 'sparkle' and ', fiercely bubbling') or '') ..
		' liquid'
	local fullname = n .. ' Potion'
	sorcery.register.liquid.link('sorcery:'..id, {
		name = 'Serene Potion';
		color = v.color;
		proto = v;
		kind = 'sorcery:potion';
		measure = function(amt) return string.format('%s draughts', amt / 3) end;
		containers = {
			['vessels:glass_bottle'] = 'sorcery:' .. id;
		};
	})

	sorcery.register_potion(id, fullname, desc, color, kind, glow, {
		groups = {
			sorcery_potion = 1;
			sorcery_magical = 1;
		};
		_proto = v;
		_sorcery = {
................................................................................
			};
		};
	})
	create_infusion_recipe(id,v,'sorcery:potion_serene',{data=v,name=fullname})
end)

-- for n,potion in pairs(sorcery.data.draughts) do




sorcery.register.draughts.foreach('sorcery:mknodes',{},function(n,potion)
	local name = 'draught_' .. n

	local behavior = {
		_proto = potion;
		groups = {
			sorcery_potion = 2;
			sorcery_draught = 1;
			sorcery_magical = 1;
			sorcery_usable_magic = 1;
................................................................................
		potion.style or 'dull',
		potion.glow or 0,
		behavior)
	create_infusion_recipe(name,potion,'sorcery:potion_luminous',{data=potion,name=fullname})
end)

-- for n,elixir in pairs(sorcery.data.elixirs) do




sorcery.register.elixirs.foreach('sorcery:mknodes',{},function(n,elixir)
	local color = u.color(elixir.color)
	local id = 'elixir_' .. string.lower(n)
	local fullname = 'Elixir of ' .. n

	sorcery.register_potion(id, fullname, nil, color, 'dull', false, {
		_proto = elixir;
		groups = {
			sorcery_elixir = 1;
			sorcery_magical = 1;
		};
	})
................................................................................
	local kind = v.style
	sorcery.register_oil('grease_' .. n, u.str.capitalize(n) .. ' Grease', nil, color, kind, {
		groups = { sorcery_grease = 1 }
	})
end)

-- for n,v in pairs(sorcery.data.philters) do




sorcery.register.philters.foreach('sorcery:mknodes',{},function(n,v)
	local color = u.color(v.color)
	local id = 'philter_' .. n
	local name = v.name or u.str.capitalize(n)

	local fullname = name .. ' Philter'

	sorcery.register_potion(id, fullname, v.desc, color, 'sparkle',v.glow or 4, {
		_proto = v;
		_protoname = n;
		groups = {
			sorcery_magical = 1;
			sorcery_philter = 1;
		};
	})

	create_infusion_recipe(id,v,'sorcery:potion_viscous',{data=v,name=fullname})
end)

-- for n,v in pairs(sorcery.data.extracts) do
sorcery.register.extracts.foreach('sorcery:mknodes',{},function(n,v)
	local item = v[1]
	local color = u.color(v[2])
................................................................................
				{"farming:mortar_pestle", "farming:mortar_pestle"};
			};
		}
	end
	-- need a relatively pure alcohol for this, tho other alcohols can be used
	-- for potionmaking in other ways
	add_alcohol('farming:bottle_ethanol')

	add_alcohol('wine:glass_vodka')
end)








>







 







>
>
>
>











|








>







 







>
>
>
>


>







 







>
>
>
>




>







 







>
>
>
>




>

>








>







 







>
|
|
>
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
...
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
...
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
...
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
...
325
326
327
328
329
330
331
332
333
334
335

sorcery.register_oil = function(name,label,desc,color,imgvariant,extra)
	local image = 'xdecor_bowl.png^(sorcery_oil_' .. (imgvariant or 'dull') .. '.png^[colorize:'..tostring(color)..':140)'
	sorcery.register.residue.link('sorcery:' .. name, 'xdecor:bowl')
	extra.description = label;
	extra.inventory_image = image;
	if not extra.groups then extra.groups = {} end
	extra.groups.sorcery_oil = 1
	minetest.register_craftitem('sorcery:' .. name, extra)
end

sorcery.register_potion('blood', 'Blood', 'A bottle of sacrificial blood, imbued with stolen (or perhaps donated) life force', u.color(219,19,14), nil, nil, {
	_sorcery = {
		life_store = 4;
		container = {
................................................................................
			output = 'sorcery:' .. id;
			_proto = proto;
		}
	end
end

-- for n,v in pairs(sorcery.data.potions) do
local kind_potion = {
	label = 'Potion';
	kind = 'A mystical liquid crucial to the art of alchemy';
}
sorcery.register.potions.foreach('sorcery:mknodes',{},function(n,v)
	local color = u.color(v.color)
	local kind = v.style
	local glow = v.glow
	local id = 'potion_' .. string.lower(n)
	local desc = 'A ' .. ((glow and 'glowing ') or '') ..
		'bottle of ' .. string.lower(n) .. 
		((kind == 'sparkle' and ', fiercely bubbling') or '') ..
		' liquid'
	local fullname = n .. ' Potion'
	sorcery.register.liquid.link('sorcery:'..id, {
		name = fullname;
		color = v.color;
		proto = v;
		kind = 'sorcery:potion';
		measure = function(amt) return string.format('%s draughts', amt / 3) end;
		containers = {
			['vessels:glass_bottle'] = 'sorcery:' .. id;
		};
	})
	v.kind = kind_potion;
	sorcery.register_potion(id, fullname, desc, color, kind, glow, {
		groups = {
			sorcery_potion = 1;
			sorcery_magical = 1;
		};
		_proto = v;
		_sorcery = {
................................................................................
			};
		};
	})
	create_infusion_recipe(id,v,'sorcery:potion_serene',{data=v,name=fullname})
end)

-- for n,potion in pairs(sorcery.data.draughts) do
local kind_draught = {
	label = 'Draught';
	desc = 'A drink that will suffuse your body and spirit with mystic energies';
}
sorcery.register.draughts.foreach('sorcery:mknodes',{},function(n,potion)
	local name = 'draught_' .. n
	potion.kind = kind_draught
	local behavior = {
		_proto = potion;
		groups = {
			sorcery_potion = 2;
			sorcery_draught = 1;
			sorcery_magical = 1;
			sorcery_usable_magic = 1;
................................................................................
		potion.style or 'dull',
		potion.glow or 0,
		behavior)
	create_infusion_recipe(name,potion,'sorcery:potion_luminous',{data=potion,name=fullname})
end)

-- for n,elixir in pairs(sorcery.data.elixirs) do
local kind_elixir = {
	label = 'Elixir';
	desc = 'A special kind of potion that enhances the particular qualities of other alchemical brews';
}
sorcery.register.elixirs.foreach('sorcery:mknodes',{},function(n,elixir)
	local color = u.color(elixir.color)
	local id = 'elixir_' .. string.lower(n)
	local fullname = 'Elixir of ' .. n
	elixir.kind = kind_elixir;
	sorcery.register_potion(id, fullname, nil, color, 'dull', false, {
		_proto = elixir;
		groups = {
			sorcery_elixir = 1;
			sorcery_magical = 1;
		};
	})
................................................................................
	local kind = v.style
	sorcery.register_oil('grease_' .. n, u.str.capitalize(n) .. ' Grease', nil, color, kind, {
		groups = { sorcery_grease = 1 }
	})
end)

-- for n,v in pairs(sorcery.data.philters) do
local kind_philter = {
	label = 'Philter';
	desc = 'A special kind of potion that wooden rods can be soaked in to imbue them with special powers and transform them into wands';
}
sorcery.register.philters.foreach('sorcery:mknodes',{},function(n,v)
	local color = u.color(v.color)
	local id = 'philter_' .. n
	local name = v.name or u.str.capitalize(n)
	if not v.name then v.name = name end
	local fullname = name .. ' Philter'
	v.kind = kind_philter
	sorcery.register_potion(id, fullname, v.desc, color, 'sparkle',v.glow or 4, {
		_proto = v;
		_protoname = n;
		groups = {
			sorcery_magical = 1;
			sorcery_philter = 1;
		};
	})
	v.quals = {force = true};
	create_infusion_recipe(id,v,'sorcery:potion_viscous',{data=v,name=fullname})
end)

-- for n,v in pairs(sorcery.data.extracts) do
sorcery.register.extracts.foreach('sorcery:mknodes',{},function(n,v)
	local item = v[1]
	local color = u.color(v[2])
................................................................................
				{"farming:mortar_pestle", "farming:mortar_pestle"};
			};
		}
	end
	-- need a relatively pure alcohol for this, tho other alcohols can be used
	-- for potionmaking in other ways
	add_alcohol('farming:bottle_ethanol')
	if minetest.get_modpath('wine') then
		add_alcohol('wine:glass_vodka')
	end
end)