Module:BTD6 stats: Difference between revisions

mNo edit summary
mNo edit summary
Line 72: Line 72:
local amount = 0
local amount = 0
if attack.rate then headingLower[#headingLower+1] = "Cooldown" amount = amount + 1 end
if attack.rate and attack.rate < 9999 and not attack.rateMin then headingLower[#headingLower+1] = "Cooldown" amount = amount + 1 end
if attack.initialDamage and attack.initialDamage > 0 then headingLower[#headingLower+1] = "Scratch damage" amount = amount + 1 end
if attack.initialDamage and attack.initialDamage > 0 then headingLower[#headingLower+1] = "Scratch damage" amount = amount + 1 end
if attack.grapplingDamage and attack.grapplingDamage > 0 then headingLower[#headingLower+1] = "Grappling damage" amount = amount + 1 end
if attack.grapplingDamage and attack.grapplingDamage > 0 then headingLower[#headingLower+1] = "Grappling damage" amount = amount + 1 end
if attack.thrashingProjectileRate then headingLower[#headingLower+1] = "Thrash cooldown" amount = amount + 1 end
if attack.thrashingProjectileRate then headingLower[#headingLower+1] = "Thrash cooldown" amount = amount + 1 end
if amount > 0 then
if amount > 0 then
Line 84: Line 84:
-- projectiles
-- projectiles
if attack.projectiles then headingProjectiles(attack.projectiles) end
if attack.projectiles then headingProjectiles(attack.projectiles) end
end
end
local headingAbilities = function(abils)
for i, v in ipairs(abils["_order"]) do
local abil = abils[v]
local amount = 0
if abil.cooldown then headingLower[#headingLower+1] = "Cooldown" amount = amount + 1 end
if amount > 0 then
headingUpper[#headingUpper+1] = v
upperColspans[#upperColspans+1] = amount
end
-- projectiles
if abil.projectiles then headingProjectiles(abil.projectiles) end
end
end
end
end
Line 124: Line 141:
end
end
if data.attacks then headingAttacks(data.attacks) end
if data.attacks then headingAttacks(data.attacks) end
if data.abilities then
if data.abilities then headingAbilities(data.abilities) end
for i, v in ipairs(data.abilities["_order"]) do
if data.abilities[v]["projectiles"] then headingProjectiles(data.abilities[v]["projectiles"]) end
end
end
ret[#ret+1] = "!rowspan=2|Power!!rowspan=2|Scale"
ret[#ret+1] = "!rowspan=2|Power!!rowspan=2|Scale"
Line 146: Line 159:
-- attack cooldown
-- attack cooldown
local insertRate = function(amt)
local insertRate = function(amt)
ret[#ret+1] = sformat("|%gs", amt - (data.cooldownScaleRange*scale))
ret[#ret+1] = sformat("| %gs", amt - (data.cooldownScaleRange*scale))
end
end
Line 193: Line 206:
if projectile.maxPierce < 1 and projectile.pierce < 99999 then insertPierce(projectile.pierce) end
if projectile.maxPierce < 1 and projectile.pierce < 99999 then insertPierce(projectile.pierce) end
if projectile.damage and projectile.damage > 0 then insertDamage(projectile.damage) end
if projectile.damage and projectile.damage > 0 then insertDamage(projectile.damage) end
if projectile.damageModifierForStunned then insertStunDamage(projectile.damage) end
if projectile.damageModifierForStunned then insertStunDamage(projectile.damageModifierForStunned) end
if projectile.effects then parseEffects(projectile.effects) end
if projectile.effects then parseEffects(projectile.effects) end