sorcery  Artifact [46cef4271e]

Artifact 46cef4271e54ad597de6eae4b10616271476c486ade7dedbc8f120d60d80cd10:

  • File tnodes.lua — part of check-in [147592b8e9] at 2020-10-26 03:58:08 on branch trunk — add over-time spellcasting abstraction to enable metamagic and in particular disjunction, add more animations and sound effects, add excavation spell, possibly some others, forget when the last commit was, edit a bunch of magitech to make it subject to the disjunction mechanism (throw up a disjunction aura and waltz right through those force fields bby, wheee), also illumination spells, tweak runeforge and rune frequence to better the balance and also limit player frustration, move some math functions into their own library category, various tweaks and bugfixes, probably other shit i don't remember (user: lexi, size: 1863) [annotate] [blame] [check-ins using]

for i=1,minetest.LIGHT_MAX do
	minetest.register_node('sorcery:air_glimmer_' .. tostring(i), {
		drawtype = 'airlike';
		light_source = 5 + math.ceil(i * (11/minetest.LIGHT_MAX));
		sunlight_propagates = true;
		buildable_to = true;
		pointable = false;
		walkable = false;
		floodable = true;
		drop = {max_items = 0, items = {}};
		on_blast = function() end; -- not affected by explosions
		groups = { air = 1; sorcery_air = 1; not_in_creative_inventory = 1; };
		on_construct = function(pos)
			local meta = minetest.get_meta(pos)
			meta:set_float('duration',10)
			meta:set_float('timeleft',10)
			meta:set_int('power',minetest.LIGHT_MAX)
			minetest.get_node_timer(pos):start(1)
		end;
		on_timer = function(pos,dtime)
			local meta = minetest.get_meta(pos)
			local elapsed = dtime + meta:get_float('duration') - meta:get_float('timeleft')
			local level = 1 - (elapsed / meta:get_float('duration'))
			local lum = math.ceil(level*meta:get_int('power'))
			local probe = sorcery.spell.probe(pos)
			if probe.disjunction then
				minetest.remove_node(pos)
				return false
			end
			if lum ~= i then
				if lum <= 0 then
					minetest.remove_node(pos)
					return false
				else
					minetest.swap_node(pos,{name='sorcery:air_glimmer_'..tostring(lum)})
				end
			end
			minetest.add_particlespawner {
				amount = 3 * meta:get_int('power');
				time = 1.1;
				minpos = vector.subtract(pos,2);
				maxpos = vector.add(pos,2);
				minvel = {x = -0.5; z = -0.5; y = -0.3};
				maxvel = {x =  0.5; z =  0.5; y =  0.3};
				minsize = 0.3, maxsize = 0.9;
				minexptime = 0.5, maxexptime = 1.2;
				texture = 'sorcery_spark.png';
				animation = {
					glow = i;
					length = 1.2;
					type = 'vertical_frames';
					aspect_w = 16;
					aspect_h = 16;
				}
			}
			meta:set_float('timeleft',meta:get_float('duration') - elapsed)
			return true
		end;
	})
end