sorcery  Diff

Differences From Artifact [936cc31413]:

To Artifact [dc765bd287]:


198
199
200
201
202
203
204
205
206
207
208
209
210

211
212
213

214
215
216
217
218
219










































220
221
222
223
224
225
226
227
228
229
230
231
232
...
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
		};
	}
end

sorcery.vfx.enchantment_sparkle = function(tgt,color)
	local minvel, maxvel
	if minetest.get_node(vector.add(tgt.under,{y=1,z=0,x=0})).name == 'air' then
		minvel = {x=0,z=0,y= 0.3}  maxvel = {x=0,z=0,y= 1.5};
	else
		local dir = vector.subtract(tgt.above,tgt.under)
		minvel = vector.multiply(dir, 0.3)
		maxvel = vector.multiply(dir, 1.2)
	end

	return minetest.add_particlespawner {
		amount = 50;
		time = 0.5;

		minpos = vector.subtract(tgt.under, 0.5);
		maxpos = vector.add(tgt.under, 0.5);
		minvel = minvel, maxvel = maxvel;
		minexptime = 1, maxexptime = 2;
		minsize = 0.5, maxsize = 2;
		texture = L.image('sorcery_spark.png'):multiply(color):render();










































		animation = {
			type = 'vertical_frames';
			aspect_w = 16, aspect_h = 16;
			length = 2;
		};
		glow = 14;
	}
end

sorcery.vfx.bloodburst = function(pos,size)
	for i=0, size or 48 do
		minetest.add_particle{
			texture = 'sorcery_blood_' .. math.random(5) .. '.png',
................................................................................
		local ppos = vector.add(po,tpos)
		local dir = vector.direction(ppos,scenter)
		local vel = math.random() * 0.8 + 0.4
		local col if type(color) == 'function'
			then col = color(i, {high = high, far = far, dir = dir, vel = vel, pos = po})
			else col = color
		end
		local et = math.floor((far/vel)*10)*.1
		minetest.add_particle {
			pos = ppos;
			velocity = vector.multiply(dir,vel);
			expirationtime = 0.4;
			size = math.random()*2.4 + 0.6;
			texture = L.image('sorcery_sputter.png'):glow(col):render();
			glow = 14;







|





>

|
|
>






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|







 







|







198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
...
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
		};
	}
end

sorcery.vfx.enchantment_sparkle = function(tgt,color)
	local minvel, maxvel
	if minetest.get_node(vector.add(tgt.under,{y=1,z=0,x=0})).name == 'air' then
		minvel = vector.new(-0.3,0.3,-0.3)  maxvel = vector.new(0.6,1.5,0.6);
	else
		local dir = vector.subtract(tgt.above,tgt.under)
		minvel = vector.multiply(dir, 0.3)
		maxvel = vector.multiply(dir, 1.2)
	end
	print(minetest.get_player_by_name('singleplayer'))
	return minetest.add_particlespawner {
		amount = 450;--50;
		time = 2;--0.5;
		-- old syntax
		minpos = vector.subtract(tgt.under, 0.5);
		maxpos = vector.add(tgt.under, 0.5);
		minvel = minvel, maxvel = maxvel;
		minexptime = 1, maxexptime = 2;
		minsize = 0.5, maxsize = 2;
		texture = L.image('sorcery_spark.png'):multiply(color):render();

		--new syntax
		-- can't use this shit until it gets merged :(
	-- 		pos = {
	-- 			min = vector.subtract(tgt.under, 0.5);
	-- 			max = vector.add(tgt.under, 0.5);
	-- 		};
-- 		pos = {
-- 			min = vector.subtract(tgt.under, 0.8);
-- 			max = vector.add     (tgt.under, 0.8);
-- 		};
-- 		vel_tween = {
-- 			{min = minvel, max = maxvel};
-- 			{min = minvel * 3, max = maxvel * 3};
-- 		};
-- 		acc = {
-- 			min = vector.new(0,-2,0);
-- 			max = vector.new(0,-5,0);
-- 		};
-- 		bounce = { min = 0.3, max = 2 };
-- 		exptime = { min = 0.5, max = 10 };
-- 		size = { min = 0.5, max = 1 };
-- 		collisiondetection = true;
--
-- 		texpool = {
-- 			{
-- 				img = L.image('sorcery_spark.png'):multiply(color):render();
-- -- 				img = 'sorcery_inferno_crystal.png';
-- 				alpha_tween = { 0.8, 1; style = 'pulse', reps = 4};
-- -- 	        scale = {x=4,y=0.5};
-- 				scale_tween = { {x=2,y=3}; {x=0,y=0}; style = 'pulse', reps = 6 };
-- 			};
-- 	-- 			{
-- 	-- 				img = L.image('sorcery_divine_radiance_1.png'):multiply(L.color(255,0,0)):render();
-- 	-- 				fade = 'pulse';
-- 	-- 				fade_reps = 3;
-- 	-- 			};
-- 		};
-- 		radius = {
-- 			min = vector.new(0,0,0);
-- 			max = 0;
-- 		};
		-- animation = {
		-- 	type = 'vertical_frames';
		-- 	aspect_w = 16, aspect_h = 16;
		-- 	length = -1;
		-- };
		-- glow = 14;
	}
end

sorcery.vfx.bloodburst = function(pos,size)
	for i=0, size or 48 do
		minetest.add_particle{
			texture = 'sorcery_blood_' .. math.random(5) .. '.png',
................................................................................
		local ppos = vector.add(po,tpos)
		local dir = vector.direction(ppos,scenter)
		local vel = math.random() * 0.8 + 0.4
		local col if type(color) == 'function'
			then col = color(i, {high = high, far = far, dir = dir, vel = vel, pos = po})
			else col = color
		end
		local et = math.floor((far/vel)*10)*.1 -- avoid freeze
		minetest.add_particle {
			pos = ppos;
			velocity = vector.multiply(dir,vel);
			expirationtime = 0.4;
			size = math.random()*2.4 + 0.6;
			texture = L.image('sorcery_sputter.png'):glow(col):render();
			glow = 14;