892
edits
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 | if monster == nil and monsterID == -1 then | ||
for _, id in Shared.skpairs(afflicted) do | |||
local monster = Monsters.getMonsterByID(id) | |||
local styleName = Constants.getCombatStyleName(monster.attackType) | |||
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[ | 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) | ||
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 | ||
edits