Anonymous

Module:CombatAreas: Difference between revisions

From Melvor Idle
getAreaPassives now works for dungeons and strongholds
(getAreaPassives is working)
(getAreaPassives now works for dungeons and strongholds)
 
Line 185: Line 185:
end
end


-- nonBossPassives
local bossPassives = nil
local nonBossPassives = nil
if area.eventID ~= nil and area.eventID ~= '' then -- currently just Impending Darkness Event
local event = GameData.getEntityByID('combatEvents', area.eventID)
bossPassives = event.bossPassives
-- nonBossPassives = event.enemyPassives -- melvorF:ControlledAffliction is missing from GameData
else
bossPassives = area.bossOnlyPassives -- Strongholds only
nonBossPassives = area.nonBossPassives -- Dungeons only
end
 
local result = ''
local result = ''
     if type(area.nonBossPassives) == 'table' and not Shared.tableIsEmpty(area.nonBossPassives) then
 
for i, passiveID in ipairs(area.nonBossPassives) do
     if type(nonBossPassives) == 'table' and not Shared.tableIsEmpty(nonBossPassives) then
    result = result .. '\r\n===Non-Boss Monster Passives==='
for i, passiveID in ipairs(nonBossPassives) do
local passive = p.getPassiveByID(passiveID)
local passive = p.getPassiveByID(passiveID)
result = result .. '\r\n* ' .. passive.name .. '\r\n** ' .. Constants.getDescription(passive.customDescription, passive.modifiers)
result = result .. '\r\n* ' .. passive.name .. '\r\n** ' .. Constants.getDescription(passive.customDescription, passive.modifiers)
Line 194: Line 206:
     end
     end


     -- TODO
     if type(bossPassives) == 'table' and not Shared.tableIsEmpty(bossPassives) then
    -- bossPassives (used on Impending Darkness Event)
    result = result .. '\r\n===Boss Monster Passives==='
-- bossOnlyPassives (strongholds)
for i, passiveID in ipairs(bossPassives) do
-- tiers -> [name] -> passives -> (list)
local passive = p.getPassiveByID(passiveID)
result = result .. '\r\n* ' .. passive.name .. '\r\n** ' .. Constants.getDescription(passive.customDescription, passive.modifiers)
end
    end


if result ~= '' then
if type(area.tiers) == 'table' and not Shared.tableIsEmpty(area.tiers) then
result = '===Passives===' .. result
result = result .. '\r\n===Stronghold Tier Passives==='
for tierName, tierData in pairs(area.tiers) do
result = result .. '\r\n* ' .. tierName .. ' Tier'
for i, passiveID in ipairs(tierData.passives) do
local passive = p.getPassiveByID(passiveID)
result = result .. '\r\n** ' .. passive.name .. '\r\n*** ' .. Constants.getDescription(passive.customDescription, passive.modifiers)
end
end
end
end
return result
return result
end
end
239

edits