1
0
mirror of https://github.com/D00Med/scifi_nodes.git synced 2024-12-22 16:10:18 +01:00

Changed texture namming policy. Added a door for testing.

This commit is contained in:
Grossam 2019-04-24 12:14:44 +02:00
parent 5f2b22cd55
commit a20f090bf9
51 changed files with 52 additions and 39 deletions

View File

@ -17,13 +17,14 @@
-- This table now uses named parameters and more convenient variables names -- This table now uses named parameters and more convenient variables names
local doors = { local doors = {
-- DOOM door {closed, closed top, opened, opened top, texture number, main ingredient, sound} -- DOOM door {closed, closed top, opened, opened top, texture number, main ingredient, sound}
{base_name = "Doom", tex_number = "1", base_ingredient = "doors:door_obsidian_glass", sound = "scifi_nodes_door_mechanic"}, {base_name = "Doom", base_ingredient = "doors:door_obsidian_glass", sound = "scifi_nodes_door_mechanic"},
-- Black door -- Black door
{base_name = "black", tex_number = "2", base_ingredient = "doors:door_steel", sound = "scifi_nodes_door_mechanic"}, {base_name = "black", base_ingredient = "doors:door_steel", sound = "scifi_nodes_door_mechanic"},
-- White door -- White door
{base_name = "white", tex_number = "3", base_ingredient = "doors:door_glass", sound = "scifi_nodes_door_normal"}, {base_name = "white", base_ingredient = "doors:door_glass", sound = "scifi_nodes_door_normal"},
-- Green door -- Green door
{base_name = "green", tex_number = "4", base_ingredient = "doors:door_wood", sound = "scifi_nodes_door_mechanic"}, {base_name = "green", base_ingredient = "doors:door_wood", sound = "scifi_nodes_door_mechanic"},
{base_name = "blue", base_ingredient = "default:steel_block", sound = "scifi_nodes_door_normal"}
} }
@ -33,15 +34,15 @@ function get_doors_list()
end end
for i in ipairs (doors) do for _, current_door in ipairs(doors) do
local closed = "scifi_nodes:"..doors[i].base_name.."_door_closed" local closed = "scifi_nodes:"..current_door.base_name.."_door_closed"
local closed_top = "scifi_nodes:"..doors[i].base_name.."_door_closed_top" local closed_top = "scifi_nodes:"..current_door.base_name.."_door_closed_top"
local opened = "scifi_nodes:"..doors[i].base_name.."_door_opened" local opened = "scifi_nodes:"..current_door.base_name.."_door_opened"
local opened_top = "scifi_nodes:"..doors[i].base_name.."_door_opened_top" local opened_top = "scifi_nodes:"..current_door.base_name.."_door_opened_top"
local tex_number = doors[i].tex_number local base_name = current_door.base_name
local base_ingredient = doors[i].base_ingredient local base_ingredient = current_door.base_ingredient
local sound = doors[i].sound local sound = current_door.sound
minetest.register_craft({ minetest.register_craft({
output = closed .. " 2", output = closed .. " 2",
@ -222,16 +223,16 @@ function ontimer(pos, elapsed)
end end
minetest.register_node(closed, { minetest.register_node(closed, {
description = doors[i].base_name.." sliding door", description = current_door.base_name.." sliding door",
inventory_image = "scifi_nodes_door"..tex_number.."a_inv.png", inventory_image = "scifi_nodes_door_"..base_name.."_inv.png",
wield_image = "scifi_nodes_door"..tex_number.."a_inv.png", wield_image = "scifi_nodes_door_"..base_name.."_inv.png",
tiles = { tiles = {
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_rbottom.png", "scifi_nodes_door_"..base_name.."_rbottom.png",
"scifi_nodes_door"..tex_number.."a_bottom.png" "scifi_nodes_door_"..base_name.."_bottom.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
@ -249,6 +250,18 @@ minetest.register_node(closed, {
{-0.5, -0.5, -0.0625, 0.5, 1.5, 0.0625} {-0.5, -0.5, -0.0625, 0.5, 1.5, 0.0625}
} }
}, },
mesecon = {
effector = {
action_on = function (pos, node)
minetest.sound_play(sound, {
max_hear_distance = 16,
pos = pos,
gain = 1.0
})
end,
rules = mesecon.rules.pplate
},
},
on_place = onplace, on_place = onplace,
@ -259,12 +272,12 @@ on_rightclick = rightclick,
minetest.register_node(closed_top, { minetest.register_node(closed_top, {
tiles = { tiles = {
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_rtop.png", "scifi_nodes_door_"..base_name.."_rtop.png",
"scifi_nodes_door"..tex_number.."a_top.png" "scifi_nodes_door_"..base_name.."_top.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
@ -286,12 +299,12 @@ minetest.register_node(closed_top, {
minetest.register_node(opened, { minetest.register_node(opened, {
tiles = { tiles = {
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_rbottom0.png", "scifi_nodes_door_"..base_name.."_rbottom0.png",
"scifi_nodes_door"..tex_number.."a_bottom0.png" "scifi_nodes_door_"..base_name.."_bottom0.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",
@ -317,12 +330,12 @@ on_timer = ontimer,
minetest.register_node(opened_top, { minetest.register_node(opened_top, {
tiles = { tiles = {
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_edge.png", "scifi_nodes_door_"..base_name.."_edge.png",
"scifi_nodes_door"..tex_number.."a_rtopo.png", "scifi_nodes_door_"..base_name.."_rtopo.png",
"scifi_nodes_door"..tex_number.."a_topo.png" "scifi_nodes_door_"..base_name.."_topo.png"
}, },
drawtype = "nodebox", drawtype = "nodebox",
paramtype = "light", paramtype = "light",

View File

Before

Width:  |  Height:  |  Size: 754 B

After

Width:  |  Height:  |  Size: 754 B

View File

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 314 B

View File

Before

Width:  |  Height:  |  Size: 91 B

After

Width:  |  Height:  |  Size: 91 B

View File

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 502 B

View File

Before

Width:  |  Height:  |  Size: 780 B

After

Width:  |  Height:  |  Size: 780 B

View File

Before

Width:  |  Height:  |  Size: 308 B

After

Width:  |  Height:  |  Size: 308 B

View File

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 637 B

View File

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 270 B

View File

Before

Width:  |  Height:  |  Size: 691 B

After

Width:  |  Height:  |  Size: 691 B

View File

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

View File

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 324 B

View File

Before

Width:  |  Height:  |  Size: 188 B

After

Width:  |  Height:  |  Size: 188 B

View File

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 70 B

View File

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 347 B

View File

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 351 B

View File

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 212 B

View File

Before

Width:  |  Height:  |  Size: 401 B

After

Width:  |  Height:  |  Size: 401 B

View File

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 269 B

View File

Before

Width:  |  Height:  |  Size: 385 B

After

Width:  |  Height:  |  Size: 385 B

View File

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

View File

Before

Width:  |  Height:  |  Size: 382 B

After

Width:  |  Height:  |  Size: 382 B

View File

Before

Width:  |  Height:  |  Size: 187 B

After

Width:  |  Height:  |  Size: 187 B

View File

Before

Width:  |  Height:  |  Size: 91 B

After

Width:  |  Height:  |  Size: 91 B

View File

Before

Width:  |  Height:  |  Size: 299 B

After

Width:  |  Height:  |  Size: 299 B

View File

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 373 B

View File

Before

Width:  |  Height:  |  Size: 194 B

After

Width:  |  Height:  |  Size: 194 B

View File

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 367 B

View File

Before

Width:  |  Height:  |  Size: 159 B

After

Width:  |  Height:  |  Size: 159 B

View File

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 351 B

View File

Before

Width:  |  Height:  |  Size: 161 B

After

Width:  |  Height:  |  Size: 161 B

View File

Before

Width:  |  Height:  |  Size: 204 B

After

Width:  |  Height:  |  Size: 204 B

View File

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 138 B

View File

Before

Width:  |  Height:  |  Size: 70 B

After

Width:  |  Height:  |  Size: 70 B

View File

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 214 B

View File

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 218 B

View File

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 166 B

View File

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 258 B

View File

Before

Width:  |  Height:  |  Size: 164 B

After

Width:  |  Height:  |  Size: 164 B

View File

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View File

Before

Width:  |  Height:  |  Size: 145 B

After

Width:  |  Height:  |  Size: 145 B