sorcery  Diff

Differences From Artifact [a330742505]:

To Artifact [2ecc37ddb4]:

  • File forcefield.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: 5483) [annotate] [blame] [check-ins using]

   123    123   	};
   124    124   	on_construct = function(pos)
   125    125   		minetest.get_node_timer(pos):start(1)
   126    126   	end;
   127    127   	on_timer = function(pos,delta)
   128    128   		local orientation = math.floor(minetest.get_node(pos).param2 / 4)
   129    129   		local costs = calc_cost(pos,delta)
          130  +		local probe = sorcery.spell.probe(pos)
          131  +		if probe.disjunction then return true end
   130    132   		local l = sorcery.ley.netcaps(pos,delta)
   131    133   		if l.self.powerdraw >= costs.mincost then
   132    134   			local dist = l.self.powerdraw / (constants.cost_per_barrier * delta)
   133    135   			for i=1,math.floor(dist) do
   134    136   				local t = costs.targets[i]
   135    137   				local str = math.min(0xFF,t[2] + 50*delta);
   136         -				minetest.swap_node(t[1], {
   137         -					name = 'sorcery:air_barrier_' .. math.max(1, math.floor(10*(str/0xFF)));
   138         -					param2 = str;
   139         -				})
   140         -				minetest.get_node_timer(t[1]):start(1)
          138  +				local fprobe = sorcery.spell.probe(t[1])
          139  +				if not fprobe.disjunction then
          140  +					minetest.swap_node(t[1], {
          141  +						name = 'sorcery:air_barrier_' .. math.max(1, math.floor(10*(str/0xFF)));
          142  +						param2 = str;
          143  +					})
          144  +					minetest.get_node_timer(t[1]):start(1)
          145  +				end
   141    146   			end
   142    147   
   143    148   			local pn = vector.add(pos, vector.divide(costs.aim,2));
   144    149   			local pp = vector.add(pn, pofstbl[orientation])
   145    150   			pn = vector.subtract(pn,  pofstbl[orientation])
   146    151   			
   147    152   			minetest.add_particlespawner {