This commit is contained in:
Crum
2019-01-12 02:18:46 -06:00
parent 79a61c59a8
commit eebdf23364
14 changed files with 417 additions and 251 deletions
+4 -4
View File
@@ -15,7 +15,7 @@ local chanceString = "%.2f%%"
local displayString = ""
local _, effectiveArmor
local function GetArmorReduction(armor, attackerLevel)
local function PaperDollFrame_GetArmorReduction(armor, attackerLevel)
local levelModifier = attackerLevel
if levelModifier > 59 then
levelModifier = levelModifier + (4.5 * (levelModifier - 59))
@@ -44,14 +44,14 @@ local function OnEnter(self)
local playerLevel = UnitLevel("player") + 3
for i = 1, 4 do
local armorReduction = GetArmorReduction(effectiveArmor, playerLevel)
local armorReduction = PaperDollFrame_GetArmorReduction(effectiveArmor, playerLevel)
DT.tooltip:AddDoubleLine(playerLevel, format(chanceString, armorReduction), 1, 1, 1)
playerLevel = playerLevel - 1
end
local targetLevel = UnitLevel("target")
if targetLevel and targetLevel > 0 and (targetLevel > playerLevel + 3 or targetLevel < playerLevel) then
local armorReduction = GetArmorReduction(effectiveArmor, targetLevel)
local armorReduction = PaperDollFrame_GetArmorReduction(effectiveArmor, targetLevel)
DT.tooltip:AddDoubleLine(targetLevel, format(chanceString, armorReduction), 1, 1, 1)
end
@@ -67,4 +67,4 @@ local function ValueColorUpdate(hex)
end
E.valueColorUpdateFuncs[ValueColorUpdate] = true
DT:RegisterDatatext("Armor", {"UNIT_RESISTANCES"}, OnEvent, nil, nil, OnEnter, nil, ARMOR)
DT:RegisterDatatext("Armor", {"UNIT_RESISTANCES"}, OnEvent, nil, nil, OnEnter, nil, ARMOR)