80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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
|
id = name; data = metal;
value = fragments_per_ingot * 9;
}
sorcery.data.metallookup[fragment] = {
id = name; data = metal;
value = 1;
}
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;
powder = powder;
grindcost = 2, grindvalue = 1;
value = 0.5;
};
};
})
minetest.register_craftitem(disc, {
description = sorcery.lib.str.capitalize(name) .. ' Disc';
inventory_image = fmt('sorcery_disc_%s.png', name);
groups = { metal = 1; sorcery_disc = 1; sorcery_tech_component = 1; };
_sorcery = {
material = {
id = name, data = metal;
powder = powder;
grindvalue = (3*4) / 2;
value = 4 * (2/3);
};
};
})
local reglathe = function(ty, sz)
sorcery.lathe.register {
input = ty;
output = {name = screw, count = sz * 2};
tech = 'cut', cost = 1;
}
end
reglathe(fragment, 1)
reglathe(ingot, 4)
reglathe(block, 4 * 9)
sorcery.lathe.register {
input = ingot, mass = 2;
output = {name = disc, count = 3};
tech = 'cut', cost = 5;
}
sorcery.lathe.register {
input = block;
|
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
<
<
<
<
<
<
<
<
<
<
<
|
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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
136
137
138
139
140
141
142
|
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;
powder = powder;
grindcost = 2, grindvalue = 1;
value = 0.5;
};
};
})
local reglathe = function(ty, sz)
sorcery.lathe.register {
input = ty;
output = {name = screw, count = sz * 2};
tech = 'cut', cost = 1;
}
end
reglathe(fragment, 1)
reglathe(ingot, 4)
reglathe(block, 4 * 9)
end
minetest.register_craftitem(disc, {
description = sorcery.lib.str.capitalize(name) .. ' Disc';
inventory_image = fmt('sorcery_disc_%s.png', name);
groups = { metal = 1; sorcery_disc = 1; sorcery_tech_component = 1; };
_sorcery = {
material = {
id = name, data = metal;
powder = powder;
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;
|