Differences From
Artifact [e06af858b3]:
- 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 120 on_metadata_inventory_put = function(pos)
121 121 minetest.get_node_timer(pos):start(1)
122 122 end;
123 123 on_timer = function(pos,delta)
124 124 local meta = minetest.get_meta(pos)
125 125 if not meta:contains('active-device') then return false end
126 126
127 + local probe = sorcery.spell.probe(pos)
128 + if probe.disjunction then return true end
129 +
127 130 local inv = meta:get_inventory()
128 131 if inv:is_empty('cache') then return false end
129 132
130 133 local dev = gettxr(pos)
131 134 local active = minetest.string_to_pos(meta:get_string('active-device'))
132 135
133 136 local ad
................................................................................
143 146 if ad.partner then
144 147 remote = gettxr(ad.partner)
145 148 elseif ad.code then
146 149 local net = sorcery.farcaster.junction(pos,constants.xmit_wattage)
147 150 for _,n in pairs(net) do
148 151 for _,d in pairs(n.caps.net.devices.consume) do
149 152 if d.id == 'sorcery:displacer' then
150 - local t = gettxr(d.pos)
151 - for _,d in pairs(t.connections) do
152 - if d.mode == 'receive' and d.code then
153 - local match = true
154 - for i=1,#d.code do
155 - if d.code[i] ~= ad.code[i] then
156 - match = false break
153 + local dp = sorcery.spell.probe(d.pos)
154 + if not dp.disjunction then
155 + local t = gettxr(d.pos)
156 + for _,d in pairs(t.connections) do
157 + if d.mode == 'receive' and d.code then
158 + local match = true
159 + for i=1,#d.code do
160 + if d.code[i] ~= ad.code[i] then
161 + match = false break
162 + end
157 163 end
158 - end
159 - if match then
160 - remote = t
161 - break
164 + if match then
165 + remote = t
166 + break
167 + end
162 168 end
163 169 end
164 170 end
165 171 end
166 172 if remote then break end
167 173 end
168 174 if remote then break end