sorcery  Diff

Differences From Artifact [951d8532f1]:

To Artifact [950babc45d]:


    15     15   
    16     16   local dagger_usefn = function(selfharm)
    17     17   	return function(stack,user,pointat)
    18     18   		if (not minetest.is_player(pointat)) and
    19     19   				selfharm == false then
    20     20   			return nil
    21     21   		end
    22         -		local trough = minetest.find_node_near(user:get_position(), 2.5, 'group:sorcery_trough', true)
           22  +		local trough = minetest.find_node_near(user:get_pos(), 2.5, 'group:sorcery_trough', true)
    23     23   		if trough then
    24     24   			local cnn = minetest.get_node(trough).name
    25     25   			local ctr = minetest.registered_nodes[cnn]._sorcery
    26     26   			if (not ctr) or not ctr.container then
    27     27   				log.err('item',cnn,'is marked as a trough, but has no _sorcery.container table')
    28     28   			else
    29     29   				ctr = ctr.container
................................................................................
    73     73   		stack:add_wear(wear)
    74     74   
    75     75   		if not trough then
    76     76   			inv:remove_item('main',btl)
    77     77   			inv:add_item('main',blood)
    78     78   		else
    79     79   			local amt = selfharm and math.random(1,2) or 2
    80         -			minetest.set_node(trough.pos, {
    81         -				name = trough.def.make(def.res*amt+ctr.charge,1):get_name()
    82         -			})
           80  +			sorcery.liquid.setctr(trough.pos, 'sorcery:blood', (trough.ctr.charge or 0) + (trough.def.res*amt), true)
    83     81   		end
    84     82   
    85     83   		target:punch(user, 1.0, caps, nil)
    86     84   		sorcery.vfx.bloodburst(pos)
    87     85   
    88     86   		if math.random(3 + sorcery.enchant.strength(stack,'sanctify') * 6) == 1 then
    89     87   			-- we've used up the consecration
................................................................................
   100     98   		end
   101     99   	end
   102    100   end
   103    101   
   104    102   
   105    103   minetest.register_tool("sorcery:dagger_consecrated", {
   106    104   	description = "Consecrated Dagger",
   107         -	inventory_image = "sorcery_dagger_consecrated.png",
          105  +	inventory_image = "sorcery_dagger_consecrated.png^sorcery_dagger_glow.png",
          106  +	wield_image = "sorcery_dagger_consecrated.png",
   108    107   	tool_capabilities = {
   109    108   		full_punch_interval = 1.6,
   110    109   		max_drop_level = 1,
   111    110   		damage_groups = { fleshy = 6 },
   112    111   	},
   113    112   	sound = { breaks = "default_tool_breaks" },
   114    113   	groups = { sorcery_sanctify = 2, sword = 1 },
   115    114   	punch_attack_uses = 16,
   116    115   	on_use = dagger_usefn(false),
   117    116   	on_secondary_use = dagger_usefn(true),
   118    117   })