207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
...
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
end
local wand_cast = function(stack, user, target)
local meta = stack:get_meta()
local wand = sorcery.wands.util.getproto(stack)
if meta:contains('sorcery_wand_spell') == false then return nil end
local spell = meta:get_string('sorcery_wand_spell')
local castfn = sorcery.data.spells[spell].cast
if castfn == nil then return nil end
local matprops = sorcery.wands.util.matprops(wand)
if matprops.bond then
local userct, found = 0, false
for i=1,matprops.bond do
local prop = 'bound_user_' .. tostring(i)
if meta:contains(prop) then
................................................................................
local context = {
base = wand;
stats = matprops;
meta = meta;
item = stack;
caster = user;
target = target;
today = minetest.get_day_count();
heading = {
pos = user:get_pos();
yaw = user:get_look_dir();
pitch = user:get_look_vertical();
angle = user:get_look_horizontal();
eyeheight = uprops.eye_height;
|
|
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
...
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
|
end
local wand_cast = function(stack, user, target)
local meta = stack:get_meta()
local wand = sorcery.wands.util.getproto(stack)
if meta:contains('sorcery_wand_spell') == false then return nil end
local spell = meta:get_string('sorcery_wand_spell')
local spelldata = sorcery.data.spells[spell]
-- wands don't work in anti-magic fields
local probe = sorcery.spell.probe(user:get_pos())
if probe.disjunction and not spelldata.ignore_disjunction then return nil end
local castfn = spelldata.cast
if castfn == nil then return nil end
local matprops = sorcery.wands.util.matprops(wand)
if matprops.bond then
local userct, found = 0, false
for i=1,matprops.bond do
local prop = 'bound_user_' .. tostring(i)
if meta:contains(prop) then
................................................................................
local context = {
base = wand;
stats = matprops;
meta = meta;
item = stack;
caster = user;
target = target;
probe = probe;
today = minetest.get_day_count();
heading = {
pos = user:get_pos();
yaw = user:get_look_dir();
pitch = user:get_look_vertical();
angle = user:get_look_horizontal();
eyeheight = uprops.eye_height;
|