19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
...
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
...
330
331
332
333
334
335
336
337
338
339
340
341
342
343
...
348
349
350
351
352
353
354
355
|
-- factor by which wear is increased when grinding
-- above your paygrade
grind_factor = 10;
-- adjusts the amount of time it takes to grind
-- metal into powder
grind_wear = 2000;
-- amount of damage done to a grind head grinding
-- metal of equal hardness. increased or decreased
-- depending on differential
grind_torque_factor = 0.1;
-- how many points of hardness translate into how
-- much ley-current needed (per second)
................................................................................
local grind_wear = {}
local grinders_present = false
grinders_on = {false,false}
for i=1,inv:get_size('grinder') do
local gh = inv:get_stack('grinder',i)
if not gh:is_empty() then
grinders_present = true
local hh = sorcery.data.metals[gh:get_definition()._proto.metal].hardness
local dif = mp.hardness - hh
local wear
if dif == 0 then
wear = constants.grind_wear
elseif dif < 0 then
wear = constants.grind_wear * ((dif * -1)/constants.grind_range)
elseif dif > 0 then
................................................................................
recipe = {
{'basic_materials:chain_steel','basic_materials:gear_steel','basic_materials:chain_steel'};
{'basic_materials:gear_steel', 'basic_materials:steel_bar', 'basic_materials:gear_steel'};
{'default:tin_ingot','default:steelblock','default:tin_ingot'};
};
}
for name,metal in pairs(sorcery.data.metals) do
local i,f = metal.parts.ingot, metal.parts.fragment
local id = 'sorcery:mill_grindhead_' .. name
minetest.register_tool(id,{
description = sorcery.lib.str.capitalize(name) .. ' Grinding Head';
inventory_image = sorcery.lib.image('sorcery_mill_grindhead.png'):multiply(sorcery.lib.color(metal.tone)):render();
groups = { sorcery_mill_grindhead = 1, sorcery_metallurgy = 1 };
_proto = {
................................................................................
output = id;
recipe = {
{f,i,f};
{i,'',i};
{f,i,f};
};
}
end
|
|
|
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
...
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
...
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
...
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
|
-- factor by which wear is increased when grinding
-- above your paygrade
grind_factor = 10;
-- adjusts the amount of time it takes to grind
-- metal into powder
grind_wear = 1000;
-- amount of damage done to a grind head grinding
-- metal of equal hardness. increased or decreased
-- depending on differential
grind_torque_factor = 0.1;
-- how many points of hardness translate into how
-- much ley-current needed (per second)
................................................................................
local grind_wear = {}
local grinders_present = false
grinders_on = {false,false}
for i=1,inv:get_size('grinder') do
local gh = inv:get_stack('grinder',i)
if not gh:is_empty() then
grinders_present = true
local gproto = gh:get_definition()._proto
local hh = 0
if gproto.metal then
hh = sorcery.data.metals[gproto.metal].hardness
elseif gproto.gem then
hh = sorcery.data.gems[gproto.gem].hardness
end
local dif = mp.hardness - hh
local wear
if dif == 0 then
wear = constants.grind_wear
elseif dif < 0 then
wear = constants.grind_wear * ((dif * -1)/constants.grind_range)
elseif dif > 0 then
................................................................................
recipe = {
{'basic_materials:chain_steel','basic_materials:gear_steel','basic_materials:chain_steel'};
{'basic_materials:gear_steel', 'basic_materials:steel_bar', 'basic_materials:gear_steel'};
{'default:tin_ingot','default:steelblock','default:tin_ingot'};
};
}
for name,metal in pairs(sorcery.data.metals) do
if metal.no_tools and not metal.grindhead then goto skip end
local i,f = metal.parts.ingot, metal.parts.fragment
local id = 'sorcery:mill_grindhead_' .. name
minetest.register_tool(id,{
description = sorcery.lib.str.capitalize(name) .. ' Grinding Head';
inventory_image = sorcery.lib.image('sorcery_mill_grindhead.png'):multiply(sorcery.lib.color(metal.tone)):render();
groups = { sorcery_mill_grindhead = 1, sorcery_metallurgy = 1 };
_proto = {
................................................................................
output = id;
recipe = {
{f,i,f};
{i,'',i};
{f,i,f};
};
}
::skip::end
for name,gem in pairs(sorcery.data.gems) do
if not gem.tools and not gem.grindhead then goto skip end
local i,f = gem.parts.item, gem.parts.shard
local id = 'sorcery:mill_grindhead_' .. name
minetest.register_tool(id,{
description = sorcery.lib.str.capitalize(name) .. ' Grinding Head';
inventory_image = sorcery.lib.image('sorcery_mill_grindhead.png'):multiply(sorcery.lib.color(gem.tone)):render();
groups = { sorcery_mill_grindhead = 1, sorcery_metallurgy = 1 };
_proto = {
gem = name;
};
});
minetest.register_craft {
output = id;
recipe = {
{f,i,f};
{i,'',i};
{f,i,f};
};
}
::skip::end
|