Anonymous

Module:Attacks/Tables: Difference between revisions

From Melvor Idle
Added total duration for attacks with 3+ hits
(Adding notes to the Special Attack table with the delay between each attack)
(Added total duration for attacks with 3+ hits)
Line 184: Line 184:
             rowSuffix = (rowCounts[spIdx][spAttRow.descType]['rows'] > 1 and '|rowspan="' .. rowCounts[spIdx][spAttRow.descType]['rows'] .. '"') or ''
             rowSuffix = (rowCounts[spIdx][spAttRow.descType]['rows'] > 1 and '|rowspan="' .. rowCounts[spIdx][spAttRow.descType]['rows'] .. '"') or ''
             local spAttDesc = spAtt['description'][spAttRow.descType]
             local spAttDesc = spAtt['description'][spAttRow.descType]
             --Adding the time between hits as a note at the end of the special attack description
             --Adding the time between hits and total duration as a note at the end of the special attack description
             local spAttInterval = spAtt.attackInterval ~= nil and spAtt.attackInterval or -1
             local spAttInterval = spAtt.attackInterval ~= nil and spAtt.attackInterval or -1
             if(spAttInterval ~= -1) then
             if(spAttInterval ~= -1 and spAtt.damage ~= nil and Shared.tableCount(spAtt.damage) > 0) then
             spAttDesc = spAttDesc..'<br/>'..'('..Shared.round(spAttInterval / 1000, 1, 1)..'s delay between attacks)'
             spAttDesc = spAttDesc..'<br/>('
            local spAttDuration = spAttInterval * (spAtt.attackCount - 1)
            spAttDesc = spAttDesc..Shared.round(spAttInterval / 1000, 2, 2)..'s delay between attacks.'
            if spAttDuration ~= spAttInterval then
            spAttDesc = spAttDesc..' '..Shared.round(spAttDuration / 1000, 2, 2)..'s total duration'
            end
            spAttDesc = spAttDesc..')'
             end
             end
             table.insert(resultPart, '\r\n' .. rowSuffix .. '| ' .. spAttDesc)
             table.insert(resultPart, '\r\n' .. rowSuffix .. '| ' .. spAttDesc)