Skip to content

Commit

Permalink
Make drop logic work better for non-8-step-plants. (#1544)
Browse files Browse the repository at this point in the history
Using @paramat's formula.
  • Loading branch information
Thomas--S authored and sofar committed Feb 8, 2017
1 parent 2e950ac commit c88c0a9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mods/farming/api.lua
Expand Up @@ -330,12 +330,16 @@ farming.register_plant = function(name, def)

-- Register growing steps
for i = 1, def.steps do
local base_rarity = 1
if def.steps ~= 1 then
base_rarity = 8 - (i - 1) * 7 / (def.steps - 1)
end
local drop = {
items = {
{items = {mname .. ":" .. pname}, rarity = 9 - i},
{items = {mname .. ":" .. pname}, rarity= 18 - i * 2},
{items = {mname .. ":seed_" .. pname}, rarity = 9 - i},
{items = {mname .. ":seed_" .. pname}, rarity = 18 - i * 2},
{items = {mname .. ":" .. pname}, rarity = base_rarity},
{items = {mname .. ":" .. pname}, rarity = base_rarity * 2},
{items = {mname .. ":seed_" .. pname}, rarity = base_rarity},
{items = {mname .. ":seed_" .. pname}, rarity = base_rarity * 2},
}
}
local nodegroups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1}
Expand Down

0 comments on commit c88c0a9

Please sign in to comment.