Module:Mazunki/Dungeons: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 1: Line 1:
 
local pm = require("Module:CombatAreas/AreaTables")
 
local p = {}
local p = require("Module:CombatAreas/AreaTables")
local pm = {}


local AreaData = mw.loadData('Module:CombatAreas/data')
local AreaData = mw.loadData('Module:CombatAreas/data')
Line 13: Line 11:
local Pets = require('Module:Pets')
local Pets = require('Module:Pets')


 
function p.getDungeonTable(frame)
function pm.getDungeonTable(frame)
local result = '{| class="wikitable sortable stickyHeader"'
local result = '{| class="wikitable sortable stickyHeader"'
result = result..'\r\n|-class="headerRow-0"'
result = result..'\r\n|-class="headerRow-0"'
Line 28: Line 25:
local boss = Monsters.getMonsterByID(dung.monsters[Shared.tableCount(dung.monsters)])
local boss = Monsters.getMonsterByID(dung.monsters[Shared.tableCount(dung.monsters)])
result = result..'||'..Monsters._getMonsterCombatLevel(boss)
result = result..'||'..Monsters._getMonsterCombatLevel(boss)
result = result..'||'..pm.getDungeonTotalHP(dung)
result = result..'||'..p.getDungeonTotalHP(dung)
result = result..'||'..pm.getDungeonMinDR(dung)
result = result..'||'..p.getDungeonMinDR(dung)


result = result..'||'..p._getDungeonRewards(dung, false)
result = result..'||'..pm._getDungeonRewards(dung, false)
if dung.petID ~= nil then
if dung.petID ~= nil then
local pet = Pets.getPetByID(dung.petID)
local pet = Pets.getPetByID(dung.petID)
Line 44: Line 41:
end
end


function pm.getDungeonTotalHP(frame)
function p._getMaxHitPerMonsterStyle(dung)
return "N/A"
local maxHitsPerMonsterStyle = { Melee = 0, Ranged = 0, Magic = 0 }
for i, monsterID in Shared.skpairs(dung.monsters) do
local monster = Monsters.getMonsterByID(monsterID)
local styleName = Constants.getCombatStyleName(monster.attackType)
local maxHit = Monsters._getMonsterMaxHit(monster, true) -- doStuns = true
if maxHit > maxHitsPerMonsterStyle[styleName] then
maxHitsPerMonsterStyle[styleName] = maxHit
end
end
return maxHitsPerStyle
end
 
function p._getDRRequiredPerPlayerStyle(dung, playerStyle, autoEatTreshold)
for enemyStyle, styleHit in Shared.skpairs(MaxHits) do
if styleHit > 0 and styleHit > autoEatTreshold then
local styleDR = math.ceil((1 - (autoEatTreshold / styleHit)) * 100)
styleDR = math.ceil(styleDR / Constants.getTriangleDRModifier(playerStyle, enemyStyle, mode))
maxStyleDR = math.max(maxStyleDR, styleDR)
end
end
minDR = math.min(minDR, maxStyleDR)
end
end


function p._getDungeonMinDR(dung, maxHP, autoEatTresholdPercentage)
--This is the highest DR to list as possible. Value might be slightly off right now, currently just setting up value for testing
local MaxViableDR = 81
--This is the highest DR row shown. This should be higher than MaxViableDR
local MaxVisibleDR = 85
local autoEatTreshhold = math.floor(maxHp * autoEatTresholdPercentage)
local reductionRequiredPerPlayerStyle = { Melee = 0, Ranged = 0, Magic = 0 }
for playerStyle, dr in Shared.skpairs(reductionRequiredPerPlayerStyle) do
reductionRequiredPerPlayerStyle[playerStyle] = p._getDRRequiredPerPlayerStyle(dung, playerStyle, autoEatTreshold)
end
end
function p._getDungeonDrTable(dung, gamemode, maxHP, autoEatTreshold)
local AutoEatVals = {T1 = 0.2, T2 = 0.3, T3 = 0.4, T3W = 0.45}
if disableAgilityObstacles ~= nil then
AutoEatVals = {T1 = 0.2, T2 = 0.3, T3 = 0.4}
end
if doStuns == nil then
doStuns = true
elseif type(doStuns) == 'string' then
doStuns = string.upper(doStuns) == 'TRUE'
end
--Finally, build the table using those starting points
local StyleHeader = "Melee!!Ranged!!Magic"
StyleHeader = StyleHeader..'!!'..StyleHeader..'!!'..StyleHeader..'!!'..StyleHeader
local result = '{| class="wikitable stickyHeader"'
result = result..'\r\n|-class="headerRow-0"'
result = result..'\r\n!Pre-Triangle DR!!colspan=3|AE T3 + Wasteful!!colspan=3|Auto Eat Tier 3!!colspan=3|Auto Eat Tier 2!!colspan=3|Auto Eat Tier 1'
result = result..'\r\n|-class="headerRow-0"'
result = result..'\r\n!DR %!!'..StyleHeader
local getHpForStyle = function(playerStyle, autoEat, playerDR)
return nil
end
for dr = minDR, MaxVisibleDR, 1 do
end
result = result..'\r\n|}'
return result
end


function pm.getDungeonMinDR(frame)
function p._getDungeonTotalHP(dung)
return "N/A"
return
end
end


return pm
return pm
892

edits