10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
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();
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};
minsize = 0.4, maxsize = 0.8;
................................................................................
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.under,tgt.above)
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);
|
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
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};
minsize = 0.4, maxsize = 0.8;
................................................................................
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);
|