58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
{lens = 'concave', gem = 'mese', dmg = 1};
{lens = 'concave', gem = 'sapphire', dmg = 1};
};
desc = 'some damage is repaired when used to mine ore or kill an attacker';
on_dig = function(ctx)
local orepfx = "stone_with_" -- }:<
-- local oredrop = ' lump'
local dug = minetest.get_node(ctx.target.under)
local barename = string.sub(dug.name, string.find(dug.name, ':') + 1)
print('is ore? ',dug.name,barename)
if minetest.get_item_group(dug.name, ore) ~= 0 or
string.sub(barename,1,string.len(orepfx)) == orepfx
then
print('is ore!')
ctx.tool:add_wear(-(sorcery.enchant.strength(ctx.tool,'harvest') * 2000))
ctx.cost = 3
end
end;
};
conserve = { -- use less magical energy
name = 'Conserve';
|
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
{lens = 'concave', gem = 'mese', dmg = 1};
{lens = 'concave', gem = 'sapphire', dmg = 1};
};
desc = 'some damage is repaired when used to mine ore or kill an attacker';
on_dig = function(ctx)
local orepfx = "stone_with_" -- }:<
-- local oredrop = ' lump'
local barename = string.sub(ctx.node.name, string.find(ctx.node.name, ':') + 1)
if minetest.get_item_group(ctx.node.name, 'ore') ~= 0 or
string.sub(barename,1,string.len(orepfx)) == orepfx
then
ctx.tool:add_wear(-(sorcery.enchant.strength(ctx.tool,'harvest') * 2000))
ctx.cost = 3
end
end;
};
conserve = { -- use less magical energy
name = 'Conserve';
|