sorcery  Diff

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]

To Artifact [343a5ccf55]:


1
2
3




4
5
6
7
8
9
10
11
12
13
14
15
16
17
..
19
20
21
22
23
24
25





























26
27
28
29
30
31
32
sorcery.vfx = {}

sorcery.vfx.cast_sparkle = function(caster,color,strength,duration)




	minetest.add_particlespawner {
		amount = 70 * strength;
		time = duration or 1.5;
		attached = caster;
		texture = sorcery.lib.image('sorcery_spark.png'):multiply(color):render();
		minpos = { x = -0.1, z =  0.5, y =  1.2}; 
		maxpos = { x =  0.1, z =  0.3, y =  1.6}; 
		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;
		minexptime = 1, maxexptime = 1;
		glow = 14;
................................................................................
			type = 'vertical_frames';
			aspect_w = 16;
			aspect_h = 16;
			length = 1.1;
		};
	}
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)


|
>
>
>
>





|
|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
sorcery.vfx = {}

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();
		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;
		minexptime = 1, maxexptime = 1;
		glow = 14;
................................................................................
			type = 'vertical_frames';
			aspect_w = 16;
			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;
		attached = body;
		minpos = ofs{x = -0.5, y = -0.5, z = -0.5};
		maxpos = ofs{x =  0.5, y =  1.5, z =  0.5};
		minacc = {x = -0.3, y =  0.0, z =  0.3};
		maxacc = {x = -0.3, y =  0.0, z =  0.3};
		minvel = {x = -0.6, y = -0.2, z =  0.6};
		maxvel = {x = -0.6, y =  0.2, z =  0.6};
		minexptime = 1.0;
		maxexptime = 1.5;
		texture = pi;
		glow = 14;
		animation = {
			type = 'vertical_frames';
			aspect_w = 16, aspect_h = 16;
			length = 1.6;
		};
	}
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)