Module:Mazunki/Dungeons: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 27: Line 27:
result = result..'||'..p._getDungeonTotalHP(dung, true) -- accountForEnemyDR = true
result = result..'||'..p._getDungeonTotalHP(dung, true) -- accountForEnemyDR = true
local minDR = {Melee=0, Ranged=0, Magic=0} -- p._getDungeonMinDR(dung, 1000, 0.4)
local minDR = p._getDungeonMinDR(dung, 1000, 0.4)
result = result..'||'..minDR["Melee"].."%"
--result = result..'||'..minDR["Melee"].."%"
result = result..'||'..minDR["Ranged"].."%"
--result = result..'||'..minDR["Ranged"].."%"
result = result..'||'..minDR["Magic"].."%"
--result = result..'||'..minDR["Magic"].."%"


result = result..'||'..pm._getDungeonRewards(dung, false)
result = result..'||'..pm._getDungeonRewards(dung, false)
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
return maxHitsPerMonsterStyle
end
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 maxHit > maxHitsPerMonsterStyle[styleName] then
maxHitsPerMonsterStyle[styleName] = maxHit
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 114: Line 127:


for tier, aevalue in Shared.skpairs(AutoEatValues) do
for tier, aevalue in Shared.skpairs(AutoEatValues) do
mw.log(aevalue)
--mw.log(aevalue)
end
end


Line 125: Line 138:
local calculateDr = accountForEnemyDR or false
local calculateDr = accountForEnemyDR or false
totalHp = 0
totalHp = 0
mw.log(dung.monsters)
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)
Line 140: Line 152:
local monsterPostReductionHP = math.floor(monsterHp / (1-dr))
local monsterPostReductionHP = math.floor(monsterHp / (1-dr))
totalHp = totalHp + monsterPostReductionHP
totalHp = totalHp + monsterPostReductionHP
mw.log(monsterPostReductionHP, totalHp)
end
end
return totalHp
return totalHp
892

edits