Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Added damage type to area monster box
(Fix lua errors caused by gameData update)
(Added damage type to area monster box)
Line 1,368: Line 1,368:
local tableBits = {}
local tableBits = {}
table.insert(tableBits, '{| class="wikitable sortable"')
table.insert(tableBits, '{| class="wikitable sortable"')
table.insert(tableBits, '\r\n! Name !! Combat Level ')
table.insert(tableBits, '\r\n! Name !! Combat Lvl ')
if hasBarrier then
if hasBarrier then
table.insert(tableBits, '!! [[Barrier]] ')
table.insert(tableBits, '!! [[Barrier]] ')
end
end
table.insert(tableBits, '!! Hitpoints !! colspan=2| Max Hit !! [[Combat Triangle|Combat Style]]')
table.insert(tableBits, '!! [[HP]] !! colspan=2| Max Hit !! [[Combat Triangle|Combat Style]] !! [[Combat#Damage_Types|Dmg]]')
for i, monster in ipairs(monsters) do
for i, monster in ipairs(monsters) do
local rowBits = {}
local rowBits = {}
Line 1,390: Line 1,390:
end
end
table.insert(tableBits, '||'..p._getMonsterStyleIcon({monster, nolink=true}))
table.insert(tableBits, '||'..p._getMonsterStyleIcon({monster, nolink=true}))
table.insert(tableBits, '||style="text-align:center"|'..Icons.Icon({p._getMonsterDamageType(monster), type='damage', notext=true}))
end
end
table.insert(tableBits, '\r\n|}')
table.insert(tableBits, '\r\n|}')
Line 1,473: Line 1,473:
monMaxHit = p._getMonsterMaxHit(monster)
monMaxHit = p._getMonsterMaxHit(monster)
monStyle = p._getMonsterStyleIcon({monster})
monStyle = p._getMonsterStyleIcon({monster})
monDmgTypeIcon = Icons.Icon({p._getMonsterDamageType(monster), type='damage', notext=true})
monCount = monsterCount
monCount = monsterCount
end
end
Line 1,514: Line 1,515:
end
end
table.insert(resultPart, '\r\n| ' .. monStyle)
table.insert(resultPart, '\r\n| ' .. monStyle)
table.insert(resultPart, '\r\n|style="text-align:center"|'..monDmgTypeIcon)
table.insert(resultPart, '\r\n|style="text-align:right;" data-sort-value="' .. getValSort(monCount) .. '"| ' .. getValText(monCount))
table.insert(resultPart, '\r\n|style="text-align:right;" data-sort-value="' .. getValSort(monCount) .. '"| ' .. getValText(monCount))
return table.concat(resultPart)
return table.concat(resultPart)
Line 1,520: Line 1,522:
local returnPart = {}
local returnPart = {}
table.insert(returnPart, '{| class="wikitable sortable"')
table.insert(returnPart, '{| class="wikitable sortable"')
table.insert(returnPart, '\r\n! Name !! Combat Level ')
table.insert(returnPart, '\r\n! Name !! Combat Lvl ')
if hasBarrier then
if hasBarrier then
table.insert(returnPart, '!! [[Barrier]] ')
table.insert(returnPart, '!! [[Barrier]] ')
end
end
table.insert(returnPart, '!! Hitpoints !! colspan="2" | Max Hit !! [[Combat Triangle|Combat Style]] !! Count')
table.insert(returnPart, '!! [[HP]] !! colspan="2" | Max Hit !! [[Combat Triangle|Combat Style]] !! [[Combat#Damage_Types|Dmg]] !! Count')
-- Special handing for Impending Darkness event
-- Special handing for Impending Darkness event
-- TODO needs to be revised once there is a better understanding of how the event works
-- TODO needs to be revised once there is a better understanding of how the event works