sorcery  Diff

Differences From Artifact [2261aac8b4]:

To Artifact [9e257faffc]:


     3      3   	age = u.marshal.t.u32;
     4      4   	lastemit = u.marshal.t.u32;
     5      5   }
     6      6   
     7      7   minetest.register_entity('sorcery:spell_projectile_flamebolt',{
     8      8   	initial_properties = {
     9      9   		visual = "sprite";
    10         -        -- use_texture_alpha = true;
           10  +        use_texture_alpha = true;
    11     11   		textures = {'sorcery_fireball.png'};
    12         -		groups = {immortal = 1};
    13     12   		visual_size = { x = 2, y = 2, z = 2 };
    14     13   		physical = true;
    15     14   		collide_with_objects = true;
    16     15   		pointable = false;
    17     16   		glow = 14;
    18     17   		static_save = false;
           18  +		shaded = false;
    19     19   	};
           20  +	on_activate = function(self)
           21  +		self.object:set_armor_groups{immortal = 1}
           22  +	end;
    20     23   	on_step = function(self,dtime,collision)
    21     24   		local pos = self.object:get_pos()
    22     25   		if not self._meta then
    23     26   			self._meta = { age = 0; lastemit = 0; emitters = {} }
    24     27   			goto emit
    25     28   		end
    26     29   
    27     30   		self._meta.age = self._meta.age + dtime
    28     31   		if self._meta.age >= 6 then
    29     32   			goto destroy
    30     33   		elseif (self._meta.age - self._meta.lastemit) < 3 then
    31     34   			goto collcheck
    32     35   		end
           36  +
           37  +		-- fireballs dissipate when entering antimagic fields
           38  +		do local probe = sorcery.spell.probe(self.object:get_pos())
           39  +		if probe.disjunction and not self._meta.ignore_disjunction then
           40  +			sorcery.vfx.cast_sparkle(nil,sorcery.lib.color(255,90,10),3,0.3,self.object:get_pos())
           41  +			goto destroy
           42  +		end end
    33     43   		
    34     44   		::emit:: do
    35     45   			self._meta.lastemit = self._meta.age
    36     46   			local spawn = function(num, life_min, life_max, size_min, size_max, gl, speed, img)
    37     47   				table.insert(self._meta.emitters, minetest.add_particlespawner {
    38     48   					amount = num;
    39     49   					minexptime = life_min;