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

@ -7,8 +7,9 @@ function artifact.register_node(name, def)
if not name:find ":" then
name = "artifact:"..name
end
-- We might need to add groups below.
if not def.groups then def.groups = {} end
if artifact.debug then
if not def.groups then def.groups = {} end
def.groups.dig_immediate = 3
end
if def._variants then
@ -99,6 +100,49 @@ local function rep(tx, size)
return out
end
-- These nodes are only used for the intro cutscene.
artifact.register_node("stone_brown", {
tiles = {{name = "artifact_stone_brown.png", align_style = "world"}},
_variants = {"stair", "slab"}
})
artifact.register_node("stone_tile_brown", {
tiles = {{name = "artifact_stone_tile_brown.png", align_style = "world"}},
_variants = {"stair", "slab"}
})
artifact.register_node("stone_bricks_brown", {
tiles = {{name = "artifact_stone_bricks_brown.png", align_style = "world"}},
_variants = {"stair", "slab"}
})
artifact.register_node("torch", {
drawtype = "mesh",
paramtype2 = "facedir",
mesh = "artifact_torch.obj",
tiles = {"artifact_torch.png"},
use_texture_alpha = "clip",
light_source = 10,
paramtype = "light",
sunlight_propagates = true
})
artifact.register_node("torch_standing", {
drawtype = "mesh",
paramtype2 = "facedir",
mesh = "artifact_torch_standing.obj",
tiles = {"artifact_torch.png"},
use_texture_alpha = "clip",
light_source = 10,
paramtype = "light",
sunlight_propagates = true
})
-- End ad-hoc nodes.
artifact.register_node("stone", {
tiles = {{name = "artifact_stone.png", align_style = "world"}},
_variants = {"stair", "slab"}
@ -132,6 +176,70 @@ artifact.register_node("stone_tile_small", {
_variants = {"stair", "slab"},
})
-- Why does making this texture a tile animation darken it!?
artifact.register_node("water", {
tiles = {{name = "artifact_water_source.png^[opacity:150", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 6}}},
drawtype = "liquid",
use_texture_alpha = "blend",
paramtype = "light",
walkable = false,
pointable = artifact.debug,
liquid_move_physics = true,
post_effect_color = "#2d5a7c55",
liquidtype = "source",
-- Minetest pro tip: Do not try to use aliases for these.
liquid_alternative_source = "artifact:water",
liquid_alternative_flowing = "artifact:water_flowing",
liquid_viscosity = 1,
liquid_range = 5,
})
artifact.register_node("water_flowing", {
tiles = {{name = "artifact_water_flowing.png^[opacity:150", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 0.5}}},
special_tiles = {
{name = "artifact_water_flowing.png^[opacity:150", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 0.5}},
{name = "artifact_water_flowing.png^[opacity:150", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 0.5}}
},
drawtype = "flowingliquid",
use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = artifact.debug,
buildable_to = true,
liquid_move_physics = true,
post_effect_color = "#2d5a7c55",
drop = "",
liquidtype = "flowing",
liquid_alternative_source = "artifact:water",
liquid_alternative_flowing = "artifact:water_flowing",
liquid_viscosity = 1,
liquid_range = 5,
})
-- Minetest doesn't properly handle having a custom nodebox on a liquid source, so we do this the hacky way.
artifact.register_node("water_static", {
tiles = {{name = "artifact_water_source.png^[opacity:150", animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 6}}},
drawtype = "nodebox",
node_box = {
type = "leveled",
fixed = {
-0.5, -0.5, -0.5,
0.5, 6/16, 0.5
}
},
use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "leveled",
place_param2 = 60,
walkable = false,
pointable = artifact.debug,
liquid_move_physics = true,
post_effect_color = "#2d5a7c55",
})
artifact.register_node("vines", {
drawtype = "nodebox",
@ -249,12 +357,12 @@ artifact.register_node("light", {
-- Make darkness the default.
minetest.override_item("air", {
sunlight_propagates = false,
light_source = 2
light_source = 2 -- But not _too_ much darkness...
})
if artifact.debug then
minetest.register_mapgen_script(minetest.get_modpath(minetest.get_current_modname()).."/mapgen.lua")
minetest.register_mapgen_script(minetest.get_modpath(minetest.get_current_modname()).."/mapgen_debug.lua")
minetest.register_decoration {
deco_type = "simple",
@ -262,5 +370,6 @@ if artifact.debug then
place_on = "stone",
fill_ratio = 0.02,
}
else
minetest.register_mapgen_script(minetest.get_modpath(minetest.get_current_modname()).."/mapgen.lua")
end