sorcery  Diff

Differences From Artifact [b1f018643d]:

  • File lib/node.lua — part of check-in [96c5289a2a] at 2020-10-21 03:35:35 on branch trunk — add rune forges, runes, amulet frames, write sacrifice spell, touch up amulet graphics, enable enchantment of amulets (though spells cannot yet be cast), defuckulate syncresis core icon, unfuckitize sneaky leycalc bug that's probably been the cause of some long-standing wackiness, add item classes, add some more textures, disbungle various other asstastrophes, remove sneaky old debug code, improve library code, add utility for uploading merge requests (user: lexi, size: 4220) [annotate] [blame] [check-ins using]

To Artifact [5b83bf6142]:


    63     63   	offsets = ofs;
    64     64   	purge_container = function(...) return purge_container(nil, ...) end;
    65     65   	purge_only = function(lst)
    66     66   		return function(...)
    67     67   			return purge_container(lst, ...)
    68     68   		end
    69     69   	end; 
           70  +
           71  +	is_air = function(pos)
           72  +		local n = sorcery.lib.node.force(pos)
           73  +		if n.name == 'air' then return true end
           74  +		local d = minetest.registered_nodes[n.name]
           75  +		if not d then return false end
           76  +		return not d.walkable
           77  +	end;
           78  +
           79  +	get_arrival_point = function(pos)
           80  +		local air = sorcery.lib.node.is_air
           81  +		if air(pos) then
           82  +			local n = {x=0,y=1,z=0}
           83  +			if air(vector.add(pos,n)) then return pos end
           84  +			local down = vector.subtract(pos,n)
           85  +			if air(down) then return down end
           86  +		else return nil end
           87  +	end;
    70     88   
    71     89   	amass = function(startpoint,names,directions)
    72     90   		if not directions then directions = ofs.neighbors end
    73     91   		local nodes, positions, checked = {},{},{}
    74     92   		local checkedp = function(pos)
    75     93   			for _,v in pairs(checked) do
    76     94   				if vector.equals(pos,v) then return true end