sorcery  Diff

Differences From Artifact [2062a1f6be]:

To Artifact [41724791de]:


167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
...
263
264
265
266
267
268
269
270
271
272
273
274


275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293




294
295
296
297
298
299
300
...
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
		-- determine the power of a particular enchantment on
		-- an enchanted item.
		local e = sorcery.enchant.get(stack)
		local p = 0.0
		local slots = sorcery.matreg.lookup[stack:get_name()].data.slots
		-- TODO handle strength-boosting spells!
		for _,s in pairs(e.spells) do
			print(dump(s))
			if s.id == id then p = p + ((s.boost * slots[s.slot].confluence)/10) end
		end
		return p
	end
	sorcery.enchant.stackup = function(stack)
		-- stack update function. this should be called whenever
		-- the enchantment status of a stack changes; it will
................................................................................
minetest.register_craftitem('sorcery:enchanter_pedestal',{
	inventory_image = 'sorcery_enchanter_pedestal.png';
	description = 'Pedestal';
})
minetest.register_craft {
	output = 'sorcery:enchanter_channeler';
	recipe = {
		{'','default:bronze_ingot',''};
		{'basic_materials:gold_wire','basic_materials:steel_strip','basic_materials:gold_wire'};
		{'','sorcery:electrum_ingot',''};
	};
	replacements = {


		{'basic_materials:gold_wire','basic_materials:empty_spool'};
		{'basic_materials:gold_wire','basic_materials:empty_spool'};
	};
}
minetest.register_craft {
	output = 'sorcery:enchanter_pedestal';
	recipe = {
		{'basic_materials:copper_strip','group:wood','basic_materials:copper_strip'};
		{'','default:bronze_ingot',''};
		{'','group:wood',''};
	};
}
minetest.register_craft {
	output = 'sorcery:enchanter';
	recipe = {
		{'','sorcery:enchanter_channeler',''};
		{'sorcery:enchanter_channeler','sorcery:enchanter_pedestal','sorcery:enchanter_channeler'};
		{'group:wood','group:wood','group:wood'};
	};




}
for i=1,10 do
	minetest.register_node('sorcery:air_flash_' .. i, {
		drawtype = 'airlike';
		pointable = false; walkable = false;
		buildable_to = true;
		sunlight_propagates = true;
................................................................................
	-- replace the air with a "glow-air" that removes
	-- itself after a short period of time, to create
	-- a flash of light when an enchanted tool's used
	-- to dig out a node
	local tool = puncher:get_wielded_item()
	local ench = sorcery.enchant.get(tool)
	if #ench.spells == 0 then return end
	print('enchanted!')
	local sparks = {}
	-- local spark = function(name,color)
	local material = sorcery.enchant.getsubj(tool)
	local totalcost = 0
	do local done = {} for _,sp in pairs(ench.spells) do
		if done[sp.id] then goto skip end
		done[sp.id] = true







<







 







|




>
>








|






|



>
>
>
>







 







<







167
168
169
170
171
172
173

174
175
176
177
178
179
180
...
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
...
324
325
326
327
328
329
330

331
332
333
334
335
336
337
		-- determine the power of a particular enchantment on
		-- an enchanted item.
		local e = sorcery.enchant.get(stack)
		local p = 0.0
		local slots = sorcery.matreg.lookup[stack:get_name()].data.slots
		-- TODO handle strength-boosting spells!
		for _,s in pairs(e.spells) do

			if s.id == id then p = p + ((s.boost * slots[s.slot].confluence)/10) end
		end
		return p
	end
	sorcery.enchant.stackup = function(stack)
		-- stack update function. this should be called whenever
		-- the enchantment status of a stack changes; it will
................................................................................
minetest.register_craftitem('sorcery:enchanter_pedestal',{
	inventory_image = 'sorcery_enchanter_pedestal.png';
	description = 'Pedestal';
})
minetest.register_craft {
	output = 'sorcery:enchanter_channeler';
	recipe = {
		{'sorcery:grease_enchanting','sorcery:platinum_ingot','sorcery:grease_enchanting'};
		{'basic_materials:gold_wire','basic_materials:steel_strip','basic_materials:gold_wire'};
		{'','sorcery:electrum_ingot',''};
	};
	replacements = {
		{'sorcery:grease_enchanting','xdecor:bowl'};
		{'sorcery:grease_enchanting','xdecor:bowl'};
		{'basic_materials:gold_wire','basic_materials:empty_spool'};
		{'basic_materials:gold_wire','basic_materials:empty_spool'};
	};
}
minetest.register_craft {
	output = 'sorcery:enchanter_pedestal';
	recipe = {
		{'basic_materials:copper_strip','group:wood','basic_materials:copper_strip'};
		{'','sorcery:iridium_ingot',''};
		{'','group:wood',''};
	};
}
minetest.register_craft {
	output = 'sorcery:enchanter';
	recipe = {
		{'sorcery:grease_sealant','sorcery:enchanter_channeler','sorcery:grease_sealant'};
		{'sorcery:enchanter_channeler','sorcery:enchanter_pedestal','sorcery:enchanter_channeler'};
		{'group:wood','group:wood','group:wood'};
	};
	replacements = {
		{'sorcery:grease_sealant','xdecor:bowl'};
		{'sorcery:grease_sealant','xdecor:bowl'};
	};
}
for i=1,10 do
	minetest.register_node('sorcery:air_flash_' .. i, {
		drawtype = 'airlike';
		pointable = false; walkable = false;
		buildable_to = true;
		sunlight_propagates = true;
................................................................................
	-- replace the air with a "glow-air" that removes
	-- itself after a short period of time, to create
	-- a flash of light when an enchanted tool's used
	-- to dig out a node
	local tool = puncher:get_wielded_item()
	local ench = sorcery.enchant.get(tool)
	if #ench.spells == 0 then return end

	local sparks = {}
	-- local spark = function(name,color)
	local material = sorcery.enchant.getsubj(tool)
	local totalcost = 0
	do local done = {} for _,sp in pairs(ench.spells) do
		if done[sp.id] then goto skip end
		done[sp.id] = true