Fixed an issue with melee spells which wasn't showing the amount of misses in the breakdown window

This commit is contained in:
Tercio Jose
2023-05-12 13:19:25 -03:00
parent 3b395f7769
commit 937c963cc8
2 changed files with 48 additions and 2 deletions
+45 -2
View File
@@ -5209,7 +5209,7 @@ end
---@param spellId number
---@param elapsedTime number
---@param actorName string
---@param spellTable spelltable
---@param spellTable spelltableadv
---@param trinketData trinketdata
---@param combatObject combat
function damageClass:BuildSpellDetails(spellBar, spellBlockContainer, blockIndex, summaryBlock, spellId, elapsedTime, actorName, spellTable, trinketData, combatObject)
@@ -5365,7 +5365,50 @@ function damageClass:BuildSpellDetails(spellBar, spellBlockContainer, blockIndex
blockLine3.rightText:SetText(Loc ["STRING_DPS"] .. ": " .. Details:CommaValue(spellTable.c_total / critTempoPercent))
end
--missing hits
local semiDodgeAmount = spellTable.g_amt + spellTable.b_amt --glancing and blocking
local fullDodgeAmount = spellTable["DODGE"] or 0
local parryAmount = spellTable["PARRY"] or 0
local missedHitsAmount = spellTable["MISS"] or 0
local hitErrorsAmount = parryAmount + fullDodgeAmount + missedHitsAmount
if (semiDodgeAmount > 0 or hitErrorsAmount > 0) then
---@type breakdownspellblock
local defensesBlock = spellBlockContainer:GetBlock(blockIndex)
defensesBlock:Show()
blockIndex = blockIndex + 1
local percent = (semiDodgeAmount + hitErrorsAmount) / spellTable.counter * 100
defensesBlock:SetValue(percent)
defensesBlock.sparkTexture:SetPoint("left", defensesBlock, "left", percent / 100 * defensesBlock:GetWidth() + Details.breakdown_spell_tab.blockspell_spark_offset, 0)
local blockLine1, blockLine2, blockLine3 = defensesBlock:GetLines()
blockLine1.leftText:SetText(Loc ["STRING_DEFENSES"])
blockLine1.rightText:SetText((semiDodgeAmount + hitErrorsAmount) .. " / " .. format("%.1f", percent) .. "%")
if (missedHitsAmount > 0) then
blockLine2.leftText:SetText("Miss" .. ": " .. missedHitsAmount)
end
if (parryAmount > 0) then
blockLine2.centerText:SetText(Loc ["STRING_PARRY"] .. ": " .. parryAmount)
end
if (fullDodgeAmount > 0) then
blockLine2.rightText:SetText(Loc ["STRING_DODGE"] .. ": " .. fullDodgeAmount)
end
if (spellTable.b_amt > 0) then
blockLine3.leftText:SetText(Loc ["STRING_BLOCKED"] .. ": " .. spellTable.b_amt)
end
if (spellTable.g_amt > 0) then
blockLine3.rightText:SetText(Loc ["STRING_GLANCING"] .. ": " .. spellTable.g_amt)
end
end
--[=[ percent
Loc ["STRING_GLANCING"] .. ": " .. math.floor(spellTable.g_amt / spellTable.counter * 100) .. "%"
Loc ["STRING_BLOCKED"] .. ": " .. math.floor(spellTable.b_amt / spellTable.counter * 100) .. "%"
--]=]
if (trinketData[spellId]) then
---@type trinketdata
+3
View File
@@ -33,6 +33,9 @@ local spellTable_FieldsToSum = {
["e_heal"] = true,
["e_lvl"] = true,
["e_total"] = true,
["DODGE"] = true,
["PARRY"] = true,
["MISS"] = true,
}
---@class spelltablemixin