1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-23 00:20:17 +01:00

import model, textures, and some properties from googol's new_campfire mod

to freshen-up the look of "fancy fire"

(no, you still can't cook with this fire :P )
This commit is contained in:
VanessaE 2020-06-03 00:11:42 -04:00
parent 43333687bd
commit ce3c77564c
7 changed files with 1201 additions and 160 deletions

View File

@ -3,7 +3,80 @@ local S = homedecor.gettext
screwdriver = screwdriver or {} screwdriver = screwdriver or {}
local function start_smoke(pos, node, clicker, chimney) local function fire_particles_on(pos) -- 3 layers of fire
local meta = minetest.get_meta(pos)
local id = minetest.add_particlespawner({ -- 1 layer big particles fire
amount = 9,
time = 0,
minpos = {x = pos.x - 0.2, y = pos.y - 0.4, z = pos.z - 0.2},
maxpos = {x = pos.x + 0.2, y = pos.y - 0.1, z = pos.z + 0.2},
minvel = {x= 0, y= 0, z= 0},
maxvel = {x= 0, y= 0.1, z= 0},
minacc = {x= 0, y= 0, z= 0},
maxacc = {x= 0, y= 0.7, z= 0},
minexptime = 0.5,
maxexptime = 0.7,
minsize = 2,
maxsize = 5,
collisiondetection = false,
vertical = true,
texture = "fake_fire_particle_anim_fire.png",
animation = {type="vertical_frames", aspect_w=16, aspect_h=16, length = 0.8,},
})
meta:set_int("layer_1", id)
local id = minetest.add_particlespawner({ -- 2 layer smol particles fire
amount = 1,
time = 0,
minpos = {x = pos.x - 0.1, y = pos.y, z = pos.z - 0.1},
maxpos = {x = pos.x + 0.1, y = pos.y + 0.4, z = pos.z + 0.1},
minvel = {x= 0, y= 0, z= 0},
maxvel = {x= 0, y= 0.1, z= 0},
minacc = {x= 0, y= 0, z= 0},
maxacc = {x= 0, y= 1, z= 0},
minexptime = 0.4,
maxexptime = 0.6,
minsize = 0.5,
maxsize = 0.7,
collisiondetection = false,
vertical = true,
texture = "fake_fire_particle_anim_fire.png",
animation = {type="vertical_frames", aspect_w=16, aspect_h=16, length = 0.7,},
})
meta:set_int("layer_2", id)
local id = minetest.add_particlespawner({ --3 layer smoke
amount = 1,
time = 0,
minpos = {x = pos.x - 0.1, y = pos.y - 0.2, z = pos.z - 0.1},
maxpos = {x = pos.x + 0.2, y = pos.y + 0.4, z = pos.z + 0.2},
minvel = {x= 0, y= 0, z= 0},
maxvel = {x= 0, y= 0.1, z= 0},
minacc = {x= 0, y= 0, z= 0},
maxacc = {x= 0, y= 1, z= 0},
minexptime = 0.6,
maxexptime = 0.8,
minsize = 2,
maxsize = 4,
collisiondetection = true,
vertical = true,
texture = "fake_fire_particle_anim_smoke.png",
animation = {type="vertical_frames", aspect_w=16, aspect_h=16, length = 0.9,},
})
meta:set_int("layer_3", id)
end
local function fire_particles_off(pos)
local meta = minetest.get_meta(pos)
local id_1 = meta:get_int("layer_1");
local id_2 = meta:get_int("layer_2");
local id_3 = meta:get_int("layer_3");
minetest.delete_particlespawner(id_1)
minetest.delete_particlespawner(id_2)
minetest.delete_particlespawner(id_3)
end
local function start_fire_effects(pos, node, clicker, chimney)
local this_spawner_meta = minetest.get_meta(pos) local this_spawner_meta = minetest.get_meta(pos)
local id = this_spawner_meta:get_int("smoky") local id = this_spawner_meta:get_int("smoky")
local s_handle = this_spawner_meta:get_int("sound") local s_handle = this_spawner_meta:get_int("sound")
@ -41,7 +114,7 @@ local function start_smoke(pos, node, clicker, chimney)
max_hear_distance = 5, max_hear_distance = 5,
loop = true loop = true
}) })
this_spawner_meta:set_int("smoky", id) fire_particles_on(pos)
this_spawner_meta:set_int("sound", s_handle) this_spawner_meta:set_int("sound", s_handle)
end end
end end
@ -83,7 +156,7 @@ minetest.register_node("fake_fire:ice_fire", {
aspect_w=16, aspect_h=16, length=1.5}}, aspect_w=16, aspect_h=16, length=1.5}},
}, },
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
start_smoke(pos, node, clicker) start_fire_effects(pos, node, clicker)
return itemstack return itemstack
end, end,
on_destruct = function (pos) on_destruct = function (pos)
@ -97,6 +170,11 @@ minetest.register_node("fake_fire:ice_fire", {
minetest.register_alias("fake_fire:fake_fire", "fire:permanent_flame") minetest.register_alias("fake_fire:fake_fire", "fire:permanent_flame")
local sbox = {
type = 'fixed',
fixed = { -8/16, -8/16, -8/16, 8/16, -6/16, 8/16},
}
minetest.register_node("fake_fire:fancy_fire", { minetest.register_node("fake_fire:fancy_fire", {
inventory_image = "fancy_fire_inv.png", inventory_image = "fancy_fire_inv.png",
description = S("Fancy Fire"), description = S("Fancy Fire"),
@ -104,21 +182,28 @@ minetest.register_node("fake_fire:fancy_fire", {
mesh = "fancy_fire.obj", mesh = "fancy_fire.obj",
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
groups = {dig_immediate=3}, groups = {oddly_breakable_by_hand=3, flammable=0},
sunlight_propagates = true, sunlight_propagates = true,
light_source = 14, light_source = 13,
walkable = false, walkable = false,
damage_per_second = 4, buildable_to = false,
on_rotate = screwdriver.rotate_simple, damage_per_second = 3,
selection_box = sbox,
tiles = { tiles = {
{name="fake_fire_animated.png", "basic_materials_concrete_block.png",
animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='fake_fire_logs.png'}}, "default_junglewood.png",
"fake_fire_empty_tile.png"
},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
start_smoke(pos, node, clicker) fire_particles_on(pos)
return itemstack return itemstack
end, end,
on_destruct = function (pos) on_construct = function(pos)
stop_smoke(pos) local meta = minetest.get_meta(pos)
fire_particles_on(pos)
end,
on_destruct = function(pos, oldnode, oldmetadata, digger)
fire_particles_off(pos)
minetest.sound_play("fire_extinguish", { minetest.sound_play("fire_extinguish", {
pos = pos, max_hear_distance = 5 pos = pos, max_hear_distance = 5
}) })
@ -168,7 +253,7 @@ for _, mat in ipairs(materials) do
}, },
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local chimney = 1 local chimney = 1
start_smoke(pos, node, clicker, chimney) start_fire_effects(pos, node, clicker, chimney)
return itemstack return itemstack
end, end,
on_destruct = function (pos) on_destruct = function (pos)

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

0
homedecor_common/tools/updatepo.sh Executable file → Normal file
View File