1
0
Fork 0

Change torch model, add soul fire flame particle texture

pvp_knockback
talamh 2022-10-10 20:50:11 +01:00
parent 0c4edbc4ac
commit 23ec60fff0
12 changed files with 167 additions and 67 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 B

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 B

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -342,6 +342,7 @@ mcl_torches.register_torch({
groups = {dig_immediate = 3, deco_block = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
particles = true,
flame_type = 2,
})
minetest.register_craft({

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 239 B

View File

@ -1,3 +1,5 @@
local flame_texture = {"mcl_particles_flame.png", "mcl_particles_soul_fire_flame.png"}
local smoke_pdef = {
amount = 0.5,
maxexptime = 2.0,
@ -9,7 +11,8 @@ local smoke_pdef = {
maxrelpos = { x = 1/16, y = 0.06, z = 1/16 },
}
local function spawn_flames_floor(pos)
local function spawn_flames_floor(pos, flame_type)
-- Flames
mcl_particles.add_node_particlespawner(pos, {
amount = 8,
@ -22,32 +25,32 @@ local function spawn_flames_floor(pos)
maxexptime = 0.6,
minsize = 0.7,
maxsize = 2,
texture = "mcl_particles_flame.png",
texture = flame_texture[flame_type],
glow = minetest.registered_nodes[minetest.get_node(pos).name].light_source,
}, "low")
-- Smoke
mcl_particles.spawn_smoke(pos, "torch", smoke_pdef)
end
local function spawn_flames_wall(pos)
local function spawn_flames_wall(pos, flame_type)
--local minrelpos, maxrelpos
local node = minetest.get_node(pos)
local dir = minetest.wallmounted_to_dir(node.param2)
local smoke_pdef = table.copy(smoke_pdef)
if dir.x < 0 then
smoke_pdef.minrelpos = { x = -0.38, y = 0.04, z = -0.1 }
smoke_pdef.maxrelpos = { x = -0.2, y = 0.14, z = 0.1 }
smoke_pdef.minrelpos = { x = -0.38, y = 0.24, z = -0.1 }
smoke_pdef.maxrelpos = { x = -0.2, y = 0.34, z = 0.1 }
elseif dir.x > 0 then
smoke_pdef.minrelpos = { x = 0.2, y = 0.04, z = -0.1 }
smoke_pdef.maxrelpos = { x = 0.38, y = 0.14, z = 0.1 }
smoke_pdef.minrelpos = { x = 0.2, y = 0.24, z = -0.1 }
smoke_pdef.maxrelpos = { x = 0.38, y = 0.34, z = 0.1 }
elseif dir.z < 0 then
smoke_pdef.minrelpos = { x = -0.1, y = 0.04, z = -0.38 }
smoke_pdef.maxrelpos = { x = 0.1, y = 0.14, z = -0.2 }
smoke_pdef.minrelpos = { x = -0.1, y = 0.24, z = -0.38 }
smoke_pdef.maxrelpos = { x = 0.1, y = 0.34, z = -0.2 }
elseif dir.z > 0 then
smoke_pdef.minrelpos = { x = -0.1, y = 0.04, z = 0.2 }
smoke_pdef.maxrelpos = { x = 0.1, y = 0.14, z = 0.38 }
smoke_pdef.minrelpos = { x = -0.1, y = 0.24, z = 0.2 }
smoke_pdef.maxrelpos = { x = 0.1, y = 0.34, z = 0.38 }
else
return
end
@ -65,13 +68,25 @@ local function spawn_flames_wall(pos)
maxexptime = 0.6,
minsize = 0.7,
maxsize = 2,
texture = "mcl_particles_flame.png",
texture = flame_texture[flame_type],
glow = minetest.registered_nodes[node.name].light_source,
}, "low")
-- Smoke
mcl_particles.spawn_smoke(pos, "torch", smoke_pdef)
end
local function set_flames(pos, flame_type, attached_to)
if attached_to == "wall" then
return function(pos)
spawn_flames_wall(pos, flame_type)
end
end
return function(pos)
spawn_flames_floor(pos, flame_type)
end
end
local function remove_flames(pos)
mcl_particles.delete_node_particlespawners(pos)
end
@ -124,6 +139,7 @@ function mcl_torches.register_torch(def)
def.light = def.light or minetest.LIGHT_MAX
def.mesh_floor = def.mesh_floor or "mcl_torches_torch_floor.obj"
def.mesh_wall = def.mesh_wall or "mcl_torches_torch_wall.obj"
def.flame_type = def.flame_type or 1
local groups = def.groups or {}
@ -133,7 +149,8 @@ function mcl_torches.register_torch(def)
groups.dig_by_water = 1
groups.destroy_by_lava_flow = 1
groups.dig_by_piston = 1
groups.flame_type = def.flame_type or 1
local floordef = {
description = def.description,
_doc_items_longdesc = def.doc_items_longdesc,
@ -145,7 +162,6 @@ function mcl_torches.register_torch(def)
inventory_image = def.icon,
wield_image = def.icon,
tiles = def.tiles,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
@ -157,8 +173,7 @@ function mcl_torches.register_torch(def)
drop = def.drop or itemstring,
selection_box = {
type = "wallmounted",
wall_top = {-1/16, -1/16, -1/16, 1/16, 0.5, 1/16},
wall_bottom = {-1/16, -0.5, -1/16, 1/16, 1/16, 1/16},
wall_bottom = {-2/16, -0.5, -2/16, 2/16, 1/16, 2/16},
},
sounds = def.sounds,
node_placement_prediction = "",
@ -211,7 +226,7 @@ function mcl_torches.register_torch(def)
return itemstack
end,
on_rotate = false,
on_construct = def.particles and spawn_flames_floor,
on_construct = def.particles and set_flames(pos, def.flame_type, "floor"),
on_destruct = def.particles and remove_flames,
}
minetest.register_node(itemstring, floordef)
@ -223,7 +238,6 @@ function mcl_torches.register_torch(def)
drawtype = "mesh",
mesh = def.mesh_wall,
tiles = def.tiles,
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or false,
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
@ -234,13 +248,11 @@ function mcl_torches.register_torch(def)
drop = def.drop or itemstring,
selection_box = {
type = "wallmounted",
wall_top = {-0.1, -0.1, -0.1, 0.1, 0.5, 0.1},
wall_bottom = {-0.1, -0.5, -0.1, 0.1, 0.1, 0.1},
wall_side = {-0.5, -0.5, -0.1, -0.2, 0.1, 0.1},
wall_side = {-0.5, -0.3, -0.1, -0.2, 0.325, 0.1},
},
sounds = def.sounds,
on_rotate = false,
on_construct = def.particles and spawn_flames_wall,
on_construct = def.particles and set_flames(pos, def.flame_type, "wall"),
on_destruct = def.particles and remove_flames,
}
minetest.register_node(itemstring_wall, walldef)
@ -259,9 +271,9 @@ minetest.register_lbm({
action = function(pos, node)
local torch_group = minetest.get_item_group(node.name, "torch")
if torch_group == 1 then
spawn_flames_floor(pos)
spawn_flames_floor(pos, minetest.get_item_group(node.name, "flame_type"))
elseif torch_group == 2 then
spawn_flames_wall(pos)
spawn_flames_wall(pos, minetest.get_item_group(node.name, "flame_type"))
end
end,
})

View File

@ -1,29 +1,72 @@
# Blender v2.76 (sub 0) OBJ File: 'torch_on_floor_node.blend'
# Blender 3.3.1
# www.blender.org
o torch_Cube_Cube.001_Cube_Cube.001_Material.001
mtllib mcl_torches_torch_floor.mtl
o cube.004
v -0.062500 0.437500 -0.500000
v -0.062500 -0.562500 -0.500000
v -0.062500 0.437500 0.500000
v -0.062500 -0.562500 0.500000
v 0.062500 0.062500 0.062500
v 0.062500 0.062500 -0.062500
v 0.062500 -0.562500 0.062500
v 0.062500 -0.562500 -0.062500
v -0.062500 0.062500 -0.062500
v -0.062500 0.062500 0.062500
v -0.062500 -0.500000 0.062500
v 0.062500 -0.500000 0.062500
v 0.062500 -0.500000 -0.062500
v -0.062500 -0.500000 -0.062500
v -0.062500 -0.562500 -0.062500
v -0.062500 -0.562500 0.062500
v 0.500000 0.437500 0.062500
v 0.500000 -0.562500 0.062500
v -0.500000 0.437500 0.062500
v -0.500000 -0.562500 0.062500
v 0.500000 0.437500 -0.062500
v 0.500000 -0.562500 -0.062500
v -0.500000 0.437500 -0.062500
v -0.500000 -0.562500 -0.062500
v 0.062500 0.437500 -0.500000
v 0.062500 -0.562500 -0.500000
v 0.062500 0.437500 0.500000
v 0.062500 -0.562500 0.500000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 0.562500 0.500000
vt 0.562500 0.625000
vt 0.562500 0.125000
vt 0.562500 0.000063
vt 0.437500 0.625000
vt 0.437500 0.500000
vt 0.437500 0.000000
vt 0.562500 0.000000
vt 0.562500 0.125000
vt 0.437500 0.000063
vt 0.437500 0.125000
vn 0.000000 1.000000 0.000000
vn 0.000000 0.000000 -1.000000
vn 1.000000 0.000000 0.000000
s 1
f 1/1/1 2/2/1 3/3/1 4/4/1
f 5/5/1 6/6/1 7/7/1 8/8/1
f 1/2/2 6/6/2 5/5/2 4/3/2
f 2/3/3 1/2/3 6/6/3 7/5/3
f 3/2/2 2/3/2 7/5/2 8/6/2
f 4/3/3 5/5/3 8/6/3 3/2/3
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
s 0
usemtl m_0.002
f 3/3/1 4/4/1 1/1/1
f 4/4/1 2/2/1 1/1/1
f 9/9/2 10/10/2 6/6/2
f 10/10/2 5/5/2 6/6/2
f 12/12/3 11/11/3 7/7/3
f 11/11/3 8/8/3 7/7/3
f 13/13/4 14/14/4 15/15/4
f 14/14/4 16/16/4 15/15/4
f 19/19/5 20/20/5 17/17/5
f 20/20/5 18/18/5 17/17/5
f 21/21/6 22/22/6 23/23/6
f 22/22/6 24/24/6 23/23/6

View File

@ -1,29 +1,72 @@
# Blender v2.76 (sub 0) OBJ File: 'torch_on_wall_node.blend'
# Blender 3.3.1
# www.blender.org
o torch_wall_Cube_Cube.001_Cube_Cube.001_Material.001
v 0.062469 -0.303502 0.086070
v 0.062469 -0.195248 0.023570
v -0.062531 -0.195248 0.023570
v -0.062531 -0.303502 0.086070
v -0.062531 -0.584752 -0.401070
v 0.062469 -0.584752 -0.401070
v 0.062469 -0.476498 -0.463570
v -0.062531 -0.476498 -0.463570
mtllib mcl_torches_torch_wall.mtl
o cube
v -0.062500 -0.198340 0.273825
v -0.062500 -0.313825 0.321660
v -0.062500 -0.437517 -0.303600
v -0.062500 -0.553002 -0.255765
v 0.062500 -0.313825 0.321660
v 0.062500 -0.198340 0.273825
v 0.062500 -0.553002 -0.255765
v 0.062500 -0.437517 -0.303600
v -0.500000 -0.054833 0.620280
v -0.500000 -0.437517 -0.303600
v 0.500000 -0.054834 0.620280
v 0.500000 -0.437517 -0.303600
v -0.500000 -0.170318 0.668115
v -0.500000 -0.553002 -0.255765
v 0.500000 -0.170318 0.668115
v 0.500000 -0.553002 -0.255765
v -0.062500 -0.574516 0.835539
v -0.062500 -0.957199 -0.088340
v -0.062500 0.349364 0.452856
v -0.062500 -0.033320 -0.471024
v 0.062500 -0.574516 0.835539
v 0.062500 -0.957199 -0.088340
v 0.062500 0.349364 0.452856
v 0.062500 -0.033320 -0.471024
vn -0.0000 0.3827 0.9239
vn -0.0000 -0.3827 -0.9239
vn -0.0000 -0.9239 0.3827
vn -0.0000 0.9239 -0.3827
vn 1.0000 -0.0000 -0.0000
vn -1.0000 -0.0000 -0.0000
vt 0.562500 0.500000
vt 0.562500 0.625000
vt 0.562500 0.125000
vt 0.562500 0.000063
vt 0.437500 0.625000
vt 0.437500 0.500000
vt 0.437500 0.000000
vt 0.562500 0.000000
vt 0.562500 0.125000
vt 0.437500 0.000063
vt 0.437500 0.125000
vn 0.000000 0.500000 0.866000
vn 0.000000 0.866000 -0.500000
vn 1.000000 -0.000000 0.000000
s 1
f 1/1/1 2/2/1 3/3/1 4/4/1
f 5/5/1 6/6/1 7/7/1 8/8/1
f 1/2/2 6/6/2 5/5/2 4/3/2
f 2/3/3 1/2/3 6/6/3 7/5/3
f 3/2/2 2/3/2 7/5/2 8/6/2
f 4/3/3 5/5/3 8/6/3 3/2/3
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
s 0
usemtl m_0.001
f 5/5/1 6/6/1 2/2/1
f 6/6/1 1/1/1 2/2/1
f 8/8/2 7/7/2 3/3/2
f 7/7/2 4/4/2 3/3/2
f 9/9/3 10/10/3 11/11/3
f 10/10/3 12/12/3 11/11/3
f 15/15/4 16/16/4 13/13/4
f 16/16/4 14/14/4 13/13/4
f 17/17/5 18/18/5 19/19/5
f 18/18/5 20/20/5 19/19/5
f 23/23/6 24/24/6 21/21/6
f 24/24/6 22/22/6 21/21/6

View File

@ -15,6 +15,7 @@ mcl_torches.register_torch({
groups = {dig_immediate = 3, deco_block = 1},
sounds = mcl_sounds.node_sound_wood_defaults(),
particles = true,
flame_type = 1,
})
minetest.register_craft({

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 B

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 199 B