sorcery  Diff

Differences From Artifact [d9755d7797]:

To Artifact [58885d2bb0]:


    56     56   		local img = sorcery.lib.image
    57     57   		local img_stone = img('sorcery_amulet.png'):multiply(sorcery.lib.color(gem.tone))
    58     58   		local img_sparkle = img('sorcery_amulet_sparkle.png')
    59     59   		local useamulet = function(stack,user,target)
    60     60   			local sp = sorcery.amulet.getspell(stack)
    61     61   			if not sp or not sp.cast then return nil end
    62     62   			local stats = sorcery.amulet.stats(stack)
           63  +			local probe = sorcery.spell.probe(user:get_pos())
           64  +			-- amulets don't work in antimagic fields, though some may want to 
           65  +			-- implement this logic themselves (for instance to check a range)
           66  +			if (probe.disjunction and not sp.ignore_disjunction) then return nil end
    63     67   
    64     68   			local ctx = {
    65     69   				caster = user;
    66     70   				target = target;
    67     71   				stats = stats;
    68     72   				amulet = stack;
    69     73   				meta = stack:get_meta(); -- avoid spell boilerplate
    70     74   				color = sorcery.lib.color(sp.tone);
    71     75   				today = minetest.get_day_count();
           76  +				probe = probe;
    72     77   				heading = {
    73     78   					pos   = user:get_pos();
    74     79   					yaw   = user:get_look_dir();
    75     80   					pitch = user:get_look_vertical();
    76     81   					angle = user:get_look_horizontal();
    77     82   					eyeheight = user:get_properties().eye_height;
    78     83   				};