Module:CombatAreas: Difference between revisions

getAreaPassives is working
(Add strongholds to areaMap)
(getAreaPassives is working)
Line 176: Line 176:
end
end
return result
return result
end
function p.getAreaPassives(frame)
local areaName = frame.args ~= nil and frame.args[1] or frame
local area = p.getArea(areaName)
if area == nil then
return Shared.printError('No area named "' .. areaName .. '" exists in the data module')
end
-- nonBossPassives
local result = ''
    if type(area.nonBossPassives) == 'table' and not Shared.tableIsEmpty(area.nonBossPassives) then
for i, passiveID in ipairs(area.nonBossPassives) do
local passive = p.getPassiveByID(passiveID)
result = result .. '\r\n* ' .. passive.name .. '\r\n** ' .. Constants.getDescription(passive.customDescription, passive.modifiers)
end
    end
    -- TODO
    -- bossPassives (used on Impending Darkness Event)
-- bossOnlyPassives (strongholds)
-- tiers -> [name] -> passives -> (list)
if result ~= '' then
result = '===Passives===' .. result
end
return result
end
function p.getPassiveByID(ID)
    return GameData.getEntityByID('combatPassives', ID)
end
end


return p
return p
239

edits