Module:Monsters: Difference between revisions

getSpecAttackMaxHit: Resolve issue with aggregation of damage from multiple special attack damage sources
(Add column name for average healing)
(getSpecAttackMaxHit: Resolve issue with aggregation of damage from multiple special attack damage sources)
Line 389: Line 389:


function p.getSpecAttackMaxHit(specAttack, normalMaxHit, monster)
function p.getSpecAttackMaxHit(specAttack, normalMaxHit, monster)
local bestHit = 0
local bestHit, prevHit = 0, 0
for i, dmg in pairs(specAttack.damage) do
for i, dmg in ipairs(specAttack.damage) do
local thisHit = 0
local thisHit = 0
if dmg.damageType == 'Normal' then
if dmg.damageType == 'Normal' then
Line 424: Line 424:
-- TODO: This is limited in that there is no verification that bleed/poison
-- TODO: This is limited in that there is no verification that bleed/poison
-- can be applied to the target, it is assumed that it can and so this applies
-- can be applied to the target, it is assumed that it can and so this applies
thisHit = thisHit + dmg.maxPercent * 10
thisHit = prevHit + dmg.maxPercent * 10
end
end
prevHit = thisHit
if thisHit > bestHit then
if thisHit > bestHit then
bestHit = thisHit
bestHit = thisHit