Add the intro cutscene, a start to the map, and various other things.
This commit is contained in:
parent
d0c0a3ebb6
commit
1b2199705b
46 changed files with 1401 additions and 91 deletions
|
|
@ -77,6 +77,20 @@ artifact.register_node("lever", {
|
|||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
paramtype2 = "facedir",
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-3/16, -0.5, -4/16,
|
||||
3/16, -3/16, 4/16
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-3/16, -0.5, -4/16,
|
||||
3/16, -3/16, 4/16
|
||||
}
|
||||
},
|
||||
pointable = false,
|
||||
on_construct = function(pos)
|
||||
local m = minetest.get_meta(pos)
|
||||
|
|
|
|||
|
|
@ -44,9 +44,6 @@ minetest.register_entity(":artifact:door", {
|
|||
e.rotation.y = e.rotation.y +math.pi
|
||||
e:rotate(e.rotation)
|
||||
end
|
||||
if e._locked then
|
||||
e._no_interact = true
|
||||
end
|
||||
e._name = ""..math.random()
|
||||
local nm = minetest.get_meta(e.object:get_pos())
|
||||
if (node.name:find "_open") and not e._open then
|
||||
|
|
@ -54,6 +51,12 @@ minetest.register_entity(":artifact:door", {
|
|||
elseif not (node.name:find "_open") and e._open then
|
||||
e:close(true)
|
||||
end
|
||||
if nm:get_string("locked") == "true" then
|
||||
e._locked = true
|
||||
end
|
||||
if e._locked then
|
||||
e._no_interact = true
|
||||
end
|
||||
doors[e.object:get_pos():round():to_string()] = e
|
||||
end,
|
||||
on_deactivate = function(e)
|
||||
|
|
|
|||
0
mods/artifact_mechanisms/fields.lua
Normal file
0
mods/artifact_mechanisms/fields.lua
Normal file
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
minetest.register_entity(":display", {
|
||||
initial_properties = {
|
||||
visual = "sprite",
|
||||
textures = {"blank.png"},
|
||||
pointable = false,
|
||||
static_save = false
|
||||
},
|
||||
|
|
@ -30,6 +32,7 @@ end
|
|||
|
||||
include "basics.lua"
|
||||
include "doors.lua"
|
||||
include "large_doors.lua"
|
||||
include "chest.lua"
|
||||
|
||||
|
||||
|
|
@ -58,28 +61,35 @@ function artifact.load_schematic(dst, path, rot)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
minetest.register_entity(":test", {
|
||||
initial_properties = {
|
||||
static_save = false,
|
||||
visual = "mesh",
|
||||
mesh = "artifact_character.gltf",
|
||||
},
|
||||
on_activate = function(e)
|
||||
-- e.object:set_bone_override("root", {
|
||||
-- position = {vec = vector.new(15,15,15)}
|
||||
-- })
|
||||
end,
|
||||
on_rightclick = function(e, p)
|
||||
local v = vector.new(0, p:get_properties().eye_height *10, 0)
|
||||
p:set_eye_offset(v,v,v)
|
||||
p:set_attach(e.object, "Head")
|
||||
end,
|
||||
on_punch = function(e, p)
|
||||
p:set_detach()
|
||||
function artifact.get_schem_size(path)
|
||||
local f = io.open(path..".mts", "rb")
|
||||
|
||||
local function read_u16(file)
|
||||
local data = file:read(2)
|
||||
if not data or #data < 2 then return nil end
|
||||
local a, b = data:byte(1, 2)
|
||||
return a + b
|
||||
end
|
||||
local magic = f:read(4)
|
||||
if magic ~= "MTSM" then
|
||||
f:close()
|
||||
error("Not a valid .mts file (missing` MTSM` header).")
|
||||
end
|
||||
})
|
||||
|
||||
local version = read_u16(f)
|
||||
if not version or version > 4 then
|
||||
f:close()
|
||||
error("Unsupported .mts version: "..tostring(version))
|
||||
end
|
||||
|
||||
local size_x = read_u16(f)
|
||||
local size_y = read_u16(f)
|
||||
local size_z = read_u16(f)
|
||||
|
||||
f:close()
|
||||
|
||||
return vector.new(size_x, size_y, size_z)
|
||||
end
|
||||
|
||||
if artifact.debug then
|
||||
|
||||
|
|
@ -103,6 +113,32 @@ if artifact.debug then
|
|||
}
|
||||
},
|
||||
})
|
||||
minetest.override_item("testtools:remover", {
|
||||
pointabilities = {
|
||||
nodes = {
|
||||
-- This gets added to everything in debug mode.
|
||||
["group:dig_immediate"] = true,
|
||||
air = false,
|
||||
},
|
||||
objects = {
|
||||
-- The display entities should all be immortal.
|
||||
["group:immortal"] = false
|
||||
}
|
||||
},
|
||||
})
|
||||
minetest.override_item("testtools:node_meta_editor", {
|
||||
pointabilities = {
|
||||
nodes = {
|
||||
-- This gets added to everything in debug mode.
|
||||
["group:dig_immediate"] = true,
|
||||
air = false,
|
||||
},
|
||||
objects = {
|
||||
-- The display entities should all be immortal.
|
||||
["group:immortal"] = false
|
||||
}
|
||||
},
|
||||
})
|
||||
minetest.override_item("testtools:param2tool", {
|
||||
pointabilities = {
|
||||
nodes = {
|
||||
|
|
|
|||
0
mods/artifact_mechanisms/large_doors.lua
Normal file
0
mods/artifact_mechanisms/large_doors.lua
Normal file
Loading…
Add table
Add a link
Reference in a new issue