Fix the indentation (Again)
parent
a465c32abc
commit
d80f624788
318
demat.lua
318
demat.lua
|
@ -1,226 +1,226 @@
|
|||
function tardis.demat (owner)
|
||||
local pos = tardis.tardises [owner]["exterior"]
|
||||
local pos = tardis.tardises [owner]["exterior"]
|
||||
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat"})
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat"})
|
||||
|
||||
tardis.tardises [owner]["in_vortex"] = true
|
||||
tardis.tardises [owner]["in_vortex"] = true
|
||||
|
||||
minetest.sound_play ("tardis_demat", {
|
||||
pos = pos ,
|
||||
max_hear_distance = 100 ,
|
||||
gain = 10 ,
|
||||
})
|
||||
minetest.sound_play ("tardis_demat", {
|
||||
pos = pos ,
|
||||
max_hear_distance = 100 ,
|
||||
gain = 10 ,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
minetest.register_node ("tardis:tardis_demat", {
|
||||
tiles = {"tardis_exterior.png^[opacity:255"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 5 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:255"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 5 ,
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_1"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_1"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(7)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(7)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_demat_1", {
|
||||
tiles = {"tardis_exterior.png^[opacity:225"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:225"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_2"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_2"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_demat_2", {
|
||||
tiles = {"tardis_exterior.png^[opacity:200"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_exterior.png^[opacity:200"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_3"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_3"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node("tardis:tardis_demat_3", {
|
||||
tiles = {"tardis_exterior.png^[opacity:175"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:175"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_4"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_4"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_demat_4", {
|
||||
tiles = {"tardis_exterior.png^[opacity:150"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_exterior.png^[opacity:150"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_5"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_5"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(0.5)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(0.5)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_demat_5", {
|
||||
tiles = {"tardis_exterior.png^[opacity:125"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:125"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_6"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_6"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_demat_6", {
|
||||
tiles = {"tardis_exterior.png^[opacity:100"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_exterior.png^[opacity:100"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_7"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_7"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_demat_7", {
|
||||
tiles = {"tardis_exterior.png^[opacity:75"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
light_source = 10 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:75"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
light_source = 10 ,
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_8"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_8"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_demat_8", {
|
||||
tiles = {"tardis_exterior.png^[opacity:50"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_exterior.png^[opacity:50"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_9"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_9"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_demat_9", {
|
||||
tiles = {"tardis_exterior.png^[opacity:25"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 7 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:25"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 7 ,
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_10"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_10"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_demat_10", {
|
||||
tiles = {"tardis_exterior.png^[opacity:10"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_exterior.png^[opacity:10"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_11"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_demat_11"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(0.5)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(0.5)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_demat_11", {
|
||||
tiles = {"tardis_exterior.png^[opacity:5"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 5 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:5"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 5 ,
|
||||
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "air"})
|
||||
minetest.forceload_free_block (pos)
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
minetest.set_node (pos, {name = "air"})
|
||||
minetest.forceload_free_block (pos)
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
|
104
functions.lua
104
functions.lua
|
@ -3,75 +3,75 @@ local modpath = minetest.get_modpath(modname)
|
|||
local worldpath = minetest.get_worldpath()
|
||||
|
||||
function tardis.swap_node (pos, name)
|
||||
local meta = minetest.get_meta (pos)
|
||||
local meta_old = meta:to_table()
|
||||
local meta = minetest.get_meta (pos)
|
||||
local meta_old = meta:to_table()
|
||||
|
||||
minetest.set_node (pos, name)
|
||||
minetest.set_node (pos, name)
|
||||
|
||||
local meta = minetest.get_meta (pos)
|
||||
meta:from_table (meta_old)
|
||||
local meta = minetest.get_meta (pos)
|
||||
meta:from_table (meta_old)
|
||||
end
|
||||
|
||||
|
||||
function tardis:spawn_interior (pos, owner)
|
||||
local place_pos = {
|
||||
x = pos ["x"] ,
|
||||
y = 30000 ,
|
||||
z = pos ["z"] ,
|
||||
}
|
||||
local interior_doors_pos = {
|
||||
x = (place_pos ["x"] + 5) ,
|
||||
y = (place_pos ["y"] + 1) ,
|
||||
z = (place_pos ["z"] + 1) ,
|
||||
}
|
||||
local demat_lever_pos = {
|
||||
x = (place_pos ["x"] + 4) ,
|
||||
y = (place_pos ["y"] + 2) ,
|
||||
z = (place_pos ["z"] + 7) ,
|
||||
}
|
||||
local place_pos = {
|
||||
x = pos ["x"] ,
|
||||
y = 30000 ,
|
||||
z = pos ["z"] ,
|
||||
}
|
||||
local interior_doors_pos = {
|
||||
x = (place_pos ["x"] + 5) ,
|
||||
y = (place_pos ["y"] + 1) ,
|
||||
z = (place_pos ["z"] + 1) ,
|
||||
}
|
||||
local demat_lever_pos = {
|
||||
x = (place_pos ["x"] + 4) ,
|
||||
y = (place_pos ["y"] + 2) ,
|
||||
z = (place_pos ["z"] + 7) ,
|
||||
}
|
||||
|
||||
minetest.place_schematic (place_pos, modpath .. "/schematics/tardis_interior.mts")
|
||||
minetest.place_schematic (place_pos, modpath .. "/schematics/tardis_interior.mts")
|
||||
|
||||
tardis.tardises [owner] = {}
|
||||
tardis.tardises [owner]["exterior"] = pos
|
||||
tardis.tardises [owner]["interior"] = interior_doors_pos
|
||||
tardis.tardises [owner]["in_vortex"] = false
|
||||
tardis.tardises [owner] = {}
|
||||
tardis.tardises [owner]["exterior"] = pos
|
||||
tardis.tardises [owner]["interior"] = interior_doors_pos
|
||||
tardis.tardises [owner]["in_vortex"] = false
|
||||
|
||||
local demat_meta = minetest.get_meta (demat_lever_pos)
|
||||
demat_meta:set_string ("owner", owner)
|
||||
local demat_meta = minetest.get_meta (demat_lever_pos)
|
||||
demat_meta:set_string ("owner", owner)
|
||||
|
||||
local interior_doors_meta = minetest.get_meta (interior_doors_pos)
|
||||
interior_doors_meta:set_string ("owner", owner)
|
||||
local interior_doors_meta = minetest.get_meta (interior_doors_pos)
|
||||
interior_doors_meta:set_string ("owner", owner)
|
||||
|
||||
minetest.log("info", minetest.pos_to_string (tardis.tardises [owner]["interior"] ))
|
||||
minetest.log("info", minetest.pos_to_string (tardis.tardises [owner]["interior"] ))
|
||||
|
||||
local file = io.open (worldpath .. "/tardis.tardises", "w+")
|
||||
file:write ( minetest.serialize (tardis.tardises) )
|
||||
file:close()
|
||||
local file = io.open (worldpath .. "/tardis.tardises", "w+")
|
||||
file:write ( minetest.serialize (tardis.tardises) )
|
||||
file:close()
|
||||
end
|
||||
|
||||
function tardis.set_nav (player, owner)
|
||||
local player_name = player:get_player_name()
|
||||
local player_name = player:get_player_name()
|
||||
|
||||
minetest.show_formspec (player_name, "tardis:remat_form",
|
||||
"size[7,3]" ..
|
||||
"field[1,1.5;2,1;x;X;]" ..
|
||||
"field[3,1.5;2,1;y;Y;]" ..
|
||||
"field[5,1.5;2,1;z;Z;]" ..
|
||||
"button_exit[1,2;2,1;exit;Go!]")
|
||||
minetest.show_formspec (player_name, "tardis:remat_form",
|
||||
"size[7,3]" ..
|
||||
"field[1,1.5;2,1;x;X;]" ..
|
||||
"field[3,1.5;2,1;y;Y;]" ..
|
||||
"field[5,1.5;2,1;z;Z;]" ..
|
||||
"button_exit[1,2;2,1;exit;Go!]")
|
||||
|
||||
minetest.register_on_player_receive_fields (function (player, formname, fields)
|
||||
if formname ~= "tardis:remat_form" then
|
||||
return false
|
||||
end
|
||||
minetest.register_on_player_receive_fields (function (player, formname, fields)
|
||||
if formname ~= "tardis:remat_form" then
|
||||
return false
|
||||
end
|
||||
|
||||
local coords = {x = tonumber(fields.x), y = tonumber(fields.y), z = tonumber(fields.z)}
|
||||
local coords = {x = tonumber(fields.x), y = tonumber(fields.y), z = tonumber(fields.z)}
|
||||
|
||||
if (coords == nil) then
|
||||
minetest.chat_send_player (player_name, "Please Enter Valid Coords")
|
||||
else
|
||||
tardis.tardises [owner]["destination"] = coords
|
||||
return true
|
||||
end
|
||||
end)
|
||||
if (coords == nil) then
|
||||
minetest.chat_send_player (player_name, "Please Enter Valid Coords")
|
||||
else
|
||||
tardis.tardises [owner]["destination"] = coords
|
||||
return true
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
28
init.lua
28
init.lua
|
@ -13,26 +13,26 @@ dofile (modpath .. "/nodes.lua")
|
|||
local file = io.open (worldpath .. "/tardis.tardises", "r")
|
||||
|
||||
if file then
|
||||
tardis.tardises = minetest.deserialize (file:read("*all"))
|
||||
file:close()
|
||||
tardis.tardises = minetest.deserialize (file:read("*all"))
|
||||
file:close()
|
||||
end
|
||||
|
||||
minetest.register_chatcommand ("set_nav", {
|
||||
description = "Sets the navigation coordinates for your TARDIS.",
|
||||
func = function (name, param)
|
||||
if (tardis.tardises [name] == nil) then
|
||||
name.chat_send_player (name, "Must be owner!")
|
||||
else
|
||||
local owner = name
|
||||
local player = minetest.get_player_by_name (name)
|
||||
description = "Sets the navigation coordinates for your TARDIS.",
|
||||
func = function (name, param)
|
||||
if (tardis.tardises [name] == nil) then
|
||||
name.chat_send_player (name, "Must be owner!")
|
||||
else
|
||||
local owner = name
|
||||
local player = minetest.get_player_by_name (name)
|
||||
|
||||
tardis.set_nav (player, owner)
|
||||
end
|
||||
tardis.set_nav (player, owner)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_shutdown( function()
|
||||
local file = io.open (worldpath .. "/tardis.tardises", "w+")
|
||||
file:write(minetest.serialize (tardis.tardises) )
|
||||
file:close()
|
||||
local file = io.open (worldpath .. "/tardis.tardises", "w+")
|
||||
file:write(minetest.serialize (tardis.tardises) )
|
||||
file:close()
|
||||
end )
|
||||
|
|
182
nodes.lua
182
nodes.lua
|
@ -1,120 +1,120 @@
|
|||
minetest.register_node ("tardis:tardis", {
|
||||
decription = "Time And Relative Dimention In Space" ,
|
||||
tiles = { "tardis_exterior.png" } ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
decription = "Time And Relative Dimention In Space" ,
|
||||
tiles = { "tardis_exterior.png" } ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_place = function (itemstack, placer, pointed_thing)
|
||||
local pos = pointed_thing.above
|
||||
local player = placer:get_player_name()
|
||||
tardis.swap_node (pos, {name = "tardis:tardis"})
|
||||
on_place = function (itemstack, placer, pointed_thing)
|
||||
local pos = pointed_thing.above
|
||||
local player = placer:get_player_name()
|
||||
tardis.swap_node (pos, {name = "tardis:tardis"})
|
||||
|
||||
if (player == nil) then
|
||||
local meta = minetest.get_meta (pos)
|
||||
local player = meta:get_string ("owner")
|
||||
tardis.tardises [player]["exterior"] = pos
|
||||
elseif (tardis.tardises [player] == nil) then
|
||||
tardis:spawn_interior (pos, player)
|
||||
else
|
||||
tardis.tardises [player]["exterior"] = pos
|
||||
end
|
||||
if (player == nil) then
|
||||
local meta = minetest.get_meta (pos)
|
||||
local player = meta:get_string ("owner")
|
||||
tardis.tardises [player]["exterior"] = pos
|
||||
elseif (tardis.tardises [player] == nil) then
|
||||
tardis:spawn_interior (pos, player)
|
||||
else
|
||||
tardis.tardises [player]["exterior"] = pos
|
||||
end
|
||||
|
||||
local meta = minetest.get_meta (pos)
|
||||
meta:set_string ("owner", player)
|
||||
itemstack:take_item (1)
|
||||
end ,
|
||||
local meta = minetest.get_meta (pos)
|
||||
meta:set_string ("owner", player)
|
||||
itemstack:take_item (1)
|
||||
end ,
|
||||
|
||||
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta (pos)
|
||||
local owner = meta:get_string ("owner")
|
||||
local teleport = tardis.tardises [owner]["interior"]
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta (pos)
|
||||
local owner = meta:get_string ("owner")
|
||||
local teleport = tardis.tardises [owner]["interior"]
|
||||
|
||||
player.setpos (player, teleport)
|
||||
--player.set_look_horizontal(0)
|
||||
end ,
|
||||
player.setpos (player, teleport)
|
||||
--player.set_look_horizontal(0)
|
||||
end ,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node ("tardis:demat_lever_on", {
|
||||
tiles = {"tardis_demat.png"} ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_demat_on.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_demat.png"} ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_demat_on.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
local player_name = player:get_player_name()
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
local player_name = player:get_player_name()
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
|
||||
if (tardis.remat (owner) == false) then
|
||||
minetest.chat_send_player (player_name, "Nav Not Set!!")
|
||||
else
|
||||
minetest.sound_play ("tardis_demat", {
|
||||
pos = pos ,
|
||||
max_hear_distance = 10 ,
|
||||
gain = 10 ,
|
||||
})
|
||||
if (tardis.remat (owner) == false) then
|
||||
minetest.chat_send_player (player_name, "Nav Not Set!!")
|
||||
else
|
||||
minetest.sound_play ("tardis_demat", {
|
||||
pos = pos ,
|
||||
max_hear_distance = 10 ,
|
||||
gain = 10 ,
|
||||
})
|
||||
|
||||
minetest.swap_node (pos, {name = "tardis:demat_lever_off"})
|
||||
end
|
||||
end
|
||||
minetest.swap_node (pos, {name = "tardis:demat_lever_off"})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node ("tardis:demat_lever_off", {
|
||||
groups = {crumbly = 1} ,
|
||||
tiles = {"tardis_demat.png"} ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_demat_off.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
groups = {crumbly = 1} ,
|
||||
tiles = {"tardis_demat.png"} ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_demat_off.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
|
||||
tardis.demat (owner)
|
||||
minetest.sound_play ("tardis_demat", {
|
||||
pos = pos ,
|
||||
max_hear_distance = 10 ,
|
||||
gain = 10 ,
|
||||
})
|
||||
tardis.demat (owner)
|
||||
minetest.sound_play ("tardis_demat", {
|
||||
pos = pos ,
|
||||
max_hear_distance = 10 ,
|
||||
gain = 10 ,
|
||||
})
|
||||
|
||||
minetest.swap_node (pos, {name = "tardis:demat_lever_on"})
|
||||
end ,
|
||||
minetest.swap_node (pos, {name = "tardis:demat_lever_on"})
|
||||
end ,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node ("tardis:interior_doors", {
|
||||
tiles = {"tardis_exterior.png"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_interior_doors.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_exterior.png"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_interior_doors.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta (pos)
|
||||
local owner = meta:get_string ("owner")
|
||||
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta (pos)
|
||||
local owner = meta:get_string ("owner")
|
||||
|
||||
if (tardis.tardises == nil) or
|
||||
(tardis.tardises [owner] == nil) or
|
||||
(tardis.tardises [owner]["in_vortex"] == nil) then
|
||||
minetest.log ("error", "in_vortex not initialised for " .. owner)
|
||||
return
|
||||
end
|
||||
if (tardis.tardises == nil) or
|
||||
(tardis.tardises [owner] == nil) or
|
||||
(tardis.tardises [owner]["in_vortex"] == nil) then
|
||||
minetest.log ("error", "in_vortex not initialised for " .. owner)
|
||||
return
|
||||
end
|
||||
|
||||
if (tardis.tardises [owner]["in_vortex"] == false) then
|
||||
local teleport = tardis.tardises [owner]["exterior"]
|
||||
player:setpos (teleport)
|
||||
else
|
||||
player_name = player:get_player_name()
|
||||
minetest.chat_send_player (player_name, "TARDIS In Vortex, Door Locked Automaticly")
|
||||
end
|
||||
end
|
||||
if (tardis.tardises [owner]["in_vortex"] == false) then
|
||||
local teleport = tardis.tardises [owner]["exterior"]
|
||||
player:setpos (teleport)
|
||||
else
|
||||
player_name = player:get_player_name()
|
||||
minetest.chat_send_player (player_name, "TARDIS In Vortex, Door Locked Automaticly")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
|
284
remat.lua
284
remat.lua
|
@ -1,202 +1,202 @@
|
|||
function tardis.remat (owner)
|
||||
if (tardis.tardises [owner]["destination"] == nil) then
|
||||
return false
|
||||
else
|
||||
local pos = tardis.tardises [owner]["destination"]
|
||||
if (tardis.tardises [owner]["destination"] == nil) then
|
||||
return false
|
||||
else
|
||||
local pos = tardis.tardises [owner]["destination"]
|
||||
|
||||
minetest.forceload_block (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_remat"})
|
||||
minetest.forceload_block (pos)
|
||||
minetest.set_node (pos, {name = "tardis:tardis_remat"})
|
||||
|
||||
local meta = minetest.get_meta (pos)
|
||||
meta:set_string ("owner", owner)
|
||||
local meta = minetest.get_meta (pos)
|
||||
meta:set_string ("owner", owner)
|
||||
|
||||
tardis.tardises [owner]["exterior"] = pos
|
||||
tardis.tardises [owner]["exterior"] = pos
|
||||
|
||||
minetest.sound_play ("tardis_remat", {
|
||||
pos = pos ,
|
||||
max_hear_distance = 100 ,
|
||||
gain = 10 ,
|
||||
})
|
||||
end
|
||||
minetest.sound_play ("tardis_remat", {
|
||||
pos = pos ,
|
||||
max_hear_distance = 100 ,
|
||||
gain = 10 ,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
minetest.register_node ("tardis:tardis_remat", {
|
||||
tiles = {"tardis_exterior.png^[opacity:1"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_exterior.png^[opacity:1"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_1"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_1"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(11)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(11)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_remat_1", {
|
||||
tiles = {"tardis_exterior.png^[opacity:25"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 7 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:25"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 7 ,
|
||||
|
||||
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_2"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_2"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1.5)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1.5)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_remat_2", {
|
||||
tiles = {"tardis_exterior.png^[opacity:50"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_exterior.png^[opacity:50"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_3"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_3"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_remat_3", {
|
||||
tiles = {"tardis_exterior.png^[opacity:75"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:75"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_4"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_4"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_remat_4", {
|
||||
tiles = {"tardis_exterior.png^[opacity:100"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_exterior.png^[opacity:100"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_5"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_5"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(0.5)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(0.5)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_remat_5", {
|
||||
tiles = {"tardis_exterior.png^[opacity:125"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:125"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_6"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_6"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_remat_6", {
|
||||
tiles = {"tardis_exterior.png^[opacity:150"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_exterior.png^[opacity:150"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_7"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_7"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_remat_7", {
|
||||
tiles = {"tardis_exterior.png^[opacity:175"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
light_source = 10 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:175"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
light_source = 10 ,
|
||||
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_8"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_8"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_remat_8", {
|
||||
tiles = {"tardis_exterior.png^[opacity:200"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
tiles = {"tardis_exterior.png^[opacity:200"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_9"})
|
||||
end ,
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis_remat_9"})
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(0.5)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(0.5)
|
||||
end ,
|
||||
})
|
||||
|
||||
minetest.register_node ("tardis:tardis_remat_9", {
|
||||
tiles = {"tardis_exterior.png^[opacity:225"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
tiles = {"tardis_exterior.png^[opacity:225"} ,
|
||||
use_texture_alpha = true ,
|
||||
drawtype = "mesh" ,
|
||||
mesh = "tardis_exterior.obj" ,
|
||||
paramtype = "light" ,
|
||||
is_ground_content = true ,
|
||||
light_source = 10 ,
|
||||
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis"})
|
||||
on_timer = function (pos)
|
||||
tardis.swap_node (pos, {name = "tardis:tardis"})
|
||||
|
||||
local meta = minetest.get_meta (pos)
|
||||
owner = meta:get_string ("owner")
|
||||
local meta = minetest.get_meta (pos)
|
||||
owner = meta:get_string ("owner")
|
||||
|
||||
tardis.tardises [owner]["in_vortex"] = false
|
||||
end ,
|
||||
tardis.tardises [owner]["in_vortex"] = false
|
||||
end ,
|
||||
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
on_construct = function (pos)
|
||||
minetest.get_node_timer (pos):start(1)
|
||||
end ,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue