2,875
edits
m (Fix nil exceptions) |
m (Replace Shared module with Number module) |
||
Line 1: | Line 1: | ||
local number = require('Module:Number') | |||
local p = {} | local p = {} | ||
-- | -- | ||
Line 18: | Line 16: | ||
-- Clamp values and turn them into decimals | -- Clamp values and turn them into decimals | ||
local preservationP = clamp(preservationChance, 0, 80) / 100 | local preservationP = number.clamp(preservationChance, 0, 80) / 100 | ||
local duplicationP = clamp(duplicationChance, 0, 100) / 100 | local duplicationP = number.clamp(duplicationChance, 0, 100) / 100 | ||
local extraItemP = math.max(extraItemChance, 0) / 100 | local extraItemP = math.max(extraItemChance, 0) / 100 | ||
Line 42: | Line 40: | ||
extraItemChance = extraItemChance or 0 | extraItemChance = extraItemChance or 0 | ||
local preservationP = clamp(preservationChance, 0, 80) / 100 | local preservationP = number.clamp(preservationChance, 0, 80) / 100 | ||
local duplicationP = clamp(duplicationChance, 0, 100) / 100 | local duplicationP = number.clamp(duplicationChance, 0, 100) / 100 | ||
local extraItemP = math.max(extraItemChance, 0) / 100 | local extraItemP = math.max(extraItemChance, 0) / 100 | ||
edits