More readable drop help for some complex drops
This commit is contained in:
parent
15b020cc20
commit
9f4942e215
11
init.lua
11
init.lua
@ -514,9 +514,13 @@ doc.new_category("nodes", {
|
||||
if max == nil then
|
||||
formstring = formstring .. "This block will drop the following items when mined: "
|
||||
elseif max == 1 then
|
||||
formstring = formstring .. "This block will randomly drop one of the following when mined: "
|
||||
if #data.def.drop.items == 1 then
|
||||
formstring = formstring .. "This block will drop the following when mined: "
|
||||
else
|
||||
formstring = formstring .. "This block will randomly drop up to "..max.." items of the following items when mined: "
|
||||
formstring = formstring .. "This block will randomly drop one of the following drops when mined: "
|
||||
end
|
||||
else
|
||||
formstring = formstring .. "This block will randomly drop up to "..max.." drops of the following possible drops when mined: "
|
||||
end
|
||||
local remaining_rarity = 1
|
||||
-- Save calculated probabilities into a table for later output
|
||||
@ -574,6 +578,8 @@ doc.new_category("nodes", {
|
||||
end
|
||||
|
||||
local rarity = probtable.rarity
|
||||
-- No percentage if there's only one possible guaranteed drop
|
||||
if not(rarity == 1 and #data.def.drop.items == 1) then
|
||||
local chance = (1/rarity)*100
|
||||
local ca = ""
|
||||
if rarity > 200 then -- <0.5%
|
||||
@ -588,6 +594,7 @@ doc.new_category("nodes", {
|
||||
end
|
||||
formstring = formstring .. string.format(" (%s%.0f%%)", ca, chance)
|
||||
end
|
||||
end
|
||||
formstring = formstring .. ".\n"
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user