sorcery  Diff

Differences From Artifact [659d5f0d60]:

To Artifact [e1c11d0a7c]:


1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
..
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
...
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
sorcery.vfx = {}


sorcery.vfx.glowspark = function(color)
	local spark = sorcery.lib.image('sorcery_spark.png')
	return spark:blit(spark:multiply(color))
end

sorcery.vfx.cast_sparkle = function(caster,color,strength,duration,pos)
	local ofs = pos
		and function(x) return vector.add(pos,x) end
		or  function(x) return x end
	local height = caster:get_properties().eye_height
	minetest.add_particlespawner {
		amount = 70 * strength;
		time = duration or 1.5;
		attached = caster;
		-- texture = sorcery.lib.image('sorcery_spark.png'):multiply(color):render();
		texture = sorcery.vfx.glowspark(color):render();
		minpos = ofs({ x =  0.0, z =  0.6, y =  height*0.7});
		maxpos = ofs({ x =  0.4, z =  0.2, y =  height*1.1});
		minvel = { x = -0.5, z = -0.5, y = -0.5};
		maxvel = { x =  0.5, z =  0.5, y =  0.5};
		minacc = { x =  0.0, z =  0.0, y =  0.5};
		maxacc = { x =  0.0, z =  0.0, y =  0.5};
................................................................................
			aspect_h = 16;
			length = 1.1;
		};
	}
end

sorcery.vfx.body_sparkle = function(body,color,str,pos)
	local img = sorcery.lib.image
	local tex = img('sorcery_spark.png')
	local pi = tex:blit(tex:multiply(color)):render()
	local ofs = pos
		and function(x) return vector.add(pos,x) end
		or  function(x) return x end
	return minetest.add_particlespawner {
		amount = 25 * str;
		time = 0.5;
................................................................................
		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 = sorcery.lib.image('sorcery_spark.png'):multiply(color):render();
		animation = {
			type = 'vertical_frames';
			aspect_w = 16, aspect_h = 16;
			length = 2;
		};
		glow = 14;
	}
................................................................................
		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 = sorcery.lib.image('sorcery_sputter.png'):glow(col):render();
			glow = 14;
			animation = {
				type = 'vertical_frames', length = 0.4;
				aspect_w = 16, aspect_h = 16
			};
		}
	end
end

function sorcery.vfx.drip(liquid, noz, amt, time, exp)
	if type(liquid) == 'string' then liquid = sorcery.register.liquid.db[liquid] end
	local minnoz = vector.offset(noz, -0.03, 0.0, -0.03);
	local maxnoz = vector.offset(noz,  0.03, 0.0,  0.03);
	local drop = sorcery.lib.image('sorcery_drop.png'):multiply(liquid.color)
	return minetest.add_particlespawner {
		amount = amt, time = time;
		texture = drop:render();
		minpos = minnoz, maxpos = maxnoz;
		minvel = vector.new(0,0,0);
		maxvel = vector.new(0,-0.2,0);
		minacc = vector.new(0,-0.2,0);

>


|












|







 







<
|







 







|







 







|













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
32
33
34
35
36
37
38

39
40
41
42
43
44
45
46
..
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
...
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
sorcery.vfx = {}
local L = sorcery.lib

sorcery.vfx.glowspark = function(color)
	local spark = L.image('sorcery_spark.png')
	return spark:blit(spark:multiply(color))
end

sorcery.vfx.cast_sparkle = function(caster,color,strength,duration,pos)
	local ofs = pos
		and function(x) return vector.add(pos,x) end
		or  function(x) return x end
	local height = caster:get_properties().eye_height
	minetest.add_particlespawner {
		amount = 70 * strength;
		time = duration or 1.5;
		attached = caster;
		-- texture = L.image('sorcery_spark.png'):multiply(color):render();
		texture = sorcery.vfx.glowspark(color):render();
		minpos = ofs({ x =  0.0, z =  0.6, y =  height*0.7});
		maxpos = ofs({ x =  0.4, z =  0.2, y =  height*1.1});
		minvel = { x = -0.5, z = -0.5, y = -0.5};
		maxvel = { x =  0.5, z =  0.5, y =  0.5};
		minacc = { x =  0.0, z =  0.0, y =  0.5};
		maxacc = { x =  0.0, z =  0.0, y =  0.5};
................................................................................
			aspect_h = 16;
			length = 1.1;
		};
	}
end

sorcery.vfx.body_sparkle = function(body,color,str,pos)

	local tex = L.image('sorcery_spark.png')
	local pi = tex:blit(tex:multiply(color)):render()
	local ofs = pos
		and function(x) return vector.add(pos,x) end
		or  function(x) return x end
	return minetest.add_particlespawner {
		amount = 25 * str;
		time = 0.5;
................................................................................
		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
		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;
			animation = {
				type = 'vertical_frames', length = 0.4;
				aspect_w = 16, aspect_h = 16
			};
		}
	end
end

function sorcery.vfx.drip(liquid, noz, amt, time, exp)
	if type(liquid) == 'string' then liquid = sorcery.register.liquid.db[liquid] end
	local minnoz = vector.offset(noz, -0.03, 0.0, -0.03);
	local maxnoz = vector.offset(noz,  0.03, 0.0,  0.03);
	local drop = L.image('sorcery_drop.png'):multiply(L.color(liquid.color))
	return minetest.add_particlespawner {
		amount = amt, time = time;
		texture = drop:render();
		minpos = minnoz, maxpos = maxnoz;
		minvel = vector.new(0,0,0);
		maxvel = vector.new(0,-0.2,0);
		minacc = vector.new(0,-0.2,0);