sorcery  Diff

Differences From Artifact [461d75b6c5]:

To Artifact [67735ebab8]:


     1      1   --- gemstones
            2  +local shards_per_gem = 9
     2      3   
     3      4   sorcery.register_gem = function(name,gem)
     4      5   	local itemname = gem.foreign or 'sorcery:gem_' .. name
     5      6   	local shardname = gem.foreign_shard or 'sorcery:gem_' .. name .. '_shard'
     6      7   	local amuletname = gem.foreign_amulet or 'sorcery:gem_' .. name .. '_amulet'
     7      8   
     8      9   	local tools, armors = sorcery.matreg.tools, sorcery.matreg.armors
     9         -	if gem.tools then for _,t in pairs(tools) do
           10  +	if gem.tools then for t,c in pairs(tools) do
    10     11   		sorcery.matreg.lookup[(gem.items and gem.items[t]) or ('sorcery:' .. t .. '_' .. name)] = {
    11     12   			gem = true;
    12     13   			id = name; data = gem;
           14  +			value = c.cost*shards_per_gem;
    13     15   		}
    14     16   	end end
    15         -	if gem.armor then for _,a in pairs(armors) do
           17  +	if gem.armor then for a,c in pairs(armors) do
    16     18   		sorcery.matreg.lookup[(gem.items and gem.items[a]) or ('sorcery:' .. a .. '_' .. name)] = {
    17     19   			gem = true;
    18     20   			id = name; data = gem;
           21  +			value = c.cost*shards_per_gem;
    19     22   		}
    20     23   	end end
    21     24   
    22     25   	if gem.foreign_shard then
    23     26   		minetest.clear_craft {output=shardname}
    24     27   	else
    25     28   		minetest.register_craftitem(shardname, {