Compare commits

...

5 Commits

Author SHA1 Message Date
rnd 58552ef274 .. 2015-06-02 20:09:13 +02:00
rnd 12d1795b55 .. 2015-06-01 18:12:26 +02:00
rnd bcc2960983 .. 2015-06-01 07:42:02 +02:00
rnd 5bee159bbe .. 2015-05-27 19:31:04 +02:00
rnd fdbbd4c02c .. 2015-05-26 23:21:55 +02:00
3 changed files with 27 additions and 16 deletions

View File

@ -323,6 +323,12 @@ farming.register_plant = function(name, def)
pos.y = pos.y+1; minetest.set_node(pos, {name ="default:grass_1"})
return
end
-- insta growth possibility with high farming skill
if (quality > 100 and math.random(math.ceil(20*100/quality)) == 1) or quality > 2000 then
plant_height = 7;
end
minetest.set_node(pos, {name = mname .. ":" .. pname .. "_" .. plant_height + 1})
if plant_height+1 == 8 then minetest.set_node({x=pos.x,y=pos.y-1,z=pos.z}, {name ="default:dirt"}) end -- rnd: when plant fully grown it creates dirt

View File

@ -140,7 +140,10 @@ local function overwrite(name)
if not protector.can_dig(5,pos,digger) then return end
local name = digger:get_player_name(); if name == nil then return end
if playerdata then
local dig = playerdata[name].dig/5+200
local dig = 0;
if playerdata[name] then
dig = playerdata[name].dig/5+200
end
if pos.y<-dig then
minetest.set_node(pos, {name="default:stone"})
minetest.chat_send_player(name,"With current dig skill you can only dig up to depth "..dig);

View File

@ -287,16 +287,18 @@ local function tweak_saplings(name,skill_req) -- farming:seed_wheat
end
end
table2.on_punch = function(pos, node, puncher, pointed_thing)
local pname = puncher:get_player_name(); if pname==nil then return end
table2.can_dig = function(pos, player)
local pname = player:get_player_name(); if pname==nil then return false end
local skill = playerdata[pname].farming;
if skill < skill_req then
local inv = puncher:get_inventory();
local inv = player:get_inventory();
inv:remove_item("main", ItemStack(name.. " 90"))
minetest.chat_send_player(pname,"You need " .. skill_req .. " farming before you can dig this sapling .")
return
return false
end
return true
end
minetest.register_node(":"..name, table2);
@ -305,16 +307,16 @@ end
minetest.after(1, function()
tweak_saplings("moretrees:apple_tree_sapling",20);
tweak_saplings("moretrees:rubber_tree_sapling",40);
tweak_saplings("moretrees:willow_sapling",80);
tweak_saplings("moretrees:acacia_sapling",160);
tweak_saplings("moretrees:fir_sapling",320);
tweak_saplings("moretrees:pine_sapling",640);
tweak_saplings("moretrees:spruce_sapling",1000);
tweak_saplings("moretrees:birch_sapling",2000);
tweak_saplings("moretrees:beech_sapling",3000);
tweak_saplings("moretrees:oak_sapling",4000);
tweak_saplings("moretrees:sequoia_sapling",5000);
tweak_saplings("moretrees:palm_sapling",8000);
tweak_saplings("moretrees:rubber_tree_sapling",30);
tweak_saplings("moretrees:willow_sapling",45);
tweak_saplings("moretrees:acacia_sapling",67);
tweak_saplings("moretrees:fir_sapling",101);
tweak_saplings("moretrees:pine_sapling",151);
tweak_saplings("moretrees:spruce_sapling",227);
tweak_saplings("moretrees:birch_sapling",341);
tweak_saplings("moretrees:beech_sapling",512);
tweak_saplings("moretrees:oak_sapling",768);
tweak_saplings("moretrees:sequoia_sapling",1153);
tweak_saplings("moretrees:palm_sapling",1729);
end
)