semi-working particles
parent
6e0902cd32
commit
c0ddd7103d
4
abms.lua
4
abms.lua
|
@ -27,6 +27,7 @@ minetest.register_abm({ -- Controls non-contained fire
|
|||
meta:set_string('infotext','Campfire active: '..percent..'%')
|
||||
minetest.swap_node(pos, {name = 'more_fire:campfire'})
|
||||
minetest.delete_particlespawner(1)
|
||||
ember_particles(pos)
|
||||
meta:set_string('formspec',
|
||||
'size[8,6.75]'..
|
||||
default.gui_bg..
|
||||
|
@ -47,6 +48,7 @@ minetest.register_abm({ -- Controls non-contained fire
|
|||
if node.name == 'more_fire:campfire' then
|
||||
meta:set_string('infotext','Put more wood on the fire!')
|
||||
minetest.swap_node(pos, {name = 'more_fire:embers'})
|
||||
minetest.delete_particlespawner(1)
|
||||
smoke_particles(pos)
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
meta:set_string('formspec', more_fire.embers_formspec)
|
||||
|
@ -91,6 +93,7 @@ minetest.register_abm({ -- Controls the contained fires.
|
|||
meta:set_string('infotext','Campfire active: '..percent..'%')
|
||||
minetest.swap_node(pos, {name = 'more_fire:campfire_contained'})
|
||||
minetest.delete_particlespawner(1)
|
||||
ember_particles(pos)
|
||||
meta:set_string('formspec',
|
||||
'size[8,6.75]'..
|
||||
default.gui_bg..
|
||||
|
@ -112,6 +115,7 @@ minetest.register_abm({ -- Controls the contained fires.
|
|||
meta:set_string('infotext','Put more wood on the fire!')
|
||||
minetest.swap_node(pos, {name = 'more_fire:embers_contained'})
|
||||
meta:set_string('formspec', more_fire.embers_formspec)
|
||||
minetest.delete_particlespawner(1)
|
||||
smoke_particles(pos)
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(190)
|
||||
|
|
|
@ -59,6 +59,27 @@ function smoke_particles(pos)
|
|||
collisiondetection = false, -- do particles stop when they hit solid node
|
||||
texture = 'more_fire_smoke.png', -- image to use (e.g. "bubble.png" )
|
||||
vertical = false, -- upright/vertical image for rain
|
||||
-- playername = "singleplayer", -- particles only appear for this player
|
||||
-- playername = "singleplayer", -- particles only appear for this player
|
||||
})
|
||||
end
|
||||
|
||||
function ember_particles(pos)
|
||||
minetest.add_particlespawner({
|
||||
amount = 1,
|
||||
time = 0,
|
||||
minpos = {x=pos.x, y=pos.y, z=pos.z},
|
||||
maxpos = {x=pos.x, y=pos.y, z=pos.z},
|
||||
minvel = {x=-.1, y=.2, z=-.1},
|
||||
maxvel = {x=.1, y=.6, z=.1},
|
||||
minacc = {x=-.05, y=.02, z=-.05},
|
||||
maxacc = {x=.1, y=.25, z=.1},
|
||||
minexptime = 3,
|
||||
maxexptime = 4,
|
||||
minsize = 1,
|
||||
maxsize = 2,
|
||||
collisiondetection = false,
|
||||
texture = 'more_fire_embers.png',
|
||||
vertical = false,
|
||||
-- playername = "singleplayer",
|
||||
})
|
||||
end
|
||||
|
|
|
@ -260,6 +260,7 @@ minetest.register_node('more_fire:embers_contained', {
|
|||
local inv = meta:get_inventory()
|
||||
inv:set_size('fuel', 4)
|
||||
timer:start(190)
|
||||
minetest.delete_particlespawner(1)
|
||||
smoke_particles(pos)
|
||||
end,
|
||||
can_dig = function(pos, player)
|
||||
|
@ -321,7 +322,7 @@ minetest.register_node('more_fire:campfire_contained', {
|
|||
return true
|
||||
end,
|
||||
get_staticdata = function(self)
|
||||
end,
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node('more_fire:oil_lamp_on', {
|
||||
|
|
Loading…
Reference in New Issue