sorcery  Diff

Differences From Artifact [936cc31413]:

To Artifact [dc765bd287]:


   198    198   		};
   199    199   	}
   200    200   end
   201    201   
   202    202   sorcery.vfx.enchantment_sparkle = function(tgt,color)
   203    203   	local minvel, maxvel
   204    204   	if minetest.get_node(vector.add(tgt.under,{y=1,z=0,x=0})).name == 'air' then
   205         -		minvel = {x=0,z=0,y= 0.3}  maxvel = {x=0,z=0,y= 1.5};
          205  +		minvel = vector.new(-0.3,0.3,-0.3)  maxvel = vector.new(0.6,1.5,0.6);
   206    206   	else
   207    207   		local dir = vector.subtract(tgt.above,tgt.under)
   208    208   		minvel = vector.multiply(dir, 0.3)
   209    209   		maxvel = vector.multiply(dir, 1.2)
   210    210   	end
          211  +	print(minetest.get_player_by_name('singleplayer'))
   211    212   	return minetest.add_particlespawner {
   212         -		amount = 50;
   213         -		time = 0.5;
          213  +		amount = 450;--50;
          214  +		time = 2;--0.5;
          215  +		-- old syntax
   214    216   		minpos = vector.subtract(tgt.under, 0.5);
   215    217   		maxpos = vector.add(tgt.under, 0.5);
   216    218   		minvel = minvel, maxvel = maxvel;
   217    219   		minexptime = 1, maxexptime = 2;
   218    220   		minsize = 0.5, maxsize = 2;
   219    221   		texture = L.image('sorcery_spark.png'):multiply(color):render();
   220         -		animation = {
   221         -			type = 'vertical_frames';
   222         -			aspect_w = 16, aspect_h = 16;
   223         -			length = 2;
   224         -		};
   225         -		glow = 14;
          222  +
          223  +		--new syntax
          224  +		-- can't use this shit until it gets merged :(
          225  +	-- 		pos = {
          226  +	-- 			min = vector.subtract(tgt.under, 0.5);
          227  +	-- 			max = vector.add(tgt.under, 0.5);
          228  +	-- 		};
          229  +-- 		pos = {
          230  +-- 			min = vector.subtract(tgt.under, 0.8);
          231  +-- 			max = vector.add     (tgt.under, 0.8);
          232  +-- 		};
          233  +-- 		vel_tween = {
          234  +-- 			{min = minvel, max = maxvel};
          235  +-- 			{min = minvel * 3, max = maxvel * 3};
          236  +-- 		};
          237  +-- 		acc = {
          238  +-- 			min = vector.new(0,-2,0);
          239  +-- 			max = vector.new(0,-5,0);
          240  +-- 		};
          241  +-- 		bounce = { min = 0.3, max = 2 };
          242  +-- 		exptime = { min = 0.5, max = 10 };
          243  +-- 		size = { min = 0.5, max = 1 };
          244  +-- 		collisiondetection = true;
          245  +--
          246  +-- 		texpool = {
          247  +-- 			{
          248  +-- 				img = L.image('sorcery_spark.png'):multiply(color):render();
          249  +-- -- 				img = 'sorcery_inferno_crystal.png';
          250  +-- 				alpha_tween = { 0.8, 1; style = 'pulse', reps = 4};
          251  +-- -- 	        scale = {x=4,y=0.5};
          252  +-- 				scale_tween = { {x=2,y=3}; {x=0,y=0}; style = 'pulse', reps = 6 };
          253  +-- 			};
          254  +-- 	-- 			{
          255  +-- 	-- 				img = L.image('sorcery_divine_radiance_1.png'):multiply(L.color(255,0,0)):render();
          256  +-- 	-- 				fade = 'pulse';
          257  +-- 	-- 				fade_reps = 3;
          258  +-- 	-- 			};
          259  +-- 		};
          260  +-- 		radius = {
          261  +-- 			min = vector.new(0,0,0);
          262  +-- 			max = 0;
          263  +-- 		};
          264  +		-- animation = {
          265  +		-- 	type = 'vertical_frames';
          266  +		-- 	aspect_w = 16, aspect_h = 16;
          267  +		-- 	length = -1;
          268  +		-- };
          269  +		-- glow = 14;
   226    270   	}
   227    271   end
   228    272   
   229    273   sorcery.vfx.bloodburst = function(pos,size)
   230    274   	for i=0, size or 48 do
   231    275   		minetest.add_particle{
   232    276   			texture = 'sorcery_blood_' .. math.random(5) .. '.png',
................................................................................
   270    314   		local ppos = vector.add(po,tpos)
   271    315   		local dir = vector.direction(ppos,scenter)
   272    316   		local vel = math.random() * 0.8 + 0.4
   273    317   		local col if type(color) == 'function'
   274    318   			then col = color(i, {high = high, far = far, dir = dir, vel = vel, pos = po})
   275    319   			else col = color
   276    320   		end
   277         -		local et = math.floor((far/vel)*10)*.1
          321  +		local et = math.floor((far/vel)*10)*.1 -- avoid freeze
   278    322   		minetest.add_particle {
   279    323   			pos = ppos;
   280    324   			velocity = vector.multiply(dir,vel);
   281    325   			expirationtime = 0.4;
   282    326   			size = math.random()*2.4 + 0.6;
   283    327   			texture = L.image('sorcery_sputter.png'):glow(col):render();
   284    328   			glow = 14;