Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
123f0ac7cb |
@@ -23,10 +23,11 @@ du parcours historique de Sanctuary 26.2 se trouve dans
|
||||
|
||||
## État actuel
|
||||
|
||||
Le jalon `0.1.0-dev.1` fournit les fondations de développement :
|
||||
Le jalon `0.1.0-dev.2` fournit les fondations de développement :
|
||||
|
||||
- un game Luanti autonome et un mod directeur `sanctuary_core` ;
|
||||
- quatre nœuds de monde minimaux et un biome de test ;
|
||||
- les cinq nœuds de monde minimaux, laissés intacts, et un biome de test ;
|
||||
- seize blocs colorés de test disposés en plateforme 4×4 au premier spawn ;
|
||||
- un schéma de progression joueur versionné, encore sans économie d'achat ;
|
||||
- des commandes de diagnostic en lecture seule ;
|
||||
- un healthcheck qui démarre Luanti réellement puis arrête le monde CI ;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
title = Sanctuary
|
||||
version = 0.1.0-dev.1
|
||||
version = 0.1.0-dev.2
|
||||
description = Un monde libre à habiter, préserver et relier.
|
||||
author = KOKA99CAB
|
||||
min_minetest_version = 5.16
|
||||
|
||||
@@ -33,6 +33,16 @@ core.register_on_mods_loaded(function()
|
||||
missing[#missing + 1] = "biome:sanctuary_foundation"
|
||||
end
|
||||
|
||||
if #sanctuary.color_test_blocks ~= 16 then
|
||||
missing[#missing + 1] = "color_test_blocks!=16"
|
||||
else
|
||||
for _, definition in ipairs(sanctuary.color_test_blocks) do
|
||||
if not core.registered_nodes[definition.node_name] then
|
||||
missing[#missing + 1] = definition.node_name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if sanctuary.progression.schema_version ~= 1 then
|
||||
missing[#missing + 1] = "progression_schema!=1"
|
||||
end
|
||||
@@ -42,10 +52,11 @@ core.register_on_mods_loaded(function()
|
||||
end
|
||||
|
||||
local summary = string.format(
|
||||
"version=%s schema=%d nodes=%d biomes=%d",
|
||||
"version=%s schema=%d nodes=%d colors=%d biomes=%d",
|
||||
sanctuary.version,
|
||||
sanctuary.progression.schema_version,
|
||||
#required_nodes,
|
||||
#required_nodes + #sanctuary.color_test_blocks,
|
||||
#sanctuary.color_test_blocks,
|
||||
1
|
||||
)
|
||||
core.log("action", "[sanctuary-healthcheck] OK " .. summary)
|
||||
|
||||
@@ -90,3 +90,75 @@ core.register_biome({
|
||||
heat_point = 50,
|
||||
humidity_point = 50,
|
||||
})
|
||||
|
||||
sanctuary.color_test_blocks = {
|
||||
{ id = "white", description = "Test Block — White", color = "#F4F4F4" },
|
||||
{ id = "light_gray", description = "Test Block — Light Gray", color = "#A7A7A7" },
|
||||
{ id = "gray", description = "Test Block — Gray", color = "#555555" },
|
||||
{ id = "black", description = "Test Block — Black", color = "#161616" },
|
||||
{ id = "brown", description = "Test Block — Brown", color = "#835432" },
|
||||
{ id = "red", description = "Test Block — Red", color = "#C83B3B" },
|
||||
{ id = "orange", description = "Test Block — Orange", color = "#E88935" },
|
||||
{ id = "yellow", description = "Test Block — Yellow", color = "#E7C83E" },
|
||||
{ id = "lime", description = "Test Block — Lime", color = "#70B83D" },
|
||||
{ id = "green", description = "Test Block — Green", color = "#3F7D45" },
|
||||
{ id = "cyan", description = "Test Block — Cyan", color = "#3C9D9D" },
|
||||
{ id = "light_blue", description = "Test Block — Light Blue", color = "#62A9D8" },
|
||||
{ id = "blue", description = "Test Block — Blue", color = "#3D59A8" },
|
||||
{ id = "purple", description = "Test Block — Purple", color = "#70479B" },
|
||||
{ id = "magenta", description = "Test Block — Magenta", color = "#B34E9D" },
|
||||
{ id = "pink", description = "Test Block — Pink", color = "#D982A6" },
|
||||
}
|
||||
|
||||
for _, definition in ipairs(sanctuary.color_test_blocks) do
|
||||
local node_name = "sanctuary_core:test_" .. definition.id
|
||||
definition.node_name = node_name
|
||||
core.register_node(node_name, {
|
||||
description = definition.description,
|
||||
tiles = { color_texture(definition.color) },
|
||||
groups = { cracky = 3, sanctuary_test_color = 1 },
|
||||
})
|
||||
end
|
||||
|
||||
local PLATFORM_Y = 96
|
||||
local PLATFORM_MIN = { x = -4, y = PLATFORM_Y, z = -4 }
|
||||
local PLATFORM_MAX = { x = 5, y = PLATFORM_Y + 5, z = 5 }
|
||||
|
||||
local function build_color_test_platform()
|
||||
for x = PLATFORM_MIN.x, PLATFORM_MAX.x do
|
||||
for z = PLATFORM_MIN.z, PLATFORM_MAX.z do
|
||||
for y = PLATFORM_Y, PLATFORM_MAX.y do
|
||||
core.set_node({ x = x, y = y, z = z }, { name = "air" })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for index, definition in ipairs(sanctuary.color_test_blocks) do
|
||||
local offset = index - 1
|
||||
core.set_node({
|
||||
x = (offset % 4) - 1,
|
||||
y = PLATFORM_Y,
|
||||
z = math.floor(offset / 4) - 1,
|
||||
}, { name = definition.node_name })
|
||||
end
|
||||
end
|
||||
|
||||
local function send_new_player_to_test_platform(player)
|
||||
local player_name = player:get_player_name()
|
||||
core.emerge_area(PLATFORM_MIN, PLATFORM_MAX, function(_, _, remaining)
|
||||
if remaining ~= 0 then
|
||||
return
|
||||
end
|
||||
|
||||
core.after(0, function()
|
||||
local current_player = core.get_player_by_name(player_name)
|
||||
if not current_player then
|
||||
return
|
||||
end
|
||||
build_color_test_platform()
|
||||
current_player:set_pos({ x = 0.5, y = PLATFORM_Y + 1.5, z = 0.5 })
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
core.register_on_newplayer(send_new_player_to_test_platform)
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "sanctuary-luanti",
|
||||
"version": "0.1.0-dev.1",
|
||||
"version": "0.1.0-dev.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "sanctuary-luanti",
|
||||
"version": "0.1.0-dev.1",
|
||||
"version": "0.1.0-dev.2",
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sanctuary-luanti",
|
||||
"version": "0.1.0-dev.1",
|
||||
"version": "0.1.0-dev.2",
|
||||
"private": true,
|
||||
"description": "Outillage de développement du jeu libre Sanctuary pour Luanti.",
|
||||
"type": "module",
|
||||
|
||||
@@ -27,6 +27,19 @@ test("the core mod registers every mapgen contract checked at boot", async () =>
|
||||
assert.match(healthcheck, /sanctuary_foundation/);
|
||||
});
|
||||
|
||||
test("the starting platform contains sixteen unique test colors", async () => {
|
||||
const world = await text("mods/sanctuary_core/src/world.lua");
|
||||
const definitions = [...world.matchAll(
|
||||
/\{ id = "([a-z_]+)", description = "Test Block — [^"]+", color = "(#[0-9A-F]{6})" \}/g,
|
||||
)];
|
||||
assert.equal(definitions.length, 16);
|
||||
assert.equal(new Set(definitions.map((match) => match[1])).size, 16);
|
||||
assert.equal(new Set(definitions.map((match) => match[2])).size, 16);
|
||||
assert.match(world, /offset % 4/);
|
||||
assert.match(world, /math\.floor\(offset \/ 4\)/);
|
||||
assert.match(world, /register_on_newplayer/);
|
||||
});
|
||||
|
||||
test("federation boundaries and source references remain documented", async () => {
|
||||
const vision = await text("docs/VISION.md");
|
||||
const architecture = await text("docs/ARCHITECTURE.md");
|
||||
|
||||
Reference in New Issue
Block a user