74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
...
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
for _, kind in pairs { 'amplifier','rectifier','concave','convex' } do
local id = 'sorcery:lens_' .. kind .. '_' .. name
minetest.register_tool(id, {
inventory_image = sorcery.lib.image('sorcery_lens_overlay_gold.png'):
blit(sorcery.lib.image('sorcery_lens_' .. kind .. '.png'):
multiply(sorcery.lib.color(gem.tone):brighten(1.1))):
render();
description = sorcery.lib.str.capitalize(name) .. ' ' .. kind .. ' lens';
groups = { sorcery_enchanting_lens = 1 };
_proto = {
gem = name;
kind = kind;
};
})
end
................................................................................
minetest.override_item(ore, {drop = newdrops})
-- might be possible to just edit it in place, since we're
-- referring to registered_nodes anyway, but i don't want
-- to chance it; god knows what's going on under the hood
end
end
if minetest.get_modpath('xdecor') then
local og = minetest.registered_tools['xdecor:hammer'].groups
og.crafttool = 1
minetest.override_item('xdecor:hammer', {groups = og})
end
minetest.register_on_craft(function(stack,crafter,recipe,grid)
local ctoolclass = {
[1] = 200;
[2] = 100;
[3] = 50;
[4] = 10;
[5] = 5;
}
for i=1,grid:get_size('craft') do
local s = grid:get_stack('craft',i)
local v = minetest.get_item_group(s:get_name(),'crafttool')
if v ~= 0 then
local dmg = 65536 / ctoolclass[v]
local tool = recipe[i]
tool:add_wear(dmg)
grid:set_stack('craft',i,tool)
end
end
return nil
end)
for g,v in pairs(sorcery.data.gems) do sorcery.register_gem(g,v) end
sorcery.gem = {
getdrops = function(fac)
items = {}
for g,v in pairs(sorcery.data.gems) do
items[#items + 1] = {
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
...
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
for _, kind in pairs { 'amplifier','rectifier','concave','convex' } do
local id = 'sorcery:lens_' .. kind .. '_' .. name
minetest.register_tool(id, {
inventory_image = sorcery.lib.image('sorcery_lens_overlay_gold.png'):
blit(sorcery.lib.image('sorcery_lens_' .. kind .. '.png'):
multiply(sorcery.lib.color(gem.tone):brighten(1.1))):
render();
description = sorcery.lib.str.capitalize(name) .. ' ' .. sorcery.lib.str.capitalize(kind) .. ' Lens';
groups = { sorcery_enchanting_lens = 1 };
_proto = {
gem = name;
kind = kind;
};
})
end
................................................................................
minetest.override_item(ore, {drop = newdrops})
-- might be possible to just edit it in place, since we're
-- referring to registered_nodes anyway, but i don't want
-- to chance it; god knows what's going on under the hood
end
end
for g,v in pairs(sorcery.data.gems) do sorcery.register_gem(g,v) end
sorcery.gem = {
getdrops = function(fac)
items = {}
for g,v in pairs(sorcery.data.gems) do
items[#items + 1] = {
|