sorcery  Diff

Differences From Artifact [41dac58ae7]:

To Artifact [a984f71f32]:


8
9
10
11
12
13
14








































15
16
17
18
19
20
21
		local dumpout = ''
		for i=1,string.len(binary) do
			dumpout = dumpout .. string.format('%x%s',string.byte(binary,i),(i%16==0 and '\n') or ' ') 
		end
		print(dumpout)
	end;
})









































-- minetest.register_chatcommand('hover', {
-- 	description = 'Test hover effect';
-- 	privs = { fly = true };
-- 	func = function(caller,params)
-- 		local player = minetest.get_player_by_name(caller)
-- 		late.new_effect(player, {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
		local dumpout = ''
		for i=1,string.len(binary) do
			dumpout = dumpout .. string.format('%x%s',string.byte(binary,i),(i%16==0 and '\n') or ' ') 
		end
		print(dumpout)
	end;
})

minetest.register_chatcommand('leynet', {
	description = 'Dump information about the ley-net in front of you';
	privs = { debug = true };
	func = function(caller,params)
		local user = minetest.get_player_by_name(caller)
		local pos = user:get_pos()
		local dir = user:get_look_dir()
		local nodes = minetest.raycast(pos,pos + (dir*5), false, false)
		for pt in nodes do
			local node = minetest.get_node(pt.under)
			if node.name ~= 'air' then
				print('mapping',pt.under,node.name)
				local n = minetest.registered_nodes[node.name]
				if minetest.get_item_group(node.name, 'sorcery_ley_device') ~= 0 then
					local l = sorcery.ley.netcaps(pt.under, 1, nil, 0)
					print('ley netcaps for pos',pt.under,dump(l))
					minetest.chat_send_player(caller, 'ley netcaps:' .. dump({
						freepower = l.freepower;
						maxpower = l.maxpower;
						self = l.self;
						devs = l.net.devices.consume;
					}))
					break
				end
			end
		end
	end;
})


minetest.register_chatcommand('leyline', {
	description = 'See details about local ley force';
	privs = { debug = true };
	func = function(caller,params)
		local pos = minetest.get_player_by_name(caller):get_pos()
		local ley = sorcery.ley.estimate(pos)
		minetest.chat_send_player(caller, 'Leyline force ' .. tostring(ley.force) .. ' with affinities ' .. table.concat(ley.aff, ','))
	end;
})

-- minetest.register_chatcommand('hover', {
-- 	description = 'Test hover effect';
-- 	privs = { fly = true };
-- 	func = function(caller,params)
-- 		local player = minetest.get_player_by_name(caller)
-- 		late.new_effect(player, {