Compare commits

..

1 Commits
dev ... main

Author SHA1 Message Date
Vitaliy Olkhin
f0ba412b5c исправлен звук 2024-11-30 14:55:53 +05:00
23 changed files with 2534 additions and 2470 deletions

View File

@ -1,3 +1,4 @@
local Ombrellone_n_list = { local Ombrellone_n_list = {
{ "Red Ombrellone_n", "red"}, { "Red Ombrellone_n", "red"},
{ "Orange Ombrellone_n", "orange"}, { "Orange Ombrellone_n", "orange"},

View File

@ -1,3 +1,6 @@
local Asciugamano_list = { local Asciugamano_list = {
{ "Red Asciugamano", "red"}, { "Red Asciugamano", "red"},
{ "Orange Asciugamano", "orange"}, { "Orange Asciugamano", "orange"},
@ -12,6 +15,9 @@ for i in ipairs(Asciugamano_list) do
local asciugamanodesc = Asciugamano_list[i][1] local asciugamanodesc = Asciugamano_list[i][1]
local colour = Asciugamano_list[i][2] local colour = Asciugamano_list[i][2]
minetest.register_node("summer:asciugamano_"..colour.."", { minetest.register_node("summer:asciugamano_"..colour.."", {
description = asciugamanodesc.."", description = asciugamanodesc.."",
drawtype = "mesh", drawtype = "mesh",
@ -35,8 +41,11 @@ for i in ipairs(Asciugamano_list) do
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
return minetest.sleep_in_asciugamano( pos, node, clicker, itemstack, pointed_thing ); return minetest.sleep_in_asciugamano( pos, node, clicker, itemstack, pointed_thing );
end end
}) })
minetest.allow_sit = function( player ) minetest.allow_sit = function( player )
-- no check possible -- no check possible
if( not( player.get_player_velocity )) then if( not( player.get_player_velocity )) then
@ -55,6 +64,8 @@ for i in ipairs(Asciugamano_list) do
return false; return false;
end end
minetest.sleep_in_asciugamano = function( pos, node, clicker, itemstack, pointed_thing ) minetest.sleep_in_asciugamano = function( pos, node, clicker, itemstack, pointed_thing )
if( not( clicker ) or not( node ) or not( node.name ) or not( pos ) or not( minetest.allow_sit( clicker))) then if( not( clicker ) or not( node ) or not( node.name ) or not( pos ) or not( minetest.allow_sit( clicker))) then
return; return;
@ -129,6 +140,7 @@ for i in ipairs(Asciugamano_list) do
p = {x=second_node_pos.x, y=second_node_pos.y, z=second_node_pos.z}; p = {x=second_node_pos.x, y=second_node_pos.y, z=second_node_pos.z};
end end
place_name = 'asciugamano'; place_name = 'asciugamano';
elseif( node.name=='summer:sleeping_mat' or node.name=='summer:straw_mat') then elseif( node.name=='summer:sleeping_mat' or node.name=='summer:straw_mat') then
place_name = 'mat'; place_name = 'mat';
dir = node.param2; dir = node.param2;
@ -181,6 +193,7 @@ for i in ipairs(Asciugamano_list) do
end end
end end
clicker:set_eye_offset({x=0,y=-7,z=2}, {x=0,y=0,z=0}) clicker:set_eye_offset({x=0,y=-7,z=2}, {x=0,y=0,z=0})
clicker:setpos( p ); clicker:setpos( p );
default.player_set_animation(clicker, new_animation, 30) default.player_set_animation(clicker, new_animation, 30)
@ -188,12 +201,14 @@ for i in ipairs(Asciugamano_list) do
default.player_attached[pname] = true default.player_attached[pname] = true
if( allow_sleep==true) then if( allow_sleep==true) then
minetest.chat_send_player(pname, minetest.chat_send_player( pname, 'Aaah! What a comftable '..place_name..'. A second right-click will let you sleep.');
'Aaah! What a comftable ' .. place_name .. '. A second right-click will let you sleep.');
else else
minetest.chat_send_player(pname, minetest.chat_send_player( pname, 'Comftable, but not good enough for a nap. Right-click again if you want to get back up.');
'Comftable, but not good enough for a nap. Right-click again if you want to get back up.');
end end
end end
end end
--state=true: lay, state=false: stand up --state=true: lay, state=false: stand up

View File

@ -24,6 +24,7 @@ local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2) return math.sqrt(v.x ^ 2 + v.z ^ 2)
end end
local function reg_barca(color) local function reg_barca(color)
local barca_item_name = "summer:barca_"..color.."_item" local barca_item_name = "summer:barca_"..color.."_item"
local barca_ent_name = "summer:barca_"..color.."_entity" local barca_ent_name = "summer:barca_"..color.."_entity"
@ -80,6 +81,7 @@ local function reg_barca(color)
end end
end end
function barca.on_activate(self, staticdata, dtime_s) function barca.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({immortal = 1}) self.object:set_armor_groups({immortal = 1})
if staticdata then if staticdata then
@ -88,10 +90,12 @@ local function reg_barca(color)
self.last_v = self.v self.last_v = self.v
end end
function barca.get_staticdata(self) function barca.get_staticdata(self)
return tostring(self.v) return tostring(self.v)
end end
function barca.on_punch(self, puncher) function barca.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then if not puncher or not puncher:is_player() or self.removed then
return return
@ -118,6 +122,7 @@ local function reg_barca(color)
end end
end end
function barca.on_step(self, dtime) function barca.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then if self.driver then
@ -204,6 +209,7 @@ local function reg_barca(color)
self.object:setacceleration(new_acce) self.object:setacceleration(new_acce)
end end
minetest.register_entity("summer:barca_"..color.."", barca) minetest.register_entity("summer:barca_"..color.."", barca)
@ -257,3 +263,5 @@ colors = {
for _,color in ipairs(colors) do for _,color in ipairs(colors) do
reg_barca(color) reg_barca(color)
end end

View File

@ -21,7 +21,6 @@ minetest.register_node("summer:breccia_2", {
sounds = default.node_sound_gravel_defaults(), sounds = default.node_sound_gravel_defaults(),
--sounds = default.node_sound_stone_defaults(), --sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:desert_breccia_2", { minetest.register_node("summer:desert_breccia_2", {
description = "Red Breccia", description = "Red Breccia",
tiles = {"desert_breccia2.png"}, tiles = {"desert_breccia2.png"},
@ -32,7 +31,6 @@ minetest.register_node("summer:desert_breccia_2", {
sounds = default.node_sound_gravel_defaults(), sounds = default.node_sound_gravel_defaults(),
--sounds = default.node_sound_stone_defaults(), --sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:desert_breccia", { minetest.register_node("summer:desert_breccia", {
description = "Desert Breccia", description = "Desert Breccia",
tiles = {"desert_breccia.png"}, tiles = {"desert_breccia.png"},
@ -43,3 +41,6 @@ minetest.register_node("summer:desert_breccia", {
sounds = default.node_sound_gravel_defaults(), sounds = default.node_sound_gravel_defaults(),
--sounds = default.node_sound_stone_defaults(), --sounds = default.node_sound_stone_defaults(),
}) })

View File

@ -117,5 +117,7 @@ if minetest.get_modpath("wool") and minetest.get_modpath("dye") then
} }
}) })
end end
end end

