Module:WeaponDPS: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
if not ticks then return "No speed" end | if not ticks then return "No speed" end | ||
local effectiveStr = str + (acc / | local effectiveStr = str + (acc / 8) | ||
local maxHit = effectiveStr / 8 | local maxHit = effectiveStr / 8 | ||
local seconds = ticks * 0.6 | local seconds = ticks * 0.6 |
Revision as of 13:13, 8 June 2025
Documentation for this module may be created at Module:WeaponDPS/doc
local p = {}
function p.dps(frame)
local args = frame.args
local parent = frame:getParent()
local str = tonumber(args.Strength or parent.args.Strength) or 0
local acc = tonumber(args.Accuracy or parent.args.Accuracy) or 0
local ticks = tonumber(args.Speed or parent.args.Speed)
if (str == 0 and acc == 0) then return "No STR or ACC" end
if not ticks then return "No speed" end
local effectiveStr = str + (acc / 8)
local maxHit = effectiveStr / 8
local seconds = ticks * 0.6
local dps = maxHit / seconds
return '<abbr title="Estimated damage per second">' .. string.format('%.2f', (dps * 1)) .. '</abbr>'
end
return p