sorcery  Diff

Differences From Artifact [110ec2eec9]:

  • File leylines.lua — part of check-in [3f6a913e4e] at 2020-09-29 12:40:28 on branch trunk — * remove former hacky registration system, replace with consistent and flexible API; rewrite metal/gem generation to take advantage of this new API; tweaks to init system to enable world-local tweaks to lore and sorcery behavior * initial documentation commit * initial steps towards calendar - add default date format, astrolabe; prepare infra for division/melding/transmutation spells, various tweaks and fixes (user: lexi, size: 25805) [annotate] [blame] [check-ins using]

To Artifact [3c460c3a0d]:


376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
...
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
...
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
	local function find(positions)
		local searchnext = {}
		for _,pos in pairs(positions) do
			for _,p in pairs(sorcery.ley.txofs) do
				local sum = vector.add(pos,p)
				if not foundp(sum) then
					checked[#checked + 1] = sum
					local nodename = minetest.get_node(sum).name
					if nodename == 'ignore' then
						minetest.load_area(sum)
						nodename = minetest.get_node(sum).name
					end
					if minetest.get_item_group(nodename,'sorcery_ley_device') ~= 0
					   or sorcery.data.compat.ley[nodename] then
						local d = sorcery.ley.sample(pos,1,nodename,{query={mode=true}})
						assert(d.mode == 'signal'
						    or d.mode == 'consume'
						    or d.mode == 'produce')
						devices[d.mode][#(devices[d.mode]) + 1] = {
................................................................................
			maxpower = obj.maxpower / 10000.0;
			power = (obj.minpower == obj.maxpower) and obj.minpower or nil;
			affinity = affs;
		}
	end
end
sorcery.ley.setnode = function(pos,l)
	local meta = minetest.get_node(pos)
	meta:set_string('sorcery:ley',sorcery.ley.encode(l))
end

sorcery.ley.sample = function(pos,timespan,name,flags)
	-- returns how much ley-force can be transmitted by a
	-- device over timespan
	local ret = {}
................................................................................
		end;
		after_dig_node = sorcery.lib.node.purge_container;
		on_metadata_inventory_put = update_generator;
		on_metadata_inventory_take = update_generator;
		on_timer = function(pos,delta)
			local meta = minetest.get_meta(pos)
			local inv = meta:get_inventory()
			local self = minetest.get_node(pos)
			local timeleft = meta:get_float('burnleft') - delta
			local again = false
			local power = meta:get_float('power')
			local burning = active
			if timeleft < 0 then timeleft = 0 end
			if not active or timeleft == 0 then
				if inv:is_empty('fuel') then







|
<
<
<
<







 







|







 







|







376
377
378
379
380
381
382
383




384
385
386
387
388
389
390
...
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
...
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
	local function find(positions)
		local searchnext = {}
		for _,pos in pairs(positions) do
			for _,p in pairs(sorcery.ley.txofs) do
				local sum = vector.add(pos,p)
				if not foundp(sum) then
					checked[#checked + 1] = sum
					local nodename = sorcery.lib.node.force(sum).name




					if minetest.get_item_group(nodename,'sorcery_ley_device') ~= 0
					   or sorcery.data.compat.ley[nodename] then
						local d = sorcery.ley.sample(pos,1,nodename,{query={mode=true}})
						assert(d.mode == 'signal'
						    or d.mode == 'consume'
						    or d.mode == 'produce')
						devices[d.mode][#(devices[d.mode]) + 1] = {
................................................................................
			maxpower = obj.maxpower / 10000.0;
			power = (obj.minpower == obj.maxpower) and obj.minpower or nil;
			affinity = affs;
		}
	end
end
sorcery.ley.setnode = function(pos,l)
	local meta = minetest.get_meta(pos)
	meta:set_string('sorcery:ley',sorcery.ley.encode(l))
end

sorcery.ley.sample = function(pos,timespan,name,flags)
	-- returns how much ley-force can be transmitted by a
	-- device over timespan
	local ret = {}
................................................................................
		end;
		after_dig_node = sorcery.lib.node.purge_container;
		on_metadata_inventory_put = update_generator;
		on_metadata_inventory_take = update_generator;
		on_timer = function(pos,delta)
			local meta = minetest.get_meta(pos)
			local inv = meta:get_inventory()
			local self = sorcery.lib.node.force(pos)
			local timeleft = meta:get_float('burnleft') - delta
			local again = false
			local power = meta:get_float('power')
			local burning = active
			if timeleft < 0 then timeleft = 0 end
			if not active or timeleft == 0 then
				if inv:is_empty('fuel') then