Version MFF.
1
fake_fire/depends.txt
Normal file → Executable file
@@ -1,2 +1 @@
|
||||
default
|
||||
homedecor
|
||||
|
||||
94
fake_fire/init.lua
Normal file → Executable file
@@ -1,6 +1,3 @@
|
||||
|
||||
local S = homedecor_i18n.gettext
|
||||
|
||||
screwdriver = screwdriver or {}
|
||||
|
||||
local function start_smoke(pos, node, clicker, chimney)
|
||||
@@ -11,8 +8,8 @@ local function start_smoke(pos, node, clicker, chimney)
|
||||
|
||||
if id ~= 0 then
|
||||
if s_handle then
|
||||
minetest.after(0, function(handle)
|
||||
minetest.sound_stop(handle)
|
||||
minetest.after(0, function(s_handle)
|
||||
minetest.sound_stop(s_handle)
|
||||
end, s_handle)
|
||||
end
|
||||
minetest.delete_particlespawner(id)
|
||||
@@ -33,18 +30,19 @@ local function start_smoke(pos, node, clicker, chimney)
|
||||
texture = "smoke_particle.png",
|
||||
})
|
||||
if chimney == 1 then
|
||||
s_handle = nil
|
||||
this_spawner_meta:set_int("smoky", id)
|
||||
this_spawner_meta:set_int("sound", nil)
|
||||
else
|
||||
s_handle = minetest.sound_play("fire_small", {
|
||||
pos = pos,
|
||||
max_hear_distance = 5,
|
||||
loop = true
|
||||
})
|
||||
this_spawner_meta:set_int("smoky", id)
|
||||
this_spawner_meta:set_int("sound", s_handle)
|
||||
s_handle = minetest.sound_play("fire_small", {
|
||||
pos = pos,
|
||||
max_hear_distance = 5,
|
||||
loop = true
|
||||
})
|
||||
this_spawner_meta:set_int("smoky", id)
|
||||
this_spawner_meta:set_int("sound", s_handle)
|
||||
end
|
||||
end
|
||||
return end
|
||||
end
|
||||
|
||||
local function stop_smoke(pos)
|
||||
@@ -57,8 +55,8 @@ local function stop_smoke(pos)
|
||||
end
|
||||
|
||||
if s_handle then
|
||||
minetest.after(0, function(handle)
|
||||
minetest.sound_stop(handle)
|
||||
minetest.after(0, function(s_handle)
|
||||
minetest.sound_stop(s_handle)
|
||||
end, s_handle)
|
||||
end
|
||||
|
||||
@@ -67,16 +65,12 @@ local function stop_smoke(pos)
|
||||
end
|
||||
|
||||
-- FLAME TYPES
|
||||
local flame_types = {
|
||||
{ "fake", S("Fake fire") },
|
||||
{ "ice", S("Ice fire") },
|
||||
}
|
||||
local flame_types = {"fake", "ice"}
|
||||
|
||||
for _, f in ipairs(flame_types) do
|
||||
local name, desc = unpack(f)
|
||||
minetest.register_node("fake_fire:"..name.."_fire", {
|
||||
inventory_image = name.."_fire_inv.png",
|
||||
description = desc,
|
||||
minetest.register_node("fake_fire:"..f.."_fire", {
|
||||
inventory_image = f.."_fire_inv.png",
|
||||
description = f.." fire",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
@@ -87,12 +81,11 @@ for _, f in ipairs(flame_types) do
|
||||
light_source = 14,
|
||||
waving = 1,
|
||||
tiles = {
|
||||
{name=name.."_fire_animated.png", animation={type="vertical_frames",
|
||||
{name=f.."_fire_animated.png", animation={type="vertical_frames",
|
||||
aspect_w=16, aspect_h=16, length=1.5}},
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
on_rightclick = function (pos, node, clicker)
|
||||
start_smoke(pos, node, clicker)
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function (pos)
|
||||
stop_smoke(pos)
|
||||
@@ -106,7 +99,7 @@ end
|
||||
|
||||
minetest.register_node("fake_fire:fancy_fire", {
|
||||
inventory_image = "fancy_fire_inv.png",
|
||||
description = S("Fancy Fire"),
|
||||
description = "Fancy Fire",
|
||||
drawtype = "mesh",
|
||||
mesh = "fancy_fire.obj",
|
||||
paramtype = "light",
|
||||
@@ -120,9 +113,8 @@ minetest.register_node("fake_fire:fancy_fire", {
|
||||
tiles = {
|
||||
{name="fake_fire_animated.png",
|
||||
animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='fake_fire_logs.png'}},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
on_rightclick = function (pos, node, clicker)
|
||||
start_smoke(pos, node, clicker)
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function (pos)
|
||||
stop_smoke(pos)
|
||||
@@ -143,7 +135,7 @@ minetest.register_node("fake_fire:fancy_fire", {
|
||||
|
||||
-- EMBERS
|
||||
minetest.register_node("fake_fire:embers", {
|
||||
description = S("Glowing Embers"),
|
||||
description = "Glowing Embers",
|
||||
tiles = {
|
||||
{name="embers_animated.png", animation={type="vertical_frames",
|
||||
aspect_w=16, aspect_h=16, length=2}},
|
||||
@@ -155,16 +147,12 @@ minetest.register_node("fake_fire:embers", {
|
||||
})
|
||||
|
||||
-- CHIMNEYS
|
||||
local materials = {
|
||||
{ "stone", S("Stone chimney top") },
|
||||
{ "sandstone", S("Sandstone chimney top") },
|
||||
}
|
||||
local materials = {"stone", "sandstone"}
|
||||
|
||||
for _, mat in ipairs(materials) do
|
||||
local name, desc = unpack(mat)
|
||||
minetest.register_node("fake_fire:chimney_top_"..name, {
|
||||
description = desc,
|
||||
tiles = {"default_"..name..".png^chimney_top.png", "default_"..name..".png"},
|
||||
for _, m in ipairs(materials) do
|
||||
minetest.register_node("fake_fire:chimney_top_"..m, {
|
||||
description = "Chimney Top - "..m,
|
||||
tiles = {"default_"..m..".png^chimney_top.png", "default_"..m..".png"},
|
||||
groups = {snappy=3},
|
||||
paramtype = "light",
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
@@ -173,10 +161,9 @@ for _, mat in ipairs(materials) do
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||
},
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
on_rightclick = function (pos, node, clicker)
|
||||
local chimney = 1
|
||||
start_smoke(pos, node, clicker, chimney)
|
||||
return itemstack
|
||||
end,
|
||||
on_destruct = function (pos)
|
||||
stop_smoke(pos)
|
||||
@@ -185,14 +172,15 @@ for _, mat in ipairs(materials) do
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'fake_fire:chimney_top_'..name,
|
||||
recipe = {"default:torch", "stairs:slab_"..name}
|
||||
output = 'fake_fire:chimney_top_'..m,
|
||||
recipe = {"default:torch", "stairs:slab_"..m}
|
||||
})
|
||||
end
|
||||
|
||||
--[[ --MFF|Darcidride(18/06/2016) Commented because "Flint and Steel" is now on the default "fire" mod
|
||||
-- FLINT and STEEL
|
||||
minetest.register_tool("fake_fire:flint_and_steel", {
|
||||
description = S("Flint and steel"),
|
||||
description = "Flint and steel",
|
||||
inventory_image = "flint_and_steel.png",
|
||||
liquids_pointable = false,
|
||||
stack_max = 1,
|
||||
@@ -210,7 +198,7 @@ minetest.register_tool("fake_fire:flint_and_steel", {
|
||||
minetest.set_node(pointed_thing.above, {name="fake_fire:fake_fire"})
|
||||
end
|
||||
else
|
||||
minetest.chat_send_player(user:get_player_name(), S("This area is protected!"))
|
||||
minetest.chat_send_player(user:get_player_name(), "This area is protected!")
|
||||
end
|
||||
else
|
||||
return
|
||||
@@ -223,11 +211,17 @@ minetest.register_tool("fake_fire:flint_and_steel", {
|
||||
|
||||
-- CRAFTS
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'fake_fire:flint_and_steel',
|
||||
recipe = {"default:obsidian_shard", "default:steel_ingot"}
|
||||
})
|
||||
type = "shapeless",
|
||||
output = 'fake_fire:flint_and_steel',
|
||||
recipe = {
|
||||
"default:obsidian_shard",
|
||||
"default:steel_ingot",
|
||||
"default:coal_lump",
|
||||
"group:wool"
|
||||
}
|
||||
}) --]] --MFF|Darcidride(18/06/2016) Commented because "Flint and Steel" is now on the default "fire" mod
|
||||
|
||||
-- /MFF (Mg|06/24/2015)
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'fake_fire:embers',
|
||||
@@ -245,4 +239,4 @@ minetest.register_alias("fake_fire:smokeless_fire", "fake_fire:fake_fire")
|
||||
minetest.register_alias("fake_fire:smokeless_ice_fire", "fake_fire:ice_fire")
|
||||
minetest.register_alias("fake_fire:smokeless_chimney_top_stone", "fake_fire:chimney_top_stone")
|
||||
minetest.register_alias("fake_fire:smokeless_chimney_top_sandstone", "fake_fire:chimney_top_sandstone")
|
||||
minetest.register_alias("fake_fire:flint", "fake_fire:flint_and_steel")
|
||||
--minetest.register_alias("fake_fire:flint", "fake_fire:flint_and_steel") --MFF|Darcidride(18/06/2016) Commented because "Flint and Steel" is now on the default "fire" mod
|
||||
|
||||
0
fake_fire/models/fancy_fire.obj
Normal file → Executable file
0
fake_fire/sounds/fire_extinguish.ogg
Normal file → Executable file
0
fake_fire/textures/chimney_top.png
Normal file → Executable file
|
Before Width: | Height: | Size: 113 B After Width: | Height: | Size: 113 B |
BIN
fake_fire/textures/embers_animated.png
Normal file → Executable file
|
Before Width: | Height: | Size: 844 B After Width: | Height: | Size: 816 B |
BIN
fake_fire/textures/fake_fire_animated.png
Normal file → Executable file
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.5 KiB |
0
fake_fire/textures/fake_fire_embers.png
Normal file → Executable file
|
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 214 B |
0
fake_fire/textures/fake_fire_inv.png
Normal file → Executable file
|
Before Width: | Height: | Size: 640 B After Width: | Height: | Size: 640 B |
BIN
fake_fire/textures/fake_fire_logs.png
Normal file → Executable file
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
0
fake_fire/textures/fancy_fire_inv.png
Normal file → Executable file
|
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
0
fake_fire/textures/flint_and_steel.png
Normal file → Executable file
|
Before Width: | Height: | Size: 373 B After Width: | Height: | Size: 373 B |
BIN
fake_fire/textures/ice_fire_animated.png
Normal file → Executable file
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
0
fake_fire/textures/ice_fire_inv.png
Normal file → Executable file
|
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 409 B |
0
fake_fire/textures/smoke_particle.png
Normal file → Executable file
|
Before Width: | Height: | Size: 358 B After Width: | Height: | Size: 358 B |