Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Formatting tweak
(have i mentioned i'm super lazy?)
(Formatting tweak)
(One intermediate revision by the same user not shown)
Line 307: Line 307:
end
end


function p._getMonsterAreas(monster, excludeDungeons)
function p._getMonsterAreas(monster, excludeDungeons, includeEffects)
if includeEffects == nil then includeEffects = false end
local resultPart = {}
local resultPart = {}
local hideDungeons = excludeDungeons ~= nil and excludeDungeons or false
local hideDungeons = excludeDungeons ~= nil and excludeDungeons or false
Line 314: Line 315:
if area.type ~= 'dungeon' or not hideDungeons then
if area.type ~= 'dungeon' or not hideDungeons then
local imgType = (area.type == 'slayerArea' and 'combatArea') or area.type
local imgType = (area.type == 'slayerArea' and 'combatArea') or area.type
table.insert(resultPart, Icons.Icon({area.name, type = imgType}))
local txt = Icons.Icon({area.name, type = imgType})
if area.type == 'slayerArea' then
local areaDescrip = Areas._getAreaStat(area, 'areaEffectDesc')
if areaDescrip ~= 'None' then
txt = txt.." - ''"..areaDescrip.."''"
end
end
table.insert(resultPart, txt)
end
end
end
end
Line 323: Line 331:
local monsterName = frame.args ~= nil and frame.args[1] or frame
local monsterName = frame.args ~= nil and frame.args[1] or frame
local hideDungeons = frame.args ~= nil and frame.args[2] or nil
local hideDungeons = frame.args ~= nil and frame.args[2] or nil
local includeEffects = frame.args ~= nil and frame.args[3] or true
local monster = p.getMonster(monsterName)
local monster = p.getMonster(monsterName)


Line 329: Line 338:
end
end


return p._getMonsterAreas(monster, hideDungeons)
return p._getMonsterAreas(monster, hideDungeons, includeEffects)
end
end