New interior door style for non-exit doors

This commit is contained in:
Skivling 2024-06-16 21:35:39 +12:00
parent 97235a0ab7
commit cf5532d623
3 changed files with 53 additions and 29 deletions

View File

@ -10,12 +10,19 @@ local S = minetest.get_translator("drwho_tardis")
--data = minetest.get_mod_storage()
-- In the node metadata, there is the value 'type'. 'exit' if it is the door to leave the Tardis,
-- and there are two other possbible doors with values '1' and '2'. These will be able to go to
-- other rooms in future updates.
minetest.register_node("drwho_tardis:in_door", {
description = S("Tardis Interior Door"),
tiles = {"inside_door.png"},
-- def needs:
-- itemstring
-- texture
-- description
local function register_door_style(def)
-- In the node metadata, there is the value 'type'. 'exit' if it is the door to leave the Tardis,
-- and there are two other possbible doors with values 'door_1' and 'door_2'. These will be able to go to
-- other rooms in future updates.
minetest.register_node(def.itemstring, {
description = S(def.description),
tiles = {def.texture},
drawtype = "mesh",
use_texture_alpha = "clip",
mesh = "tardis.obj",
@ -34,11 +41,11 @@ minetest.register_node("drwho_tardis:in_door", {
{-0.5, -0.5,-0.5 ,-0.48, 1.5, 0.5},
{-0.7, -0.6,-0.7, 0.7, -0.48,0.7},
}
},
},
sunlight_propagates = true,
groups = {not_in_creative_inventory = 1, cracky=2},
diggable = false,
on_timer = function(pos)
groups = {cracky=2},
diggable = true,
on_timer = function(pos)
local meta = minetest.get_meta(pos)
local type = meta:get_string("type") or "exit"
local objs = minetest.get_objects_inside_radius(pos, 0.9)
@ -112,30 +119,47 @@ minetest.register_node("drwho_tardis:in_door", {
return true
end
end
})
minetest.register_node("drwho_tardis:in_door_locked", {
description = S("Locked Tardis Interior Door"),
tiles = {"inside_door.png"},
drawtype = "mesh",
use_texture_alpha = "clip",
mesh = "tardis.obj",
selection_box = {
end
})
minetest.register_node(def.itemstring.."_locked", {
description = S("Locked @1", def.description),
tiles = {texture},
drawtype = "mesh",
use_texture_alpha = "clip",
mesh = "tardis.obj",
selection_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 },
},
},
collision_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 },
},
},
collision_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 },
},
},
sunlight_propagates = true,
groups = {not_in_creative_inventory = 1},
diggable = false,
},
sunlight_propagates = true,
groups = {not_in_creative_inventory = 1},
diggable = false,
})
end
register_door_style({
texture = "inside_door.png",
description = "Tardis Interior Door (style A)",
itemstring = "drwho_tardis:in_door"
})
register_door_style({
texture = "drwho_tardis_inside_door_b.png",
description = "Tardis Interior Door (style B)",
itemstring = "drwho_tardis:in_door_b"
})
-- False trigger translation
local qwerty = S("Tardis Interior Door (style A)")
minetest.register_node("drwho_tardis:wall", {
description = S("Tardis Wall (non-craftable)"),

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B