sorcery  Diff

Differences From Artifact [4936c92bc2]:

To Artifact [00d856eebe]:


651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
....
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
							local tex = sorcery.lib.image('sorcery_sputter.png'):glow(sorcery.lib.color(160,255,80)):render();
							local epicenter = ctx.caster:get_pos() + vector.new(0, h/2, 0)
							local maxima = vector.new(radius, radius, radius)
							local potential_targets = minetest.find_nodes_in_area(epicenter - maxima, epicenter + maxima, {'group:sorcery_magical', 'group:sorcery_magitech'})
							local wreck = {}
							for _, pos in pairs(potential_targets) do
								if sorcery.lib.math.vdcomp(radius,epicenter,pos) then
									print('got wreckable at',pos)
									wreck[#wreck+1] = pos
								end
							end
							sorcery.spell.cast {
								name = 'sorcery:spellshatter';
								caster = ctx.caster;
								anchor = epicenter;
................................................................................
							local put = function(ofs)
								timeline[{whence=0,secs=per*i}] = function(s)
									local p = vector.add(w,ofs)
									if not sorcery.lib.node.is_clear(p) then return end
									spark(s, p)
									minetest.sound_play('sorcery_put', {pos = p, gain = 0.4}, true)
									local lamp = mpick 'lamp_ext'
									print('installing lamp',lamp,p,vector.new(ofs))
									put_align(p, lamp, vector.multiply(ofs,-1))
								end
								i=i+1
							end
							put{x=o.x, y=0, z=0}
							put{x=0,   y=0, z=o.z}
						end







<







 







<







651
652
653
654
655
656
657

658
659
660
661
662
663
664
....
1503
1504
1505
1506
1507
1508
1509

1510
1511
1512
1513
1514
1515
1516
							local tex = sorcery.lib.image('sorcery_sputter.png'):glow(sorcery.lib.color(160,255,80)):render();
							local epicenter = ctx.caster:get_pos() + vector.new(0, h/2, 0)
							local maxima = vector.new(radius, radius, radius)
							local potential_targets = minetest.find_nodes_in_area(epicenter - maxima, epicenter + maxima, {'group:sorcery_magical', 'group:sorcery_magitech'})
							local wreck = {}
							for _, pos in pairs(potential_targets) do
								if sorcery.lib.math.vdcomp(radius,epicenter,pos) then

									wreck[#wreck+1] = pos
								end
							end
							sorcery.spell.cast {
								name = 'sorcery:spellshatter';
								caster = ctx.caster;
								anchor = epicenter;
................................................................................
							local put = function(ofs)
								timeline[{whence=0,secs=per*i}] = function(s)
									local p = vector.add(w,ofs)
									if not sorcery.lib.node.is_clear(p) then return end
									spark(s, p)
									minetest.sound_play('sorcery_put', {pos = p, gain = 0.4}, true)
									local lamp = mpick 'lamp_ext'

									put_align(p, lamp, vector.multiply(ofs,-1))
								end
								i=i+1
							end
							put{x=o.x, y=0, z=0}
							put{x=0,   y=0, z=o.z}
						end