sorcery  Diff

Differences From Artifact [993e34739f]:

To Artifact [22986aed9f]:


300
301
302
303
304
305
306
307
308
309
310
311
312
313
314

315
316
317
318
319
320
321
...
322
323
324
325
326
327
328






























329
330
331
332
333
334
335
...
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
	groups = {
		sorcery_magitech = 1;
		sorcery_tech_component = 1;
	};
})


local regtech = function(id, desc, groups, recipe, qty, replacements)
	minetest.register_craftitem('sorcery:' .. id,{
		description = desc;
		inventory_image = 'sorcery_'..id..'.png';
		groups = sorcery.lib.tbl.merge({
			sorcery_magitech = 1;
			sorcery_tech_component = 1;
		}, groups or {});

	})
	if recipe then
		minetest.register_craft {
			output = string.format('sorcery:%s %u', id, qty or 1);
			recipe = recipe;
			replacements = replacements;
		}
................................................................................
	end
end

local regcore = function(core,name)
	regtech('core_'..core, name .. ' Core', {sorcery_magitech_core = 1})
end
































regtech('field_emitter', 'Field Emitter', {metal = 1})
regtech('leyline_stabilizer', 'Leyline Stabilizer', {metal = 1})
regtech('beam_generator', 'Beam Generator', {metal = 1})
regtech('inversion_matrix', 'Inversion Matrix', {metal = 1})
regtech('inverter_coil', 'Inverter Coil', {metal = 1})
regtech('suppression_matrix', 'Suppression Matrix', {metal = 1})
................................................................................
regtech('tuning_disc', 'Tuning Disc', {metal = 1})
	-- used in constructing devices that are subject to attunement wand
regtech('gravity_manipulator', 'Gravity Manipulator', {metal = 1})
regtech('valve','Valve', {metal = 1}, {
	{'','default:bronze_ingot',''};
	{'basic_materials:plastic_sheet','basic_materials:steel_bar','basic_materials:plastic_sheet'};
	{'','default:bronze_ingot',''};
},3)
regtech('pipe','Pipe', {metal = 1}, {
	{ingot('aluminum'),'',ingot('aluminum')};
	{ingot('aluminum'),'',ingot('aluminum')};
	{ingot('aluminum'),'',ingot('aluminum')};
}, 6)

minetest.register_craft {
	output = 'sorcery:trough';
	recipe = {
		{ingot('aluminum'),'',ingot('aluminum')};
		{ingot('aluminum'),'',ingot('aluminum')};
		{ingot('aluminum'),ingot('aluminum'),ingot('aluminum')};







|







>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|




|







300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
...
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
...
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
	groups = {
		sorcery_magitech = 1;
		sorcery_tech_component = 1;
	};
})


local regtech = function(id, desc, groups, recipe, qty, replacements, props)
	minetest.register_craftitem('sorcery:' .. id,{
		description = desc;
		inventory_image = 'sorcery_'..id..'.png';
		groups = sorcery.lib.tbl.merge({
			sorcery_magitech = 1;
			sorcery_tech_component = 1;
		}, groups or {});
		_sorcery = props;
	})
	if recipe then
		minetest.register_craft {
			output = string.format('sorcery:%s %u', id, qty or 1);
			recipe = recipe;
			replacements = replacements;
		}
................................................................................
	end
end

local regcore = function(core,name)
	regtech('core_'..core, name .. ' Core', {sorcery_magitech_core = 1})
end

local mprop = function(metal, amt)
	local gc, gv
	amt = amt or 1
	if math.floor(amt) ~= amt then
		if amt < 1 then
			gc = math.floor(1 / amt)
		else
			local n = 0
			for i = 2,10 do
				if math.floor(amt * i) == amt * i then
					n = i
					break
				end
			end
			if n == 0 then error "can't determine metal value for item" end
			gc = i
			gv = amt * i
		end
	else
		gc = 1
		gv = amt
	end
	return { material = {
		metal = true; id = metal;
		data = sorcery.data.metals[metal];
		grindcost = gc;
		grindvalue = gv;
		value = amt;
	}}
end

regtech('field_emitter', 'Field Emitter', {metal = 1})
regtech('leyline_stabilizer', 'Leyline Stabilizer', {metal = 1})
regtech('beam_generator', 'Beam Generator', {metal = 1})
regtech('inversion_matrix', 'Inversion Matrix', {metal = 1})
regtech('inverter_coil', 'Inverter Coil', {metal = 1})
regtech('suppression_matrix', 'Suppression Matrix', {metal = 1})
................................................................................
regtech('tuning_disc', 'Tuning Disc', {metal = 1})
	-- used in constructing devices that are subject to attunement wand
regtech('gravity_manipulator', 'Gravity Manipulator', {metal = 1})
regtech('valve','Valve', {metal = 1}, {
	{'','default:bronze_ingot',''};
	{'basic_materials:plastic_sheet','basic_materials:steel_bar','basic_materials:plastic_sheet'};
	{'','default:bronze_ingot',''};
},3,nil, mprop('bronze',2*4,1,2*4))
regtech('pipe','Pipe', {metal = 1}, {
	{ingot('aluminum'),'',ingot('aluminum')};
	{ingot('aluminum'),'',ingot('aluminum')};
	{ingot('aluminum'),'',ingot('aluminum')};
}, 6, nil, mprop('aluminum', 4))

minetest.register_craft {
	output = 'sorcery:trough';
	recipe = {
		{ingot('aluminum'),'',ingot('aluminum')};
		{ingot('aluminum'),'',ingot('aluminum')};
		{ingot('aluminum'),ingot('aluminum'),ingot('aluminum')};