2,875
edits
No edit summary |
No edit summary |
||
Line 40: | Line 40: | ||
itemEconomy.duplicationChance = itemEconomy.duplicationChance or 0 | itemEconomy.duplicationChance = itemEconomy.duplicationChance or 0 | ||
itemEconomy.extraItemChance = itemEconomy.extraItemChance or 0 | itemEconomy.extraItemChance = itemEconomy.extraItemChance or 0 | ||
itemEconomy.extraItemAmount = itemEconomy.extraItemAmount or | itemEconomy.extraItemAmount = itemEconomy.extraItemAmount or 0 | ||
itemEconomy.flatExtraItems = itemEconomy.flatExtraItems or | itemEconomy.flatExtraItems = itemEconomy.flatExtraItems or 0 | ||
itemEconomy.extraBaseItemChance = itemEconomy.extraBaseItemChance or 0 | itemEconomy.extraBaseItemChance = itemEconomy.extraBaseItemChance or 0 | ||
itemEconomy.extraBaseItems = itemEconomy.extraBaseItems or 0 | itemEconomy.extraBaseItems = itemEconomy.extraBaseItems or 0 | ||
Line 49: | Line 49: | ||
itemEconomy.duplicationChance = number.clamp(itemEconomy.duplicationChance, 0, 100) / 100 | itemEconomy.duplicationChance = number.clamp(itemEconomy.duplicationChance, 0, 100) / 100 | ||
itemEconomy.extraItemChance = number.clamp(itemEconomy.extraItemChance, 0, 100) / 100 | itemEconomy.extraItemChance = number.clamp(itemEconomy.extraItemChance, 0, 100) / 100 | ||
itemEconomy. | itemEconomy.extraBaseItemChance = number.clamp(itemEconomy.extraBaseItemChance, 0, 100) / 100 | ||
return itemEconomy | return itemEconomy | ||
Line 77: | Line 77: | ||
local extraItems = (totalActions * eco.extraItemChance * eco.extraItemAmount) + (totalActions * eco.flatExtraItems) | local extraItems = (totalActions * eco.extraItemChance * eco.extraItemAmount) + (totalActions * eco.flatExtraItems) | ||
-- Calculates extra items that CAN be doubled. | -- Calculates extra items that CAN be doubled. | ||
local baseItems = ( | local baseItems = (eco.outputsPerAction + eco.extraBaseItemChance * eco.extraBaseItems) | ||
-- Total output | -- Total output | ||
Line 101: | Line 101: | ||
function p.Test() | function p.Test() | ||
local eco = ItemEconomy:new() | local eco = ItemEconomy:new() | ||
eco.flatExtraItems = 0 | |||
return p.estimatedOutput() | eco.preservationChance = 0 | ||
eco.duplicationChance = 50 | |||
eco.extraBaseItems = 1 | |||
eco.extraBaseItemChance = 100 | |||
return p.estimatedOutput(1000, eco) | |||
end | end | ||
return p | return p |
edits