View File

@ -24,6 +24,7 @@ local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2) return math.sqrt(v.x ^ 2 + v.z ^ 2)
end end
local function reg_canoa_(color) local function reg_canoa_(color)
local canoa_item_name = "summer:canoa_"..color.."_item" local canoa_item_name = "summer:canoa_"..color.."_item"
local canoa_ent_name = "summer:canoa_"..color.."_entity" local canoa_ent_name = "summer:canoa_"..color.."_entity"
@ -80,6 +81,7 @@ local function reg_canoa_(color)
end end
end end
function canoa_.on_activate(self, staticdata, dtime_s) function canoa_.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({immortal = 1}) self.object:set_armor_groups({immortal = 1})
if staticdata then if staticdata then
@ -88,10 +90,12 @@ local function reg_canoa_(color)
self.last_v = self.v self.last_v = self.v
end end
function canoa_.get_staticdata(self) function canoa_.get_staticdata(self)
return tostring(self.v) return tostring(self.v)
end end
function canoa_.on_punch(self, puncher) function canoa_.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then if not puncher or not puncher:is_player() or self.removed then
return return
@ -118,6 +122,7 @@ local function reg_canoa_(color)
end end
end end
function canoa_.on_step(self, dtime) function canoa_.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then if self.driver then
@ -204,6 +209,7 @@ local function reg_canoa_(color)
self.object:setacceleration(new_acce) self.object:setacceleration(new_acce)
end end
minetest.register_entity("summer:canoa_"..color.."", canoa_) minetest.register_entity("summer:canoa_"..color.."", canoa_)
@ -261,3 +267,5 @@ colors = {
for _,color in ipairs(colors) do for _,color in ipairs(colors) do
reg_canoa_(color) reg_canoa_(color)
end end

View File

@ -132,8 +132,7 @@ for i in ipairs(chest_list) do
minetest.register_node("summer:chest_lock"..colour.."", { minetest.register_node("summer:chest_lock"..colour.."", {
description = lockchestdesc.."", description = lockchestdesc.."",
tiles = { "chest_top_" .. colour .. ".png", "chest_top_" .. colour .. ".png", "chest_side_" .. colour .. tiles = {"chest_top_"..colour..".png", "chest_top_"..colour..".png", "chest_side_"..colour..".png",
".png",
"chest_side_"..colour..".png", "chest_side_"..colour..".png", "chest_lock_"..colour..".png"}, "chest_side_"..colour..".png", "chest_side_"..colour..".png", "chest_lock_"..colour..".png"},
--inventory_image = "chest_lock_"..colour.."_inv.png", --inventory_image = "chest_lock_"..colour.."_inv.png",

127
craft.lua
View File

@ -14,7 +14,15 @@ if minetest.get_modpath("wool") and minetest.get_modpath("dye") then
local desc = lchest_list[i][1] local desc = lchest_list[i][1]
local colour = lchest_list[i][2] local colour = lchest_list[i][2]
--rake
minetest.register_craft({
output = "summer:rake",
recipe = {
{"default:stick", "default:steel_ingot", "default:stick", },
{"", "default:stick", "", },
{"", "default:gold_ingot", "", }
}
})
--sdraia --sdraia
minetest.register_craft({ minetest.register_craft({
output = "summer:sdraia_"..colour.."", output = "summer:sdraia_"..colour.."",
@ -70,67 +78,6 @@ if minetest.get_modpath("wool") and minetest.get_modpath("dye") then
} }
}) })
--________________________________________________________
--ombrellone
--________________________________________________________
minetest.register_craft({
output = "summer:ombrellone_" .. colour .. "",
recipe = {
{ "default:paper", "wool:" .. colour, "default:paper", },
{ "", "default:stick", "", },
{ "", "default:stick", "", }
}
})
minetest.register_craft({
output = "summer:ombrellone_n_" .. colour .. "",
recipe = {
{ "", "wool:" .. colour, "" },
{ "default:paper", "default:stick", "default:paper" },
{ "", "default:stick", "" }
}
})
--________________________________________________________
--chest
--________________________________________________________
minetest.register_craft({
output = "summer:chest" .. colour .. "",
recipe = {
{ "default:stone", "dye:" .. colour .. "", "default:stone" },
{ "group:wood", "", "group:wood" },
{ "group:wood", "group:wood", "group:wood" }
}
})
minetest.register_craft({
output = "summer:chest_lock" .. colour .. "",
recipe = {
{ "summer:chest" .. colour .. "", "default:diamond", "" }
--{"","",""},
--{"","",""}
}
})
end
--rake
minetest.register_craft({
output = "summer:rake",
recipe = {
{ "default:stick", "default:steel_ingot", "default:stick", },
{ "", "default:stick", "", },
{ "", "default:gold_ingot", "", }
}
})
--________________________________________________________ --________________________________________________________
--breccia --breccia
--________________________________________________________ --________________________________________________________
@ -226,4 +173,60 @@ if minetest.get_modpath("wool") and minetest.get_modpath("dye") then
}, },
}) })
--________________________________________________________ --________________________________________________________
--________________________________________________________
--ombrellone
--________________________________________________________
minetest.register_craft({
output = "summer:ombrellone_"..colour.."",
recipe = {
{"default:paper", "wool:"..colour, "default:paper", },
{"", "default:stick", "", },
{"", "default:stick", "", }
}
})
minetest.register_craft({
output = "summer:ombrellone_n_"..colour.."",
recipe = {
{"", "wool:"..colour, "" },
{"default:paper", "default:stick", "default:paper" },
{"", "default:stick", "" }
}
})
--________________________________________________________
--chest
--________________________________________________________
minetest.register_craft({
output = "summer:chest"..colour.."",
recipe = {
{"default:stone","dye:"..colour.."","default:stone"},
{"group:wood","","group:wood"},
{"group:wood","group:wood","group:wood"}
}
})
minetest.register_craft({
output = "summer:chest_lock"..colour.."",
recipe = {
{"summer:chest"..colour.."","default:diamond",""}
--{"","",""},
--{"","",""}
}
})
end
end end

