Documentation for this module may be created at Module:ModuleCalculateCost/doc
-----------------------------------------------------------
-- Most modules go up in cost by 1 for every enhancement level
-- Except for sub modules and descendant skills. Those go down in cost.
-- Because this game rule is referenced in multiple lua modules
-- this was broken into its own lua module.
local p = {}
function p.calculate_module_cost(baseCost, enhancementLevel, exclusiveCategory)
local cost = tonumber(baseCost)
local level = tonumber(enhancementLevel)
if cost == nil or level == nil then
return "?"
end
local modifier = 1
if exclusiveCategory == "Sub Module" or exclusiveCategory == "Skill" then
modifier = -1
end
return baseCost + (enhancementLevel * modifier)
end
return p