Module:Monsters: Difference between revisions

Revise monster area table format for compactness
(Added damage type to area monster box)
(Revise monster area table format for compactness)
Line 1,372: Line 1,372:
table.insert(tableBits, '!! [[Barrier]] ')
table.insert(tableBits, '!! [[Barrier]] ')
end
end
table.insert(tableBits, '!! [[HP]] !! colspan=2| Max Hit !! [[Combat Triangle|Combat Style]] !! [[Combat#Damage_Types|Dmg]]')
table.insert(tableBits, '!! [[HP]] !! colspan="3"| Max Hit !! [[Combat Triangle|Style]]')
for i, monster in ipairs(monsters) do
for i, monster in ipairs(monsters) do
local rowBits = {}
local rowBits = {}
table.insert(tableBits, '\r\n|-\r\n|'..Icons.Icon({p.getMonsterName(monster), type='monster'}))
table.insert(tableBits, '\r\n|-\r\n|'..Icons.Icon({p.getMonsterName(monster), type='monster'}))
table.insert(tableBits, '||'..p._getMonsterCombatLevel(monster))
table.insert(tableBits, '||style="text-align:right"|'..p._getMonsterCombatLevel(monster))
if hasBarrier then
if hasBarrier then
table.insert(tableBits, '||'..Num.formatnum(p._getMonsterBarrier(monster)))
table.insert(tableBits, '||style="text-align:right"|'..Num.formatnum(p._getMonsterBarrier(monster)))
end
end
table.insert(tableBits, '||'..Num.formatnum(p._getMonsterHP(monster)))
table.insert(tableBits, '||style="text-align:right"|'..Num.formatnum(p._getMonsterHP(monster)))
local drReduction = p._getMonsterDrReduction(monster)
local drReduction = p._getMonsterDrReduction(monster)
local maxHit = p._getMonsterMaxHit(monster)
local maxHit = p._getMonsterMaxHit(monster)
local dmgType = Icons.Icon({p._getMonsterDamageType(monster), type='damage', notext=true})
if drReduction > 0 then
if drReduction > 0 then
table.insert(tableBits, '||style="text-align:right" data-sort-value="'..maxHit..'"| -'..drReduction..'% DR')
table.insert(tableBits, '||style="text-align:right" data-sort-value="'..maxHit..'"| -'..drReduction..'% DR')
table.insert(tableBits, '||style="text-align:right"|'..Num.formatnum(maxHit))
table.insert(tableBits, '||class="table-img" style="border-right:hidden"|' .. dmgType)
table.insert(tableBits, '||style="text-align:right"|' .. Num.formatnum(maxHit))
else
else
table.insert(tableBits, '||style="text-align:right" colspan="2" data-sort-value="'..maxHit..'"|'..Num.formatnum(maxHit))
table.insert(tableBits, '||class="table-img" style="border-right:hidden" data-sort-value="'..maxHit..'|' .. dmgType)
table.insert(tableBits, '||style="text-align:right" colspan="2""|' .. Num.formatnum(maxHit))
end
end
table.insert(tableBits, '||'..p._getMonsterStyleIcon({monster, nolink=true}))
table.insert(tableBits, '||class="table-img" |'..p._getMonsterStyleIcon({monster, notext=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,472: Line 1,474:
monDrReduce = p._getMonsterDrReduction(monster)
monDrReduce = p._getMonsterDrReduction(monster)
monMaxHit = p._getMonsterMaxHit(monster)
monMaxHit = p._getMonsterMaxHit(monster)
monStyle = p._getMonsterStyleIcon({monster})
monStyle = p._getMonsterStyleIcon({monster, notext=true})
monDmgTypeIcon = Icons.Icon({p._getMonsterDamageType(monster), type='damage', notext=true})
monDmgTypeIcon = Icons.Icon({p._getMonsterDamageType(monster), type='damage', notext=true})
monCount = monsterCount
monCount = monsterCount
Line 1,510: Line 1,512:
if type(monDrReduce) == 'number' and monDrReduce > 0 then
if type(monDrReduce) == 'number' and monDrReduce > 0 then
table.insert(resultPart, '\r\n|style="text-align:right" data-sort-value="'..getValSort(monMaxHit)..'"| -'..monDrReduce..'% DR')
table.insert(resultPart, '\r\n|style="text-align:right" data-sort-value="'..getValSort(monMaxHit)..'"| -'..monDrReduce..'% DR')
table.insert(resultPart, '\r\n|style="text-align:right"|'..getValText(monMaxHit))
table.insert(resultPart, '\r\n|class="table-img" style="border-right:hidden"| ' .. monDmgTypeIcon)
table.insert(resultPart, '\r\n|style="text-align:right"|' .. getValText(monMaxHit))
else
else
table.insert(resultPart, '\r\n|style="text-align:right" colspan="2" data-sort-value="'..getValSort(monMaxHit)..'"|'..getValText(monMaxHit))
table.insert(resultPart, '\r\n|class="table-img" style="border-right:hidden" data-sort-value="'..getValSort(monMaxHit)..'"| ' .. monDmgTypeIcon)
table.insert(resultPart, '\r\n|style="text-align:right" colspan="2" |' .. getValText(monMaxHit))
end
end
table.insert(resultPart, '\r\n| ' .. monStyle)
table.insert(resultPart, '\r\n|class="table-img"| ' .. 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,526: Line 1,529:
table.insert(returnPart, '!! [[Barrier]] ')
table.insert(returnPart, '!! [[Barrier]] ')
end
end
table.insert(returnPart, '!! [[HP]] !! colspan="2" | Max Hit !! [[Combat Triangle|Combat Style]] !! [[Combat#Damage_Types|Dmg]] !! Count')
table.insert(returnPart, '!! [[HP]] !! colspan="3" | Max Hit !! [[Combat Triangle|Style]] !! 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