Anonymous

Module:Attacks/Tables: Difference between revisions

From Melvor Idle
no edit summary
(Update for v1.3)
No edit summary
Line 7: Line 7:
local Items = require('Module:Items')
local Items = require('Module:Items')
local Attacks = require('Module:Attacks')
local Attacks = require('Module:Attacks')
local Num = require('Module:Number')


function p._getSpecialAttackTable(effectDefn, categories, sourceHeaderLabel, includeSource)
function p._getSpecialAttackTable(effectDefn, categories, sourceHeaderLabel, includeSource)
Line 200: Line 201:
if firstRow.chance then
if firstRow.chance then
rowSuffix = (rowCounts[spIdx][spAttRow.descType][spAttRow.chance] > 1 and 'rowspan="' .. rowCounts[spIdx][spAttRow.descType][spAttRow.chance] .. '" ') or ''
rowSuffix = (rowCounts[spIdx][spAttRow.descType][spAttRow.chance] > 1 and 'rowspan="' .. rowCounts[spIdx][spAttRow.descType][spAttRow.chance] .. '" ') or ''
table.insert(resultPart, '\r\n|' .. rowSuffix .. 'data-sort-value="' .. spAttRow.chance .. '" style="text-align:right;"| ' .. Shared.round(spAttRow.chance, 2, 0) .. '%')
table.insert(resultPart, '\r\n|' .. rowSuffix .. 'data-sort-value="' .. spAttRow.chance .. '" style="text-align:right;"| ' .. Num.round(spAttRow.chance, 2, 0) .. '%')
end
end
if firstRow.descType then
if firstRow.descType then
Line 210: Line 211:
spAttDesc = spAttDesc..'<br/>('
spAttDesc = spAttDesc..'<br/>('
local spAttDuration = spAttInterval * (spAtt.attackCount - 1)
local spAttDuration = spAttInterval * (spAtt.attackCount - 1)
spAttDesc = spAttDesc..Shared.round(spAttInterval / 1000, 2, 2)..'s delay between attacks.'
spAttDesc = spAttDesc..Num.round(spAttInterval / 1000, 2, 2)..'s delay between attacks.'
if spAtt.attackCount ~= nil and spAtt.attackCount > 2 then
if spAtt.attackCount ~= nil and spAtt.attackCount > 2 then
spAttDesc = spAttDesc..' '..Shared.round(spAttDuration / 1000, 2, 2)..'s total duration'
spAttDesc = spAttDesc..' '..Num.round(spAttDuration / 1000, 2, 2)..'s total duration'
end
end
spAttDesc = spAttDesc..')'
spAttDesc = spAttDesc..')'
2,875

edits