68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
...
129
130
131
132
133
134
135
136
137
138
139
140
141
142
...
144
145
146
147
148
149
150
151
152
153
154
155
156
157
...
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
if not metal.no_armor then for a,c in pairs(armors) do
sorcery.matreg.lookup[(metal.items and metal.items[a]) or ('sorcery:' .. a .. '_' .. name)] = {
metal = true;
id = name; data = metal;
value = c.cost * fragments_per_ingot;
}
end end
sorcery.data.metallookup[ingot] = {
id = name; data = metal;
value = fragments_per_ingot;
}
sorcery.data.metallookup[block] = {
id = name; data = metal;
value = fragments_per_ingot * 9;
}
sorcery.data.metallookup[fragment] = {
id = name; data = metal;
value = 1;
}
sorcery.data.metallookup[disc] = {
id = name; data = metal;
value = 8/3;
}
if not metal.no_craftables then
sorcery.data.metallookup[screw] = {
id = name; data = metal;
value = 0.5;
}
minetest.register_craftitem(screw, {
description = sorcery.lib.str.capitalize(name) .. ' Screw';
inventory_image = sorcery.lib.image('sorcery_screw.png'):multiply(sorcery.lib.color(metal.tone)):render();
groups = { metal = 1; sorcery_screw = 1; sorcery_tech_component = 1; };
_sorcery = {
material = {
id = name, data = metal;
................................................................................
grindcost = 3;
grindvalue = 2*4;
value = 4 * (2/3);
};
};
})
sorcery.lathe.register {
input = ingot, mass = 2;
output = {name = disc, count = 3};
tech = 'cut', cost = 5;
}
sorcery.lathe.register {
input = block;
................................................................................
leftover = ingot;
tech = 'cut', cost = 5*7;
}
minetest.register_craftitem(powder, {
description = sorcery.lib.str.capitalize(name) .. ' Powder';
inventory_image = 'sorcery_' .. name .. '_powder.png';
})
if metal.dye then
minetest.register_craft {
output = 'dye:' .. metal.dye .. ' 4';
recipe = {
{'', powder, ''};
{powder,'basic_materials:paraffin',powder};
................................................................................
type = 'cooking';
recipe = ingot;
cooktime = (metal.cooktime or 4) * 0.5;
output = fragment .. ' ' .. tostring(fragments_per_ingot);
}
do local rec = {}
for i=1,fragments_per_ingot do
rec[#rec+1]=fragment
end
minetest.register_craft {
type = 'shapeless';
recipe = rec;
output = ingot;
}
end
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
<
<
<
<
<
>
>
>
>
>
>
>
>
>
>
>
|
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
...
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
...
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
...
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
if not metal.no_armor then for a,c in pairs(armors) do
sorcery.matreg.lookup[(metal.items and metal.items[a]) or ('sorcery:' .. a .. '_' .. name)] = {
metal = true;
id = name; data = metal;
value = c.cost * fragments_per_ingot;
}
end end
local install = function(part,amt)
sorcery.data.metallookup[part] = { id = name, data = metal, value = amt }
end
install(ingot, fragments_per_ingot)
install(block, fragments_per_ingot*9)
install(fragment, 1)
install(powder, 1)
install(disc, 8/3)
if not metal.no_craftables then
install(screw, 0.5)
minetest.register_craftitem(screw, {
description = sorcery.lib.str.capitalize(name) .. ' Screw';
inventory_image = sorcery.lib.image('sorcery_screw.png'):multiply(sorcery.lib.color(metal.tone)):render();
groups = { metal = 1; sorcery_screw = 1; sorcery_tech_component = 1; };
_sorcery = {
material = {
id = name, data = metal;
................................................................................
grindcost = 3;
grindvalue = 2*4;
value = 4 * (2/3);
};
};
})
sorcery.lathe.register {
input = ingot;
output = {name = fragment; count = fragments_per_ingot};
tech = 'cut', cost = 2;
}
sorcery.lathe.register {
input = block;
output = {name = fragment; count = fragments_per_ingot*9};
tech = 'cut', cost = 2*7;
}
sorcery.lathe.register {
input = ingot, mass = 2;
output = {name = disc, count = 3};
tech = 'cut', cost = 5;
}
sorcery.lathe.register {
input = block;
................................................................................
leftover = ingot;
tech = 'cut', cost = 5*7;
}
minetest.register_craftitem(powder, {
description = sorcery.lib.str.capitalize(name) .. ' Powder';
inventory_image = 'sorcery_' .. name .. '_powder.png';
groups = {sorcery_powder = 1; powder = 1};
})
if metal.dye then
minetest.register_craft {
output = 'dye:' .. metal.dye .. ' 4';
recipe = {
{'', powder, ''};
{powder,'basic_materials:paraffin',powder};
................................................................................
type = 'cooking';
recipe = ingot;
cooktime = (metal.cooktime or 4) * 0.5;
output = fragment .. ' ' .. tostring(fragments_per_ingot);
}
do local rec = {}
for i=1,fragments_per_ingot do
rec[#rec+1]=fragment
end
minetest.register_craft {
type = 'shapeless';
recipe = rec;
output = ingot;
}
end
|