Added the Gardener buff for fire starters
parent
2f00e64ec0
commit
cc3404739c
|
@ -60,33 +60,33 @@ return {
|
|||
sand = "soulbound",
|
||||
coal_lump = "soulbound",
|
||||
iron_lump = "soulbound",
|
||||
sapling = "soulbound",
|
||||
sapling = "gardener",
|
||||
mese_crystal = "durable",
|
||||
copper_lump = "soulbound",
|
||||
diamond = "durable",
|
||||
gold_lump = "soulbound",
|
||||
junglesapling = "soulbound",
|
||||
seed_cotton = "soulbound",
|
||||
seed_wheat = "soulbound",
|
||||
junglesapling = "gardener",
|
||||
seed_cotton = "gardener",
|
||||
seed_wheat = "gardener",
|
||||
string = "soulbound",
|
||||
wheat = "soulbound",
|
||||
cotton = "soulbound",
|
||||
pine_sapling = "soulbound",
|
||||
acacia_sapling = "soulbound",
|
||||
pine_sapling = "gardener",
|
||||
acacia_sapling = "gardener",
|
||||
mushroom_brown = "soulbound",
|
||||
mushroom_red = "soulbound",
|
||||
mushroom_spores_brown = "soulbound",
|
||||
mushroom_spores_red = "soulbound",
|
||||
aspen_sapling = "soulbound",
|
||||
mushroom_spores_brown = "gardener",
|
||||
mushroom_spores_red = "gardener",
|
||||
aspen_sapling = "gardener",
|
||||
flint = "soulbound",
|
||||
coral_skeleton = "soulbound",
|
||||
acacia_bush_sapling = "soulbound",
|
||||
bush_sapling = "soulbound",
|
||||
acacia_bush_sapling = "gardener",
|
||||
bush_sapling = "gardener",
|
||||
tin_lump = "soulbound",
|
||||
blueberries = "soulbound",
|
||||
blueberry_bush_sapling = "soulbound",
|
||||
blueberry_bush_sapling = "gardener",
|
||||
ice = "soulbound",
|
||||
pine_bush_sapling = "soulbound",
|
||||
pine_bush_sapling = "gardener",
|
||||
dry_dirt = "soulbound",
|
||||
},
|
||||
pick = {
|
||||
|
|
|
@ -62,6 +62,7 @@ local buff_name = {
|
|||
adjuster = S("Kelp Adjuster"),
|
||||
breaker = S("Breaker"),
|
||||
mosser = S("Mosser"),
|
||||
gardener = S("Gardener"),
|
||||
}
|
||||
|
||||
local rune_element_modname = {
|
||||
|
|
|
@ -388,7 +388,7 @@ minetest.register_tool("runes:screwdriver", {
|
|||
|
||||
-----------------------------------------------------------------------
|
||||
-- SHAMELESSLY COPIED VERBATIM FROM THE FIRE MOD, WITH ONLY THE WEAR
|
||||
-- AMOUNT ALTERED. CREDIT GOES TO:
|
||||
-- AMOUNT ALTERED AND THE BUFF EFFECT ADDED. CREDIT GOES TO:
|
||||
-- Originally by RealBadAngel, Maciej Kasatkin (LGPLv2.1+)
|
||||
-- Various Minetest developers and contributors (LGPLv2.1+)
|
||||
-----------------------------------------------------------------------
|
||||
|
@ -401,6 +401,7 @@ minetest.register_tool("runes:fire_starter", {
|
|||
groups = {disable_repair = 1},
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
local meta = itemstack:get_meta()
|
||||
local sound_pos = pointed_thing.above or user:get_pos()
|
||||
minetest.sound_play(
|
||||
"fire_flint_and_steel",
|
||||
|
@ -422,12 +423,31 @@ minetest.register_tool("runes:fire_starter", {
|
|||
elseif minetest.get_item_group(node_under, "flammable") >= 1
|
||||
and minetest.get_node(pointed_thing.above).name == "air" then
|
||||
minetest.set_node(pointed_thing.above, {name = "fire:basic_flame"})
|
||||
elseif meta:get("gardener") then
|
||||
if minetest.get_item_group(node_under, "soil") > 0 then
|
||||
local airpos = {
|
||||
x = pointed_thing.under.x,
|
||||
y = pointed_thing.under.y + 1,
|
||||
z = pointed_thing.under.z,
|
||||
}
|
||||
local air = minetest.get_node_or_nil(airpos)
|
||||
if air and air.name == "air"
|
||||
and minetest.get_node_light(airpos) > 12 then
|
||||
local pos0 = vector.subtract(airpos, 4)
|
||||
local pos1 = vector.add(airpos, 4)
|
||||
local flora = minetest.find_nodes_in_area(pos0, pos1, "group:flora")
|
||||
if #flora > 0 and #flora < 4 then
|
||||
local selection = minetest.get_node(flora[math.random(1, #flora)])
|
||||
minetest.set_node(airpos, selection)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Wear tool
|
||||
local wdef = itemstack:get_definition()
|
||||
local wear = 500
|
||||
if itemstack:get_meta():get("durability") then
|
||||
if meta:get("durability") then
|
||||
wear = 334
|
||||
end
|
||||
itemstack:add_wear(wear)
|
||||
|
|
Loading…
Reference in New Issue