View File

@ -13,6 +13,7 @@ local stairsplus_mod = minetest.get_modpath("moreblocks")
for _, granite in pairs(granite) do for _, granite in pairs(granite) do
if stairsplus_mod then if stairsplus_mod then
stairsplus:register_all("summer", granite[1], "summer:" .. granite[1], { stairsplus:register_all("summer", granite[1], "summer:" .. granite[1], {
description = granite[2] .. " Summer", description = granite[2] .. " Summer",
tiles = {granite[1] .. ".png"}, tiles = {granite[1] .. ".png"},
@ -26,6 +27,7 @@ for _, granite in pairs(granite) do
-- register all stair types for stairs redo -- register all stair types for stairs redo
elseif stairs_mod and stairs.mod then elseif stairs_mod and stairs.mod then
stairs.register_all("summer_" .. granite[1], "summer:" .. granite[1], stairs.register_all("summer_" .. granite[1], "summer:" .. granite[1],
{cracky = 3}, {cracky = 3},
{granite[1] .. ".png"}, {granite[1] .. ".png"},
@ -34,6 +36,7 @@ for _, granite in pairs(granite) do
-- register stair and slab using default stairs -- register stair and slab using default stairs
elseif stairs_mod then elseif stairs_mod then
stairs.register_stair_and_slab("summer_".. granite[1], "summer:".. granite[1], stairs.register_stair_and_slab("summer_".. granite[1], "summer:".. granite[1],
{cracky = 3}, {cracky = 3},
{granite[1] .. ".png"}, {granite[1] .. ".png"},
@ -42,7 +45,6 @@ for _, granite in pairs(granite) do
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
end end
end end
--GRANITE --GRANITE
minetest.register_node("summer:granite", { minetest.register_node("summer:granite", {
description = "Granite", description = "Granite",
@ -54,7 +56,6 @@ minetest.register_node("summer:granite", {
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:graniteA", { minetest.register_node("summer:graniteA", {
description = "GraniteA", description = "GraniteA",
tiles = {"graniteA.png"}, tiles = {"graniteA.png"},
@ -65,7 +66,6 @@ minetest.register_node("summer:graniteA", {
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:graniteP", { minetest.register_node("summer:graniteP", {
description = "GraniteP", description = "GraniteP",
tiles = {"graniteP.png"}, tiles = {"graniteP.png"},
@ -76,7 +76,6 @@ minetest.register_node("summer:graniteP", {
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:graniteR", { minetest.register_node("summer:graniteR", {
description = "GraniteR", description = "GraniteR",
tiles = {"graniteR.png"}, tiles = {"graniteR.png"},
@ -98,7 +97,6 @@ minetest.register_node("summer:graniteBC", {
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("summer:graniteB", { minetest.register_node("summer:graniteB", {
description = "Granite", description = "Granite",
tiles = {"graniteB.png"}, tiles = {"graniteB.png"},
@ -109,3 +107,5 @@ minetest.register_node("summer:graniteB", {
--legacy_mineral = true, --legacy_mineral = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })

View File

@ -21,7 +21,7 @@ dofile(path .. "/vetro.lua")
dofile(path.."/aliases.lua") dofile(path.."/aliases.lua")
dofile(path.."/sabbia.lua") dofile(path.."/sabbia.lua")
dofile(path.."/mattone.lua") dofile(path.."/mattone.lua")
dofile(path .. "/pietra.lua") --dofile(path.."/pietra.lua")
dofile(path.."/pallone.lua") dofile(path.."/pallone.lua")
dofile(path.."/granite.lua") dofile(path.."/granite.lua")
if minetest.get_modpath("cannabis") then if minetest.get_modpath("cannabis") then

View File

@ -24,6 +24,7 @@ local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2) return math.sqrt(v.x ^ 2 + v.z ^ 2)
end end
local function reg_materassino(color) local function reg_materassino(color)
local materassino_item_name = "summer:materassino_"..color.."_item" local materassino_item_name = "summer:materassino_"..color.."_item"
local materassino_ent_name = "summer:materassino_"..color.."_entity" local materassino_ent_name = "summer:materassino_"..color.."_entity"
@ -80,6 +81,7 @@ local function reg_materassino(color)
end end
end end
function materassino.on_activate(self, staticdata, dtime_s) function materassino.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({immortal = 1}) self.object:set_armor_groups({immortal = 1})
if staticdata then if staticdata then
@ -88,10 +90,12 @@ local function reg_materassino(color)
self.last_v = self.v self.last_v = self.v
end end
function materassino.get_staticdata(self) function materassino.get_staticdata(self)
return tostring(self.v) return tostring(self.v)
end end
function materassino.on_punch(self, puncher) function materassino.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then if not puncher or not puncher:is_player() or self.removed then
return return
@ -118,6 +122,7 @@ local function reg_materassino(color)
end end
end end
function materassino.on_step(self, dtime) function materassino.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then if self.driver then
@ -204,6 +209,7 @@ local function reg_materassino(color)
self.object:setacceleration(new_acce) self.object:setacceleration(new_acce)
end end
minetest.register_entity("summer:materassino_"..color.."", materassino) minetest.register_entity("summer:materassino_"..color.."", materassino)
@ -231,6 +237,8 @@ local function reg_materassino(color)
}) })
if minetest.get_modpath("cannabis") then if minetest.get_modpath("cannabis") then
minetest.register_craft({ minetest.register_craft({
output = materassino_item_name, output = materassino_item_name,
recipe = { recipe = {
@ -257,3 +265,4 @@ colors = {
for _,color in ipairs(colors) do for _,color in ipairs(colors) do
reg_materassino(color) reg_materassino(color)
end end

View File

@ -1,45 +1,43 @@
minetest.register_craftitem("summer:mattoneG", { minetest.register_craftitem("summer:mattoneG", {
description = "Mattone", description = "Mattone",
inventory_image = "mattone.png", inventory_image = "mattone.png",
})
})
minetest.register_craftitem("summer:mattoneR", { minetest.register_craftitem("summer:mattoneR", {
description = "MattoneR", description = "MattoneR",
inventory_image = "mattoneR.png", inventory_image = "mattoneR.png",
})
})
minetest.register_craftitem("summer:mattoneA", { minetest.register_craftitem("summer:mattoneA", {
description = "MattoneA", description = "MattoneA",
inventory_image = "mattoneA.png", inventory_image = "mattoneA.png",
})
})
minetest.register_craftitem("summer:mattoneP", { minetest.register_craftitem("summer:mattoneP", {
description = "MattoneP", description = "MattoneP",
inventory_image = "mattoneP.png", inventory_image = "mattoneP.png",
})
})
--craftMATTONE --craftMATTONE
minetest.register_craft({ minetest.register_craft({
type = 'cooking', type = 'cooking',
recipe = "summer:pietraA", recipe = "summer:pietraA",
cooktime = 2, cooktime = 2,
output = "summer:mattoneA", output = "summer:mattoneA",
}) })
minetest.register_craft({ minetest.register_craft({
type = 'cooking', type = 'cooking',
recipe = "summer:pietra", recipe = "summer:pietra",
cooktime = 2, cooktime = 2,
output = "summer:mattoneG", output = "summer:mattoneG",
}) })
minetest.register_craft({ minetest.register_craft({
type = 'cooking', type = 'cooking',
recipe = "summer:desert_pietra", recipe = "summer:desert_pietra",
cooktime = 2, cooktime = 2,
output = "summer:mattoneR", output = "summer:mattoneR",
}) })
minetest.register_craft({ minetest.register_craft({
type = 'cooking', type = 'cooking',
recipe = "summer:pietraP", recipe = "summer:pietraP",

View File

@ -32,6 +32,9 @@ for i in ipairs(Occhiali_list) do
groups = {armor_head=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use}, groups = {armor_head=math.floor(5*v.armor), armor_heal=v.heal, armor_use=v.use},
wear = 0, wear = 0,
}) })
end end
end end
end end

View File

@ -65,4 +65,6 @@ for i in ipairs(Ombrellone_list) do
minetest.set_node(pos, node) minetest.set_node(pos, node)
end, end,
}) })
end end

View File

@ -66,3 +66,4 @@ for i in ipairs(Ombrellone_n_list) do
end, end,
}) })
end end

View File

@ -2,6 +2,7 @@
local CALCIO = 0.1 local CALCIO = 0.1
local function reg_ball(color) local function reg_ball(color)
local ball_item_name = "summer:ball_"..color.."_item" local ball_item_name = "summer:ball_"..color.."_item"
local ball_ent_name = "summer:ball_"..color.."_entity" local ball_ent_name = "summer:ball_"..color.."_entity"
@ -117,6 +118,7 @@ local function reg_ball(color)
{ "", "cannabis:canapa_plastic", "" }, { "", "cannabis:canapa_plastic", "" },
}, },
}) })
end end
end end

View File

@ -129,17 +129,13 @@ minetest.register_on_generated(function(minp, maxp, seed)
nn = minetest.get_node({x=x,y=ground_y,z=z}).name nn = minetest.get_node({x=x,y=ground_y,z=z}).name
-- If desert sand, add dry shrub -- If desert sand, add dry shrub
if nn == "default:dirt_with_grass" then if nn == "default:dirt_with_grass" then
minetest.set_node(p, { minetest.set_node(p,{name="summer:roccia_"..pr:next(1,2), param2=math.random(0,3)})
name = "summer:roccia_" .. pr:next(1, 2),
param2 = math.random(0,
3)
})
elseif nn == "default:desert_sand" then elseif nn == "default:desert_sand" then
minetest.set_node(p, minetest.set_node(p,{name="summer:desert_roccia_"..pr:next(1,2), param2=math.random(0,3)})
{ name = "summer:desert_roccia_" .. pr:next(1, 2), param2 = math.random(0, 3) })
end end
end end
end end
end end
end end
end end

View File

@ -1,3 +1,4 @@
local Porta_list = { local Porta_list = {
{ "Red Door", "red"}, { "Red Door", "red"},
{ "Orange Door", "orange"}, { "Orange Door", "orange"},
@ -95,4 +96,7 @@ for i in ipairs(Porta_list) do
}) })
end, end,
}) })
end end

View File

@ -67,4 +67,6 @@ for i in ipairs(Portacenere_list) do
minetest.set_node(pos, node) minetest.set_node(pos, node)
end, end,
}) })
end end

View File

@ -24,6 +24,7 @@ local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2) return math.sqrt(v.x ^ 2 + v.z ^ 2)
end end
local function reg_salvag(color) local function reg_salvag(color)
local salvag_item_name = "summer:salvag_"..color.."_item" local salvag_item_name = "summer:salvag_"..color.."_item"
local salvag_ent_name = "summer:salvag_"..color.."_entity" local salvag_ent_name = "summer:salvag_"..color.."_entity"
@ -80,6 +81,7 @@ local function reg_salvag(color)
end end
end end
function salvag.on_activate(self, staticdata, dtime_s) function salvag.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({immortal = 1}) self.object:set_armor_groups({immortal = 1})
if staticdata then if staticdata then
@ -88,10 +90,12 @@ local function reg_salvag(color)
self.last_v = self.v self.last_v = self.v
end end
function salvag.get_staticdata(self) function salvag.get_staticdata(self)
return tostring(self.v) return tostring(self.v)
end end
function salvag.on_punch(self, puncher) function salvag.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then if not puncher or not puncher:is_player() or self.removed then
return return
@ -118,6 +122,7 @@ local function reg_salvag(color)
end end
end end
function salvag.on_step(self, dtime) function salvag.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then if self.driver then
@ -204,6 +209,7 @@ local function reg_salvag(color)
self.object:setacceleration(new_acce) self.object:setacceleration(new_acce)
end end
minetest.register_entity("summer:salvag_"..color.."", salvag) minetest.register_entity("summer:salvag_"..color.."", salvag)
@ -249,6 +255,7 @@ local function reg_salvag(color)
{"cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic"}, {"cannabis:canapa_plastic", "cannabis:canapa_plastic", "cannabis:canapa_plastic"},
}, },
}) })
end end
end end
@ -259,3 +266,5 @@ colors = {
for _,color in ipairs(colors) do for _,color in ipairs(colors) do
reg_salvag(color) reg_salvag(color)
end end

View File

@ -1,3 +1,4 @@
local sdraia_list = { local sdraia_list = {
{ "Red sdraia", "red"}, { "Red sdraia", "red"},
{ "Orange sdraia", "orange"}, { "Orange sdraia", "orange"},
@ -85,6 +86,7 @@ for i in ipairs(sdraia_list) do
p = {x=second_node_pos.x, y=second_node_pos.y, z=second_node_pos.z}; p = {x=second_node_pos.x, y=second_node_pos.y, z=second_node_pos.z};
end end
place_name = 'sdraia'; place_name = 'sdraia';
elseif( node.name=='summer:sleeping_mat' or node.name=='summer:straw_mat') then elseif( node.name=='summer:sleeping_mat' or node.name=='summer:straw_mat') then
place_name = 'mat'; place_name = 'mat';
dir = node.param2; dir = node.param2;
@ -144,6 +146,7 @@ for i in ipairs(sdraia_list) do
clicker:set_physics_override({0,0,0}) clicker:set_physics_override({0,0,0})
default.player_attached[pname] = true default.player_attached[pname] = true
return; return;
end end

View File

@ -95,6 +95,35 @@ for i in ipairs(vetro_list) do
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
})
minetest.register_craftitem("summer:vetro_traspp", {
description = "vetrino",
inventory_image = "vetro_traspp.png",
--groups = {stick = 1, flammable = 2},
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneG"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneA"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneR"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneP"
}) })
--vetro senza cornce --vetro senza cornce
minetest.register_craft({ minetest.register_craft({
@ -141,38 +170,6 @@ for i in ipairs(vetro_list) do
{"default:stick", "default:stick", "default:stick" } {"default:stick", "default:stick", "default:stick" }
} }
}) })
end
minetest.register_craftitem("summer:vetro_traspp", {
description = "vetrino",
inventory_image = "vetro_traspp.png",
--groups = {stick = 1, flammable = 2},
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneG"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneA"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneR"
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "summer:vetro_traspp",
recipe = "summer:mattoneP"
})
--trasp --trasp
minetest.register_craft({ minetest.register_craft({
output = "summer:vetro_colorato_trasp", output = "summer:vetro_colorato_trasp",
@ -214,3 +211,4 @@ minetest.register_craft({
{"default:stick", "", "default:stick", } {"default:stick", "", "default:stick", }
} }
}) })
end