Add the intro cutscene, a start to the map, and various other things.

This commit is contained in:
Signal 2025-11-16 02:48:08 -05:00
parent d0c0a3ebb6
commit 1b2199705b
46 changed files with 1401 additions and 91 deletions

View 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 = {