Anonymous

Module:Mazunki/Dungeons: Difference between revisions

From Melvor Idle
m
no edit summary
mNo edit summary
mNo edit summary
Line 49: Line 49:
for i, monsterID in Shared.skpairs(dung.monsters) do
for i, monsterID in Shared.skpairs(dung.monsters) do
local monster = Monsters.getMonsterByID(monsterID)
local monster = Monsters.getMonsterByID(monsterID)
if monster == nil and monsterID == -1 then -- affliction doesn't deal any damage
if monster == nil and monsterID == -1 then
return maxHitsPerMonsterStyle
for _, id in Shared.skpairs(afflicted) do
end
local monster = Monsters.getMonsterByID(id)
local styleName = Constants.getCombatStyleName(monster.attackType)
local styleName = Constants.getCombatStyleName(monster.attackType)
local maxHit = Monsters._getMonsterMaxHit(monster, true) -- doStuns = true
local maxHit = Monsters._getMonsterMaxHit(monster, true) -- doStuns = true
if styleName == "Random" then
if styleName == "Random" then
for randomStyle, value in Shared.skpairs(maxHitsPerMonsterStyle) do
for randomStyle, value in Shared.skpairs(maxHitsPerMonsterStyle) do
if maxHit > value then
if maxHit > value then
maxHitsPerMonsterStyle[randomStyle] = maxHit
maxHitsPerMonsterStyle[randomStyle] = maxHit
end
end
else
if maxHit > maxHitsPerMonsterStyle[styleName] then
maxHitsPerMonsterStyle[styleName] = maxHit
end
end
end
end
end
else
else
if maxHit > maxHitsPerMonsterStyle[styleName] then
local styleName = Constants.getCombatStyleName(monster.attackType)
maxHitsPerMonsterStyle[styleName] = maxHit
local maxHit = Monsters._getMonsterMaxHit(monster, true) -- doStuns = true
if styleName == "Random" then
for randomStyle, value in Shared.skpairs(maxHitsPerMonsterStyle) do
if maxHit > value then
maxHitsPerMonsterStyle[randomStyle] = maxHit
end
end
else
if maxHit > maxHitsPerMonsterStyle[styleName] then
maxHitsPerMonsterStyle[styleName] = maxHit
end
end
end
end
end
Line 133: Line 148:


return result
return result
end
function p._getStrongestAfflicted()
local highestMaxHit = 0
local afflicted = Monsters._getAfflictedMonsterIdList()
for _, id in Shared.skpairs(afflicted) do
local monster = Monsters.getMonsterByID(id)
totalHp = totalHp + Monsters._getMonsterHP(monster)
end
return math.ceil(totalHp / #(afflicted))
end
end


892

edits