Add lying skeleton of player. Fix bug in naming of skeleton model node.

This commit is contained in:
SFENCE 2021-01-10 11:03:40 +01:00
parent 421894c87a
commit d73cdc0d16
7 changed files with 238 additions and 1 deletions

105
data/lying_human.lua Normal file
View File

@ -0,0 +1,105 @@
-- node box {x=0, y=0, z=0}
node_box = {
type = "fixed",
fixed = {
{-0.25,-0.5,-0.5,-0.125,-0.25,-0.4375},
{0.125,-0.5,-0.5,0.25,-0.25,-0.4375},
{-0.1875,-0.25,-0.5,-0.125,-0.1875,-0.4375},
{0.125,-0.25,-0.5,0.1875,-0.1875,-0.4375},
{-0.25,-0.5,-0.4375,-0.125,-0.375,-0.0625},
{0.125,-0.5,-0.4375,0.25,-0.375,-0.0625},
{-0.25,-0.5,-0.0625,-0.125,-0.4375,0.0},
{0.125,-0.5,-0.0625,0.25,-0.4375,0.0},
{-0.4375,-0.4375,-0.0625,-0.375,-0.375,0.5},
{-0.3125,-0.4375,-0.0625,-0.25,-0.375,0.0},
{-0.125,-0.4375,-0.0625,-0.0625,-0.375,0.0},
{0.0625,-0.4375,-0.0625,0.125,-0.375,0.0},
{0.25,-0.4375,-0.0625,0.3125,-0.375,0.0},
{0.375,-0.4375,-0.0625,0.4375,-0.375,0.5},
{-0.4375,-0.5,0.0,-0.375,-0.4375,0.25},
{0.375,-0.5,0.0,0.4375,-0.4375,0.25},
{-0.25,-0.4375,0.0,-0.125,-0.3125,0.1875},
{0.125,-0.4375,0.0,0.25,-0.3125,0.1875},
{-0.4375,-0.375,0.0,-0.375,-0.3125,0.5},
{0.375,-0.375,0.0,0.4375,-0.3125,0.5},
{-0.4375,-0.3125,0.0625,-0.375,-0.25,0.25},
{0.375,-0.3125,0.0625,0.4375,-0.25,0.25},
{-0.25,-0.4375,0.1875,-0.1875,-0.3125,0.25},
{0.1875,-0.4375,0.1875,0.25,-0.3125,0.25},
{-0.1875,-0.4375,0.25,-0.125,-0.3125,0.3125},
{-0.0625,-0.4375,0.25,0.0625,-0.375,0.3125},
{0.125,-0.4375,0.25,0.1875,-0.3125,0.3125},
{-0.1875,-0.4375,0.3125,-0.0625,-0.375,0.4375},
{0.0625,-0.4375,0.3125,0.1875,-0.375,0.4375},
{-0.25,-0.4375,0.375,-0.1875,-0.375,0.5},
{0.1875,-0.4375,0.375,0.25,-0.375,0.5},
{-0.0625,-0.5,0.4375,0.0625,-0.375,0.5},
{-0.3125,-0.4375,0.4375,-0.25,-0.375,0.5},
{-0.1875,-0.4375,0.4375,-0.125,-0.375,0.5},
{0.125,-0.4375,0.4375,0.1875,-0.375,0.5},
{0.25,-0.4375,0.4375,0.3125,-0.375,0.5},
},
},
-- node box {x=0, y=0, z=1}
node_box = {
type = "fixed",
fixed = {
{-0.4375,-0.4375,-0.5,-0.375,-0.3125,-0.4375},
{-0.25,-0.4375,-0.5,-0.1875,-0.375,-0.4375},
{0.1875,-0.4375,-0.5,0.25,-0.375,-0.4375},
{0.375,-0.4375,-0.5,0.4375,-0.3125,-0.4375},
{-0.4375,-0.5,-0.4375,-0.375,-0.375,-0.375},
{-0.1875,-0.5,-0.4375,0.1875,-0.4375,-0.375},
{0.375,-0.5,-0.4375,0.4375,-0.375,-0.375},
{-0.1875,-0.4375,-0.4375,-0.125,-0.375,-0.375},
{-0.0625,-0.4375,-0.4375,0.0625,-0.375,-0.375},
{0.125,-0.4375,-0.4375,0.1875,-0.375,-0.375},
{-0.0625,-0.25,-0.4375,0.0625,-0.1875,-0.1875},
{-0.4375,-0.4375,-0.375,-0.375,-0.3125,-0.25},
{0.375,-0.4375,-0.375,0.4375,-0.3125,-0.25},
{-0.1875,-0.375,-0.375,-0.125,-0.25,-0.3125},
{0.125,-0.375,-0.375,0.1875,-0.25,-0.3125},
{-0.125,-0.25,-0.375,-0.0625,-0.1875,-0.25},
{0.0625,-0.25,-0.375,0.125,-0.1875,-0.25},
{-0.25,-0.5,-0.3125,0.25,-0.4375,-0.25},
{-0.25,-0.4375,-0.3125,-0.1875,-0.1875,-0.25},
{-0.0625,-0.4375,-0.3125,0.0625,-0.375,-0.25},
{0.1875,-0.4375,-0.3125,0.25,-0.1875,-0.25},
{-0.1875,-0.25,-0.3125,-0.125,-0.1875,-0.25},
{0.125,-0.25,-0.3125,0.1875,-0.1875,-0.25},
{-0.4375,-0.375,-0.25,-0.375,-0.25,-0.125},
{0.375,-0.375,-0.25,0.4375,-0.25,-0.125},
{-0.0625,-0.4375,-0.1875,0.0625,-0.3125,-0.125},
{-0.25,-0.3125,-0.1875,-0.1875,-0.125,-0.125},
{0.1875,-0.3125,-0.1875,0.25,-0.125,-0.125},
{-0.1875,-0.1875,-0.1875,0.1875,-0.125,-0.125},
{-0.25,-0.4375,-0.125,-0.0625,-0.3125,-0.0625},
{0.0625,-0.4375,-0.125,0.25,-0.3125,-0.0625},
{-0.375,-0.375,-0.125,-0.25,-0.25,-0.0625},
{0.25,-0.375,-0.125,0.375,-0.25,-0.0625},
{-0.0625,-0.375,-0.0625,0.0625,-0.25,0.0},
{-0.25,-0.5,0.0,0.25,-0.375,0.0625},
{-0.25,-0.375,0.0,-0.0625,-0.3125,0.0625},
{0.0625,-0.375,0.0,0.25,-0.3125,0.0625},
{-0.125,-0.3125,0.0,-0.0625,0.0,0.0625},
{0.0625,-0.3125,0.0,0.125,0.0,0.0625},
{-0.25,-0.25,0.0,-0.125,0.0,0.0625},
{-0.0625,-0.25,0.0,0.0625,0.0,0.0625},
{0.125,-0.25,0.0,0.25,0.0,0.0625},
{-0.25,-0.5,0.0625,0.25,-0.4375,0.5},
{-0.25,-0.4375,0.0625,-0.1875,-0.3125,0.5},
{0.1875,-0.4375,0.0625,0.25,-0.3125,0.5},
{-0.0625,-0.375,0.0625,0.0625,-0.25,0.125},
{-0.25,-0.25,0.0625,-0.1875,0.0,0.5},
{0.1875,-0.25,0.0625,0.25,0.0,0.5},
{-0.1875,-0.0625,0.0625,-0.0625,0.0,0.25},
{0.0625,-0.0625,0.0625,0.1875,0.0,0.25},
{-0.25,-0.3125,0.125,-0.1875,-0.25,0.5},
{0.1875,-0.3125,0.125,0.25,-0.25,0.5},
{-0.0625,-0.0625,0.125,0.0625,0.0,0.1875},
{-0.0625,-0.0625,0.25,0.0625,0.0,0.5},
{-0.1875,-0.0625,0.3125,-0.0625,0.0,0.5},
{0.0625,-0.0625,0.3125,0.1875,0.0,0.5},
{-0.1875,-0.4375,0.4375,0.1875,-0.0625,0.5},
},
},

