sorcery  Diff

Differences From Artifact [e06af858b3]:

To Artifact [ec3123df49]:

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

120
121
122
123
124
125
126



127
128
129
130
131
132
133
...
143
144
145
146
147
148
149


150
151
152
153
154
155
156
157
158
159
160
161

162
163
164
165
166
167
168
	on_metadata_inventory_put = function(pos)
		minetest.get_node_timer(pos):start(1)
	end;
	on_timer = function(pos,delta)
		local meta = minetest.get_meta(pos)
		if not meta:contains('active-device') then return false end




		local inv = meta:get_inventory()
		if inv:is_empty('cache') then return false end

		local dev = gettxr(pos)
		local active = minetest.string_to_pos(meta:get_string('active-device'))

		local ad
................................................................................
		if ad.partner then
			remote = gettxr(ad.partner)
		elseif ad.code then
			local net = sorcery.farcaster.junction(pos,constants.xmit_wattage)
			for _,n in pairs(net) do
				for _,d in pairs(n.caps.net.devices.consume) do
					if d.id == 'sorcery:displacer' then


						local t = gettxr(d.pos)
						for _,d in pairs(t.connections) do
							if d.mode == 'receive' and d.code then
								local match = true
								for i=1,#d.code do
									if d.code[i] ~= ad.code[i] then
										match = false break
									end
								end
								if match then
									remote = t
									break

								end
							end
						end
					end
					if remote then break end
				end
				if remote then break end







>
>
>







 







>
>
|
|
|
|
|
|
|
|
|
|
|
|
>







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
...
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
	on_metadata_inventory_put = function(pos)
		minetest.get_node_timer(pos):start(1)
	end;
	on_timer = function(pos,delta)
		local meta = minetest.get_meta(pos)
		if not meta:contains('active-device') then return false end

		local probe = sorcery.spell.probe(pos)
		if probe.disjunction then return true end

		local inv = meta:get_inventory()
		if inv:is_empty('cache') then return false end

		local dev = gettxr(pos)
		local active = minetest.string_to_pos(meta:get_string('active-device'))

		local ad
................................................................................
		if ad.partner then
			remote = gettxr(ad.partner)
		elseif ad.code then
			local net = sorcery.farcaster.junction(pos,constants.xmit_wattage)
			for _,n in pairs(net) do
				for _,d in pairs(n.caps.net.devices.consume) do
					if d.id == 'sorcery:displacer' then
						local dp = sorcery.spell.probe(d.pos)
						if not dp.disjunction then
							local t = gettxr(d.pos)
							for _,d in pairs(t.connections) do
								if d.mode == 'receive' and d.code then
									local match = true
									for i=1,#d.code do
										if d.code[i] ~= ad.code[i] then
											match = false break
										end
									end
									if match then
										remote = t
										break
									end
								end
							end
						end
					end
					if remote then break end
				end
				if remote then break end