Savage gathering and planting.
This commit is contained in:
parent
518a8384fc
commit
f693268c75
2 changed files with 37 additions and 2 deletions
|
@ -3,6 +3,7 @@ flowers
|
|||
wool
|
||||
bucket
|
||||
beds
|
||||
farming?
|
||||
hunger?
|
||||
mobs?
|
||||
mobs_monster?
|
||||
|
|
38
village.lua
38
village.lua
|
@ -2,6 +2,7 @@ local newnode = fun_caves.clone_node("default:dirt")
|
|||
newnode.drop = "default:dirt"
|
||||
newnode.groups.soil = 0
|
||||
minetest.register_node("fun_caves:hut_floor", newnode)
|
||||
local farming = minetest.get_modpath('farming')
|
||||
|
||||
|
||||
if mobs and mobs.mod == "redo" then
|
||||
|
@ -18,6 +19,39 @@ if mobs and mobs.mod == "redo" then
|
|||
drops[#drops+1] = {name = "mobs:leather", chance = 4, min = 1, max = 2}
|
||||
end
|
||||
|
||||
local food = {}
|
||||
for i = 1, 5 do
|
||||
food[#food+1] = 'default:grass_'..i
|
||||
end
|
||||
if farming then
|
||||
for i = 5, 8 do
|
||||
food[#food+1] = 'farming:wheat_'..i
|
||||
end
|
||||
end
|
||||
local function savage_gathering(self)
|
||||
if not fun_caves.custom_ready(self) then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = self.object:getpos()
|
||||
|
||||
fun_caves.search_replace(pos, 5, food, 'air')
|
||||
|
||||
if math.random(5) == 1 then
|
||||
local p1 = vector.subtract(pos, 2)
|
||||
local p2 = vector.add(pos, 2)
|
||||
local soil = minetest.find_nodes_in_area_under_air(p1, p2, {'farming:soil_wet'})
|
||||
if soil and #soil > 0 then
|
||||
local p = soil[math.random(#soil)]
|
||||
p.y = p.y + 1
|
||||
minetest.add_node(p, {name = 'farming:seed_wheat', param2 = 1})
|
||||
minetest.get_node_timer(p):start(math.random(166, 286))
|
||||
end
|
||||
end
|
||||
|
||||
fun_caves.surface_damage(self)
|
||||
end
|
||||
|
||||
mobs:register_mob("fun_caves:savage", {
|
||||
description = "Primitive Savage",
|
||||
type = "monster",
|
||||
|
@ -71,7 +105,7 @@ if mobs and mobs.mod == "redo" then
|
|||
},
|
||||
animation_speed = 30,
|
||||
on_rightclick = nil,
|
||||
do_custom = nil,
|
||||
do_custom = savage_gathering,
|
||||
})
|
||||
|
||||
|
||||
|
@ -200,7 +234,7 @@ fun_caves.village = function(minp, maxp, data, p2data, area, node, biome, height
|
|||
if math.random(10) == 1 then
|
||||
data[ivm] = node['default:dry_shrub']
|
||||
end
|
||||
else
|
||||
elseif farming then
|
||||
data[ivm] = node['farming:wheat_'..math.random(7)]
|
||||
end
|
||||
elseif y > heightmap[index] then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue