Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Added a check for special attacks that include a normal max hit
(triple indenting curse descriptions)
(Added a check for special attacks that include a normal max hit)
Line 346: Line 346:
local result = 0
local result = 0
for i, dmg in pairs(specAttack.damage) do
for i, dmg in pairs(specAttack.damage) do
if dmg.maxRoll == 'Fixed' then
if dmg.damageType == 'Normal' then
--Account for special attacks that include a normal attack hit
local result = normalMaxHit
if dmg.amplitude ~= nil then
result = result * (dmg.amplitude / 100)
end
return result
elseif dmg.maxRoll == 'Fixed' then
result = dmg.maxPercent * 10
result = dmg.maxPercent * 10
elseif dmg.maxRoll == 'MaxHit' then
elseif dmg.maxRoll == 'MaxHit' then