Anonymous

Module:ItemEconomy/Sandbox: Difference between revisions

From Melvor Idle
no edit summary
(Input calculation draft)
No edit summary
Line 71: Line 71:
-- @return (number) The estimated output of the crafting process.
-- @return (number) The estimated output of the crafting process.
function p.estimatedOutput(inputAmount, itemEconomy)
function p.estimatedOutput(inputAmount, itemEconomy)
eco = itemEconomy:verify()
local eco = itemEconomy:verify()


-- Equal inputAmount to inputsPerAction to get 1 baseAction
-- Equal inputAmount to inputsPerAction to get 1 baseAction
Line 89: Line 89:


function p.estimatedInputMultiplier(itemEconomy)
function p.estimatedInputMultiplier(itemEconomy)
local minInput = p.estimatedInput(nil, itemEconomy)
-- I'm fairly certain that the following holds true in any case.
return minInput / itemEconomy.outputsPerAction
return 1 / p.estimatedOutputMultiplier(itemEconomy)
end
end


function p.estimatedInput(outputAmount, itemEconomy)
function p.estimatedInput(outputAmount, itemEconomy)
eco = itemEconomy:verify()
local eco = itemEconomy:verify()


outputAmount = outputAmount or eco.outputsPerAction
outputAmount = outputAmount or eco.outputsPerAction
Line 124: Line 124:
eco.extraBaseItems = 0
eco.extraBaseItems = 0
eco.extraBaseItemChance = 0
eco.extraBaseItemChance = 0
 
mw.log(p.estimatedOutputMultiplier(eco))
mw.log(eco)
mw.log(p.estimatedInputMultiplier(eco))
mw.log(p.estimatedOutput(eco))
mw.log(p.estimatedInput(eco))
end
end
return p
return p
2,875

edits