18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
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'))
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
|
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
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
|