Differences From
Artifact [291a2c52f8]:
- File
vfx.lua
— part of check-in
[ea6e475e44]
at
2020-10-19 09:52:11
on branch trunk
— continue dev on celestial mechanics, add melding+division spells (resonance), refine itemclasses, add keypunch and punchcards, add paper pulp, add a shitload of visuals, add convenience scripts for working with the wiki, make the flamebolt spell actually useful instead of just a pretty lightshow, add essences, inferno crystal, and other goodies; iterate on wands, lots of shit i can't remember, various bugfixes
(user:
lexi,
size: 1937)
[annotate]
[blame]
[check-ins using]
1 1 sorcery.vfx = {}
2 2
3 -sorcery.vfx.cast_sparkle = function(caster,color,strength,duration)
3 +sorcery.vfx.cast_sparkle = function(caster,color,strength,duration,pos)
4 + local ofs = pos
5 + and function(x) return vector.add(pos,x) end
6 + or function(x) return x end
7 + local height = caster:get_properties().eye_height
4 8 minetest.add_particlespawner {
5 9 amount = 70 * strength;
6 10 time = duration or 1.5;
7 11 attached = caster;
8 12 texture = sorcery.lib.image('sorcery_spark.png'):multiply(color):render();
9 - minpos = { x = -0.1, z = 0.5, y = 1.2};
10 - maxpos = { x = 0.1, z = 0.3, y = 1.6};
13 + minpos = ofs({ x = 0.0, z = 0.6, y = height*0.7});
14 + maxpos = ofs({ x = 0.4, z = 0.2, y = height*1.1});
11 15 minvel = { x = -0.5, z = -0.5, y = -0.5};
12 16 maxvel = { x = 0.5, z = 0.5, y = 0.5};
13 17 minacc = { x = 0.0, z = 0.0, y = 0.5};
14 18 maxacc = { x = 0.0, z = 0.0, y = 0.5};
15 19 minsize = 0.4, maxsize = 0.8;
16 20 minexptime = 1, maxexptime = 1;
17 21 glow = 14;
................................................................................
19 23 type = 'vertical_frames';
20 24 aspect_w = 16;
21 25 aspect_h = 16;
22 26 length = 1.1;
23 27 };
24 28 }
25 29 end
30 +
31 +sorcery.vfx.body_sparkle = function(body,color,str,pos)
32 + local img = sorcery.lib.image
33 + local tex = img('sorcery_spark.png')
34 + local pi = tex:blit(tex:multiply(color)):render()
35 + local ofs = pos
36 + and function(x) return vector.add(pos,x) end
37 + or function(x) return x end
38 + return minetest.add_particlespawner {
39 + amount = 25 * str;
40 + time = 0.5;
41 + attached = body;
42 + minpos = ofs{x = -0.5, y = -0.5, z = -0.5};
43 + maxpos = ofs{x = 0.5, y = 1.5, z = 0.5};
44 + minacc = {x = -0.3, y = 0.0, z = 0.3};
45 + maxacc = {x = -0.3, y = 0.0, z = 0.3};
46 + minvel = {x = -0.6, y = -0.2, z = 0.6};
47 + maxvel = {x = -0.6, y = 0.2, z = 0.6};
48 + minexptime = 1.0;
49 + maxexptime = 1.5;
50 + texture = pi;
51 + glow = 14;
52 + animation = {
53 + type = 'vertical_frames';
54 + aspect_w = 16, aspect_h = 16;
55 + length = 1.6;
56 + };
57 + }
58 +end
26 59
27 60 sorcery.vfx.enchantment_sparkle = function(tgt,color)
28 61 local minvel, maxvel
29 62 if minetest.get_node(vector.add(tgt.under,{y=1,z=0,x=0})).name == 'air' then
30 63 minvel = {x=0,z=0,y= 0.3} maxvel = {x=0,z=0,y= 1.5};
31 64 else
32 65 local dir = vector.subtract(tgt.under,tgt.above)