now bees need flowers in a radius around them to work, te radius and the flower is decided by their genes

This commit is contained in:
StochasticMouse 2024-10-16 16:32:58 +02:00
parent 30f1a93f73
commit 5cbad2c5e5
3 changed files with 24 additions and 17 deletions

View File

@ -1,5 +1,11 @@
forestry_bees.bee_base_genes = {}
forestry_bees.flower_table = {}
forestry_bees.flower_table["flowers"] = {"flowers:dandelion_white", "flowers:tulip_black",
"flowers:chrysanthemum_green", "flowers:dandelion_yellow",
"flowers:tulip", "flowers:geranium",
"flowers:viola", "flowers:rose"}
local function register_base_gene(bee_type, base_genes)
forestry_bees.bee_base_genes[bee_type] = base_genes
end
@ -28,23 +34,23 @@ end
--https://docs.google.com/spreadsheets/d/1_moZHLnL35_u-bJ7kFDxWDxY9OuMWK_4l0EB4wIx0_s/edit?f=true&noheader=false&gid=1#gid=1
--mundane branch
register_base_gene("forest",{production = 0.3, fertility = 3, lifespan = 20, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("meadows",{production = 0.3, fertility = 2, lifespan = 20, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("modest",{production = 0.6, fertility = 2, lifespan = 30, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("tropical",{production = 0.6, fertility = 2, lifespan = 30, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("wintry",{production = 0.6, fertility = 4, lifespan = 30, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("marshy",{production = 0.3, fertility = 2, lifespan = 10, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("forest",{production = 0.3, fertility = 3, lifespan = 20, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
register_base_gene("meadows",{production = 0.3, fertility = 2, lifespan = 20, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
register_base_gene("modest",{production = 0.6, fertility = 2, lifespan = 30, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
register_base_gene("tropical",{production = 0.6, fertility = 2, lifespan = 30, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
register_base_gene("wintry",{production = 0.6, fertility = 4, lifespan = 30, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
register_base_gene("marshy",{production = 0.3, fertility = 2, lifespan = 10, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
--common branch
register_base_gene("common",{production = 0.6, fertility = 2, lifespan = 20, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("cultivated",{production = 1.2, fertility = 2, lifespan = 10, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("common",{production = 0.6, fertility = 2, lifespan = 20, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
register_base_gene("cultivated",{production = 1.2, fertility = 2, lifespan = 10, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
--noble branch
register_base_gene("noble",{production = 0.6, fertility = 2, lifespan = 30, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("majestic",{production = 1, fertility = 4, lifespan = 35, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("imperial",{production = 0.6, fertility = 2, lifespan = 40, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("noble",{production = 0.6, fertility = 2, lifespan = 30, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
register_base_gene("majestic",{production = 1, fertility = 4, lifespan = 35, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
register_base_gene("imperial",{production = 0.6, fertility = 2, lifespan = 40, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
--industrious branch
register_base_gene("diligent",{production = 0.6, fertility = 2, lifespan = 30, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("unweary",{production = 1, fertility = 2, lifespan = 35, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("indostrious",{production = 0.6, fertility = 2, lifespan = 40, nocturnal = false, cave = false, flyer = false, flower = "flowers"})
register_base_gene("diligent",{production = 0.6, fertility = 2, lifespan = 30, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
register_base_gene("unweary",{production = 1, fertility = 2, lifespan = 35, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
register_base_gene("indostrious",{production = 0.6, fertility = 2, lifespan = 40, nocturnal = false, cave = false, flyer = false, flower = "flowers", radius = 4})
---heroic branch
---infernal branch
--- austere branch
@ -53,4 +59,4 @@ register_base_gene("indostrious",{production = 0.6, fertility = 2, lifespan = 40
---frozen branch
---festive branch
--agrarian branch
register_base_gene("rural",{production = 0.6, fertility = 2, lifespan = 10, nocturnal = false, cave = false, flyer = false, flower = "wheat"})
register_base_gene("rural",{production = 0.6, fertility = 2, lifespan = 10, nocturnal = false, cave = false, flyer = false, flower = "wheat", radius = 4})

View File

@ -1,2 +1,2 @@
--base multiplier for bee lifespan, default value is 27.5 to have parity with MC-forestry
lifespan_multiplier = 0.05
lifespan_multiplier = 1

View File

@ -29,7 +29,8 @@ function forestry_bees.can_queen_work(queen, pos)
local is_sky_access = (genes["cave"][1] or (minetest.get_natural_light(vector.offset(pos, 0, 1, 0), 0.5) == 15))
local is_not_raining = (genes["flyer"][1] or true) --would require additional mods
local is_day = (genes["nocturnal"][1] or ((0.25 < minetest.get_timeofday()) and (minetest.get_timeofday() < 0.75)))
return is_sky_access and is_not_raining and is_day
local is_flower = not (minetest.find_node_near(pos, genes["radius"][1], forestry_bees.flower_table[genes["flower"][1]]) == nil)
return is_sky_access and is_not_raining and is_day and is_flower
end
function forestry_bees.calculate_drop(bee)