Module:Calculator/Summoning Interval Efficiency: Difference between revisions

m
no edit summary
(Implement Economy module changes)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
local number = require('Module:Number')
local number = require('Module:Number')
local economy = require('Module:ItemEconomy')
local economy = require('Module:ItemEconomy')
local TimeSpan = require('Module:TimeSpan')


local p = {}
local p = {}
Line 33: Line 34:
-- Calculate total amount of tablets made, including double chance
-- Calculate total amount of tablets made, including double chance
local averageTabletsMade = economy.estimatedOutput(playerStats.tabletsMade, eco)
local averageTabletsMade = 1 * economy.estimatedOutputMultiplier(eco)


-- Calculate the effective amount of tablets the player has from one craft, including tablet save chance
-- Calculate the effective amount of tablets the player has from one craft, including tablet save chance
Line 98: Line 99:
else
else
-- Calculate time saved in seconds for two and three tablet synergy
-- Calculate time saved in seconds for two and three tablet synergy
local twoTab = number.actionTimeToTimeSpan(calcResult.twoTabletTimeSave)
local twoTab = TimeSpan.fromSeconds(calcResult.twoTabletTimeSave)
     local threeTab = number.actionTimeToTimeSpan(calcResult.threeTabletTimeSave)
     local threeTab = TimeSpan.fromSeconds(calcResult.threeTabletTimeSave)
     tableData.effectiveTablets = number.round(calcResult.effectiveTablets, 2)
     tableData.effectiveTablets = number.round(calcResult.effectiveTablets, 2)
tableData.twoTabletTimeSave = number.round(twoTab.totalSeconds, 2)
tableData.twoTabletTimeSave = number.round(twoTab:getTotalSeconds(), 2)
tableData.threeTabletTimeSave = number.round(threeTab.totalSeconds, 2)
tableData.threeTabletTimeSave = number.round(threeTab:getTotalSeconds(), 2)
end
end


Line 118: Line 119:
function p._main(args)
function p._main(args)
-- Parse inputs and turn intervals into integers (hundreds of a second)
-- Parse inputs and turn intervals into integers (hundreds of a second)
local summoningInterval = number.toNumberOrError(args.summoningInterval) * 100
local summoningInterval = number.toNumberOrError(args.summoningInterval)
local actionTimeSaved = number.toNumberOrError(args.actionTimeSaved) * 100
local actionTimeSaved = number.toNumberOrError(args.actionTimeSaved)
local tabletsMade = number.toNumberOrError(args.tabletsMade)
local tabletsMade = number.toNumberOrError(args.tabletsMade)
local tabletDoubleChance = number.toNumberOrDefault(args.tabletDoubleChance, 0)
local tabletDoubleChance = number.toNumberOrDefault(args.tabletDoubleChance, 0)
1,048

edits