File diff suppressed because one or more lines are too long

View File

@ -23,5 +23,24 @@ function skeletons.register_skeleton(name, desc, box)
minetest.register_node("skeletons:model_"..name, table.copy(node_def)) minetest.register_node("skeletons:model_"..name, table.copy(node_def))
node_def.description = S("Colored model of").." "..desc; node_def.description = S("Colored model of").." "..desc;
node_def.tiles = {"skeletons_model_colored.png"} node_def.tiles = {"skeletons_model_colored.png"}
minetest.register_node("skeletons:colored_mode_"..name, table.copy(node_def)) minetest.register_node("skeletons:colored_model_"..name, table.copy(node_def))
end
function skeletons.register_skeleton_transform(origin, transformed, restorable)
local prefixes = {"fresh_", "fossil_", "model_", "colored_model_"};
for key, value in pairs(prefixes) do
minetest.register_craft({
type = "shapeless",
output = "skeletons:"..value..transformed,
recipe = {"skeletons:"..value..origin},
});
if restorable then
minetest.register_craft({
type = "shapeless",
output = "skeletons:"..value..origin,
recipe = {"skeletons:"..value..transformed},
});
end
end
end end

View File

@ -106,7 +106,119 @@ local node_box_top = {
{-0.1875,0.0625,0.1875,0.1875,0.4375,0.25}, {-0.1875,0.0625,0.1875,0.1875,0.4375,0.25},
}, },
} }
-- node box {x=0, y=0, z=0}
local node_box_front = {
type = "fixed",
fixed = {
{-0.25,-0.5,-0.5,-0.125,-0.25,-0.4375},
{0.125,-0.5,-0.5,0.25,-0.25,-0.4375},
{-0.1875,-0.25,-0.5,-0.125,-0.1875,-0.4375},
{0.125,-0.25,-0.5,0.1875,-0.1875,-0.4375},
{-0.25,-0.5,-0.4375,-0.125,-0.375,-0.0625},
{0.125,-0.5,-0.4375,0.25,-0.375,-0.0625},
{-0.25,-0.5,-0.0625,-0.125,-0.4375,0.0},
{0.125,-0.5,-0.0625,0.25,-0.4375,0.0},
{-0.4375,-0.4375,-0.0625,-0.375,-0.375,0.5},
{-0.3125,-0.4375,-0.0625,-0.25,-0.375,0.0},
{-0.125,-0.4375,-0.0625,-0.0625,-0.375,0.0},
{0.0625,-0.4375,-0.0625,0.125,-0.375,0.0},
{0.25,-0.4375,-0.0625,0.3125,-0.375,0.0},
{0.375,-0.4375,-0.0625,0.4375,-0.375,0.5},
{-0.4375,-0.5,0.0,-0.375,-0.4375,0.25},
{0.375,-0.5,0.0,0.4375,-0.4375,0.25},
{-0.25,-0.4375,0.0,-0.125,-0.3125,0.1875},
{0.125,-0.4375,0.0,0.25,-0.3125,0.1875},
{-0.4375,-0.375,0.0,-0.375,-0.3125,0.5},
{0.375,-0.375,0.0,0.4375,-0.3125,0.5},
{-0.4375,-0.3125,0.0625,-0.375,-0.25,0.25},
{0.375,-0.3125,0.0625,0.4375,-0.25,0.25},
{-0.25,-0.4375,0.1875,-0.1875,-0.3125,0.25},
{0.1875,-0.4375,0.1875,0.25,-0.3125,0.25},
{-0.1875,-0.4375,0.25,-0.125,-0.3125,0.3125},
{-0.0625,-0.4375,0.25,0.0625,-0.375,0.3125},
{0.125,-0.4375,0.25,0.1875,-0.3125,0.3125},
{-0.1875,-0.4375,0.3125,-0.0625,-0.375,0.4375},
{0.0625,-0.4375,0.3125,0.1875,-0.375,0.4375},
{-0.25,-0.4375,0.375,-0.1875,-0.375,0.5},
{0.1875,-0.4375,0.375,0.25,-0.375,0.5},
{-0.0625,-0.5,0.4375,0.0625,-0.375,0.5},
{-0.3125,-0.4375,0.4375,-0.25,-0.375,0.5},
{-0.1875,-0.4375,0.4375,-0.125,-0.375,0.5},
{0.125,-0.4375,0.4375,0.1875,-0.375,0.5},
{0.25,-0.4375,0.4375,0.3125,-0.375,0.5},
},
}
-- node box {x=0, y=0, z=1}
local node_box_back = {
type = "fixed",
fixed = {
{-0.4375,-0.4375,-0.5,-0.375,-0.3125,-0.4375},
{-0.25,-0.4375,-0.5,-0.1875,-0.375,-0.4375},
{0.1875,-0.4375,-0.5,0.25,-0.375,-0.4375},
{0.375,-0.4375,-0.5,0.4375,-0.3125,-0.4375},
{-0.4375,-0.5,-0.4375,-0.375,-0.375,-0.375},
{-0.1875,-0.5,-0.4375,0.1875,-0.4375,-0.375},
{0.375,-0.5,-0.4375,0.4375,-0.375,-0.375},
{-0.1875,-0.4375,-0.4375,-0.125,-0.375,-0.375},
{-0.0625,-0.4375,-0.4375,0.0625,-0.375,-0.375},
{0.125,-0.4375,-0.4375,0.1875,-0.375,-0.375},
{-0.0625,-0.25,-0.4375,0.0625,-0.1875,-0.1875},
{-0.4375,-0.4375,-0.375,-0.375,-0.3125,-0.25},
{0.375,-0.4375,-0.375,0.4375,-0.3125,-0.25},
{-0.1875,-0.375,-0.375,-0.125,-0.25,-0.3125},
{0.125,-0.375,-0.375,0.1875,-0.25,-0.3125},
{-0.125,-0.25,-0.375,-0.0625,-0.1875,-0.25},
{0.0625,-0.25,-0.375,0.125,-0.1875,-0.25},
{-0.25,-0.5,-0.3125,0.25,-0.4375,-0.25},
{-0.25,-0.4375,-0.3125,-0.1875,-0.1875,-0.25},
{-0.0625,-0.4375,-0.3125,0.0625,-0.375,-0.25},
{0.1875,-0.4375,-0.3125,0.25,-0.1875,-0.25},
{-0.1875,-0.25,-0.3125,-0.125,-0.1875,-0.25},
{0.125,-0.25,-0.3125,0.1875,-0.1875,-0.25},
{-0.4375,-0.375,-0.25,-0.375,-0.25,-0.125},
{0.375,-0.375,-0.25,0.4375,-0.25,-0.125},
{-0.0625,-0.4375,-0.1875,0.0625,-0.3125,-0.125},
{-0.25,-0.3125,-0.1875,-0.1875,-0.125,-0.125},
{0.1875,-0.3125,-0.1875,0.25,-0.125,-0.125},
{-0.1875,-0.1875,-0.1875,0.1875,-0.125,-0.125},
{-0.25,-0.4375,-0.125,-0.0625,-0.3125,-0.0625},
{0.0625,-0.4375,-0.125,0.25,-0.3125,-0.0625},
{-0.375,-0.375,-0.125,-0.25,-0.25,-0.0625},
{0.25,-0.375,-0.125,0.375,-0.25,-0.0625},
{-0.0625,-0.375,-0.0625,0.0625,-0.25,0.0},
{-0.25,-0.5,0.0,0.25,-0.375,0.0625},
{-0.25,-0.375,0.0,-0.0625,-0.3125,0.0625},
{0.0625,-0.375,0.0,0.25,-0.3125,0.0625},
{-0.125,-0.3125,0.0,-0.0625,0.0,0.0625},
{0.0625,-0.3125,0.0,0.125,0.0,0.0625},
{-0.25,-0.25,0.0,-0.125,0.0,0.0625},
{-0.0625,-0.25,0.0,0.0625,0.0,0.0625},
{0.125,-0.25,0.0,0.25,0.0,0.0625},
{-0.25,-0.5,0.0625,0.25,-0.4375,0.5},
{-0.25,-0.4375,0.0625,-0.1875,-0.3125,0.5},
{0.1875,-0.4375,0.0625,0.25,-0.3125,0.5},
{-0.0625,-0.375,0.0625,0.0625,-0.25,0.125},
{-0.25,-0.25,0.0625,-0.1875,0.0,0.5},
{0.1875,-0.25,0.0625,0.25,0.0,0.5},
{-0.1875,-0.0625,0.0625,-0.0625,0.0,0.25},
{0.0625,-0.0625,0.0625,0.1875,0.0,0.25},
{-0.25,-0.3125,0.125,-0.1875,-0.25,0.5},
{0.1875,-0.3125,0.125,0.25,-0.25,0.5},
{-0.0625,-0.0625,0.125,0.0625,0.0,0.1875},
{-0.0625,-0.0625,0.25,0.0625,0.0,0.5},
{-0.1875,-0.0625,0.3125,-0.0625,0.0,0.5},
{0.0625,-0.0625,0.3125,0.1875,0.0,0.5},
{-0.1875,-0.4375,0.4375,0.1875,-0.0625,0.5},
},
}
skeletons.register_skeleton("player_skeleton_bottom", S("part of player skeleton"), node_box_bottom) skeletons.register_skeleton("player_skeleton_bottom", S("part of player skeleton"), node_box_bottom)
skeletons.register_skeleton("player_skeleton_top", S("part of player skeleton"), node_box_top) skeletons.register_skeleton("player_skeleton_top", S("part of player skeleton"), node_box_top)
skeletons.register_skeleton("player_skeleton_front", S("part of player lying skeleton"), node_box_front)
skeletons.register_skeleton("player_skeleton_back", S("part of player lying skeleton"), node_box_back)
skeletons.register_skeleton_transform("player_skeleton_bottom", "player_skeleton_front", true)
skeletons.register_skeleton_transform("player_skeleton_top", "player_skeleton_back", true)