892
edits
mNo edit summary |
mNo edit summary |
||
Line 42: | Line 42: | ||
function p._getMaxHitPerMonsterStyle(dung) | function p._getMaxHitPerMonsterStyle(dung) | ||
local maxHitsPerMonsterStyle = { | local maxHitsPerMonsterStyle = { melee = 0, ranged = 0, magic = 0 } | ||
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) | ||
local styleName = | local styleName = monster.attackType | ||
local maxHit = Monsters._getMonsterMaxHit(monster, true) -- doStuns = true | local maxHit = Monsters._getMonsterMaxHit(monster, true) -- doStuns = true | ||
if maxHit > maxHitsPerMonsterStyle[styleName] then | if maxHit > maxHitsPerMonsterStyle[styleName] then | ||
Line 54: | Line 54: | ||
end | end | ||
function p._getDRRequiredPerPlayerStyle(dung, playerStyle, autoEatTreshold) | function p._getDRRequiredPerPlayerStyle(dung, playerStyle, autoEatTreshold, enemyMaxHitsPerStyle) | ||
for enemyStyle, styleHit in Shared.skpairs( | for enemyStyle, styleHit in Shared.skpairs(enemyMaxHitsPerStyle) do | ||
if styleHit > 0 and styleHit > autoEatTreshold then | if styleHit > 0 and styleHit > autoEatTreshold then | ||
local styleDR = math.ceil((1 - (autoEatTreshold / styleHit)) * 100) | local styleDR = math.ceil((1 - (autoEatTreshold / styleHit)) * 100) | ||
Line 63: | Line 63: | ||
end | end | ||
minDR = math.min(minDR, maxStyleDR) | minDR = math.min(minDR, maxStyleDR) | ||
return minDR | |||
end | end | ||
Line 71: | Line 72: | ||
local MaxVisibleDR = 85 | local MaxVisibleDR = 85 | ||
local autoEatTreshhold = math.floor( | local autoEatTreshhold = math.floor(maxHP * autoEatTresholdPercentage) | ||
local enemyMaxHitsPerStyle = p._getMaxHitPerMonsterStyle(dung) | |||
mw.logObject(enemyMaxHitsPerStyle) | |||
local reductionRequiredPerPlayerStyle = { | local reductionRequiredPerPlayerStyle = { melee = 0, ranged = 0, magic = 0 } | ||
for playerStyle, dr in | |||
reductionRequiredPerPlayerStyle[playerStyle] = p._getDRRequiredPerPlayerStyle(dung, playerStyle, autoEatTreshold) | for playerStyle, dr in ipairs(reductionRequiredPerPlayerStyle) do | ||
reductionRequiredPerPlayerStyle[playerStyle] = p._getDRRequiredPerPlayerStyle(dung, playerStyle, autoEatTreshold, enemyMaxHitsPerStyle) | |||
end | end | ||
return reductionRequiredPerPlayerStyle | |||
end | |||
function p._testing() | |||
local dung = CombatAreas.getArea("Spider Forest") | |||
local maxHp = 1120 | |||
local ae = 0.4 | |||
return p._getDungeonMinDR(dung, maxHp, ae) | |||
end | end | ||
Line 83: | Line 97: | ||
if disableAgilityObstacles ~= nil then | if disableAgilityObstacles ~= nil then | ||
AutoEatVals = {T1 = 0.2, T2 = 0.3, T3 = 0.4} | AutoEatVals = {T1 = 0.2, T2 = 0.3, T3 = 0.4} | ||
end | end | ||
Line 101: | Line 109: | ||
result = result..'\r\n!DR %!!'..StyleHeader | result = result..'\r\n!DR %!!'..StyleHeader | ||
result = result..'\r\n|}' | result = result..'\r\n|}' | ||
Line 118: | Line 120: | ||
end | end | ||
return | return p |
edits