random thing:
Total: 8
Baiken's tatami (presumably):
Total: 48
Millia's H disk:
Total: 65
Testament S reaper (uncharged)
Total: 46
Anji's butterfly
Total: 51
local p = {} local currentFrame local wikitext function p.drawFrameData(frame) currentFrame = 0 wikitext = "<div class=\"frameChart\">" -- Startup is the first active frame. Sets to true if empty. Otherwise it's false. local startupIsFirstActive if frame.args['startupIsFirstActive'] == nil then startupIsFirstActive = true else startupIsFirstActive = false end -- Startup of move, substract 1 if startupIsFirstActive local startup = frame.args['startup'] if tonumber(startup) ~= nil then if startupIsFirstActive and tonumber(startup) > 0 then startup = tonumber(startup) - 1 end end -- Active of move local active = frame.args['active'] -- Inactive of move local inactive = frame.args['inactive'] -- Recovery of move local recovery = frame.args['recovery'] -- Special Recovery of move local specialRecovery = frame.args['specialRecovery'] -- Display projectile spawn bar after startup? local isProjectile = frame.args['isProjectile'] -- FRC window frcStart = frame.args['frcStart'] frcEnd = frame.args['frcEnd'] -- projectile thingies local projOffset = frame.args['projOffset'] local projInactive = frame.args['projInactive'] local projActive = frame.args['projActive'] local atkFrames = {} -- drawFrame(startup, "startup") appendFrames(atkFrames, startup, "startup") -- drawFrame(active, "active") appendFrames(atkFrames, active, "active") local index = 2 while tonumber(frame.args['active' .. index]) ~= nil or tonumber(frame.args['inactive' .. index]) ~= nil do -- drawFrame(frame.args['active' .. index], "active") -- drawFrame(frame.args['inactive' .. index], "inactive") appendFrames(atkFrames, frame.args['active' .. index], "active") appendFrames(atkFrames, frame.args['inactive' .. index], "inactive") index = index + 1 end -- drawFrame(recovery, "recovery") -- drawFrame(specialRecovery, "specialRecovery") appendFrames(atkFrames, recovery, "recovery") appendFrames(atkFrames, specialRecovery, "specialRecovery") local totalRecovery = #atkFrames -- now deal with projectiles if isProjectile then appendProjFrames(atkFrames, projOffset, projInactive, projActive) end wikitext = wikitext .. framesToWikitext(atkFrames, isProjectile, projOffset) wikitext = wikitext .. "<span style=\"font-size: 90%\"> '''Total: '''" .. totalRecovery .. "</span></div>" return wikitext end function appendFrames(atkFrames, amt, typ) if amt == nil then return end for i=1, amt do table.insert(atkFrames, {typ}) end end function appendProjFrames(atkFrames, projOffset, projInactive, projActive) local frameNo = 0 projOffset = tonumber(projOffset) or 0 projInactive = tonumber(projInactive) or 0 projActive = tonumber(projActive) or 0 for i=1, projOffset do frameNo = frameNo + 1 if #atkFrames < frameNo then table.insert(atkFrames, {"dummy"}) end end for i=1,projInactive do frameNo = frameNo + 1 if #atkFrames < frameNo then table.insert(atkFrames, {"dummy"}) end table.insert(atkFrames[frameNo], "inactive") end for i=1,projActive do frameNo = frameNo + 1 if #atkFrames < frameNo then table.insert(atkFrames, {"dummy"}) end table.insert(atkFrames[frameNo], "active") end end function framesToWikitext(atkFrames, isProjectile, projOffset) local out = "" if not isProjectile then for _, frame in ipairs(atkFrames) do out = out .. "<div class=\"frame-data-" .. frame[1] .. "\"></div>" end else projOffset = tonumber(projOffset) for i, frame in ipairs(atkFrames) do if i == projOffset then out = out .. "<div class=\"spawn-projectile\" style='height:28px; vertical-align:bottom'></div>" end out = out .. "<div style='display:inline-block'>" out = out .. "<div class=\"frame-data-" .. frame[1] .. "\" style='display:inline-block'></div>" if frame[2] ~= nil then out = out .. "<div class=\"frame-data-" .. frame[2] .. "\" style='display:block'></div>" end out = out .. "</div>" end end return out end return p -- local f=mw.getCurrentFrame():newChild{args={startup=2, active=2, recovery=3}}; mw.log(p.drawFrameData(f)) -- local f=mw.getCurrentFrame():newChild{args={startup=2, active=2, recovery=3, isProjectile=true, projOffset=1,projInactive=2, projActive=3}}; mw.log(p.drawFrameData(f))