Module:WeaponDPS: Difference between revisions
Jump to navigation
Jump to search
No edit summary Tags: Manual revert Reverted |
No edit summary Tag: Reverted |
||
Line 2: | Line 2: | ||
function p.dps(frame) | function p.dps(frame) | ||
local args = frame | local args = frame:getParent():getParent().args | ||
local str = tonumber(args.Strength or | local str = tonumber(args.Strength or args.Magic or args.Range) | ||
local ticks = tonumber(args.Ticks) | |||
if not str or not ticks or ticks == 0 then | |||
return "" | |||
if not str then return " | end | ||
local maxHit = str / 8 | local maxHit = str / 8 |
Revision as of 12:58, 8 June 2025
Documentation for this module may be created at Module:WeaponDPS/doc
local p = {}
function p.dps(frame)
local args = frame:getParent():getParent().args
local str = tonumber(args.Strength or args.Magic or args.Range)
local ticks = tonumber(args.Ticks)
if not str or not ticks or ticks == 0 then
return ""
end
local maxHit = str / 8
local seconds = ticks * 0.6
local dps = maxHit / seconds
return string.format("%.2f", dps)
end
return p