Module:Monsters: Difference between revisions

Added check to allow for showing monster normal attacks if it sometimes does it as a fallback.
(Added an additional check to the activeBuffs check to fix an issue with specifically Aeris's Cyclone attack.)
(Added check to allow for showing monster normal attacks if it sometimes does it as a fallback.)
Line 413: Line 413:
     typeText = 'Magic'
     typeText = 'Magic'
   end
   end
  local buffAttacks = {}
  local hasActiveBuffSpec = false


   local normalAttackChance = 100
   local normalAttackChance = 100
Line 427: Line 430:


       result = result..'\r\n* '..attChance..'% '..iconText..' '..specAttack.name..'\r\n** '..specAttack.description
       result = result..'\r\n* '..attChance..'% '..iconText..' '..specAttack.name..'\r\n** '..specAttack.description
      if specAttack.activeBuffs and specAttack.activeBuffTurns ~= nil and specAttack.activeBuffTurns > 0 then
        table.insert(buffAttacks, specAttack.name)
        hasActiveBuffSpec = true
      end
     end
     end
   end
   end
   if normalAttackChance == 100 then
   if normalAttackChance == 100 then
     result = iconText..'1 - '..p.getMonsterBaseMaxHit(frame)..' '..typeText..' Damage'
     result = iconText..'1 - '..p._getMonsterBaseMaxHit(monster)..' '..typeText..' Damage'
   elseif normalAttackChance > 0 then
   elseif normalAttackChance > 0 then
     result = '* '..normalAttackChance..'% '..iconText..'1-'..p.getMonsterBaseMaxHit(frame)..' '..typeText..' Damage'..result
     result = '* '..normalAttackChance..'% '..iconText..'1-'..p.getMonsterBaseMaxHit(frame)..' '..typeText..' Damage'..result
  elseif hasActiveBuffSpec then
    --If the monster normally has a 0% chance of doing a normal attack but some special attacks can't be repeated, include it
    --(With a note about when it does it)
    result = '* 1 - '..p._getMonsterBaseMaxHit(monster)..' '..typeText..' Damage (Instead of repeating '..table.concat(buffAttacks, ' or ')..' while the buff is already active)'..result
   end
   end
   return result
   return result
end
end