Skip to content

Commit

Permalink
Remove TankPoints
Browse files Browse the repository at this point in the history
  • Loading branch information
raethkcj committed Aug 21, 2023
1 parent 3aa7487 commit dc8cf71
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 274 deletions.
229 changes: 3 additions & 226 deletions RatingBuster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1101,31 +1101,6 @@ local options = {
},
}

-- TankPoints support, version check
local tpSupport
local tpLocale
if TankPoints and (tonumber(strsub(TankPoints.version, 1, 3)) >= 2.6) then
tpSupport = true
tpLocale = LibStub("AceLocale-3.0"):GetLocale("TankPoints", true)
options.args.sum.args.tank.args.sumTankPoints = {
type = 'toggle',
name = L["Sum TankPoints"],
desc = L["TankPoints <- Health, Total Reduction"],
}
options.args.sum.args.tank.args.sumTotalReduction = {
type = 'toggle',
name = L["Sum Total Reduction"],
desc = L["Total Reduction <- Armor, Dodge, Parry, Block, Block Value, Defense, Resilience, MobMiss, MobCrit, MobCrush, DamageTakenMods"],
}
--[[
options.args.sum.args.tank.args.sumAvoidance = {
type = 'toggle',
name = L["Sum Avoidance"],
desc = L["Avoidance <- Dodge, Parry, MobMiss"],
}
--]]
end

---------------------
-- Saved Variables --
---------------------
Expand Down Expand Up @@ -1266,8 +1241,6 @@ local defaults = {
sumShadowResist = false,
sumResilience = true, -- new
sumDefense = false,
sumTankPoints = false,
sumTotalReduction = false,
sumAvoidance = false,
-- Gems
sumGemRed = {
Expand Down Expand Up @@ -3407,160 +3380,6 @@ local summaryCalcData = {
end,
},
}
if tpSupport == true then
-- TankPoints
tinsert(summaryCalcData, {
option = "sumTankPoints",
name = "TANKPOINTS",
func = function(diffTable1)
-- Item type
local itemType = diffTable1.itemType
-- Calculate current TankPoints
local tpSource = {}
local TP = TankPoints
local TPTips = TankPointsTooltips
TP:GetSourceData(tpSource, TP_MELEE)
local tpResults = {}
copyTable(tpResults, tpSource)
TP:GetTankPoints(tpResults, TP_MELEE)
-- Update if different
if floor(TP.resultsTable.tankPoints[TP_MELEE]) ~= floor(tpResults.tankPoints[TP_MELEE]) then
copyTable(TP.sourceTable, tpSource)
copyTable(TP.resultsTable, tpResults)
end
----------------------------------------------------
-- Calculate TP difference with 1st equipped item --
----------------------------------------------------
local tpTable = {}
-- Set the forceShield arg
local forceShield
-- if not equipped shield and item is shield then force on
-- if not equipped shield and item is not shield then nil
-- if equipped shield and item is shield then nil
-- if equipped shield and item is not shield then force off
if ((diffTable1.diffItemType1 ~= "INVTYPE_SHIELD") and (diffTable1.diffItemType2 ~= "INVTYPE_SHIELD")) and (itemType == "INVTYPE_SHIELD") then
forceShield = true
elseif ((diffTable1.diffItemType1 == "INVTYPE_SHIELD") or (diffTable1.diffItemType2 == "INVTYPE_SHIELD")) and (itemType ~= "INVTYPE_SHIELD") then
forceShield = false
end
-- Get the tp table
TP:GetSourceData(tpTable, TP_MELEE, forceShield)
-- Build changes table
local changes = TPTips:BuildChanges({}, diffTable1)
-- Alter tp table
TP:AlterSourceData(tpTable, changes, forceShield)
-- Calculate TankPoints from tpTable
TP:GetTankPoints(tpTable, TP_MELEE, forceShield)
-- Calculate tp difference
local diff = floor(tpTable.tankPoints[TP_MELEE]) - floor(TP.resultsTable.tankPoints[TP_MELEE])

return diff
end,
})
-- Total Reduction
tinsert(summaryCalcData, {
option = "sumTotalReduction",
name = "TOTALREDUCTION",
ispercent = true,
func = function(diffTable1)
-- Item type
local itemType = diffTable1.itemType
-- Calculate current TankPoints
local tpSource = {}
local TP = TankPoints
local TPTips = TankPointsTooltips
TP:GetSourceData(tpSource, TP_MELEE)
local tpResults = {}
copyTable(tpResults, tpSource)
TP:GetTankPoints(tpResults, TP_MELEE)
-- Update if different
if floor(TP.resultsTable.tankPoints[TP_MELEE]) ~= floor(tpResults.tankPoints[TP_MELEE]) then
copyTable(TP.sourceTable, tpSource)
copyTable(TP.resultsTable, tpResults)
end
----------------------------------------------------
-- Calculate TP difference with 1st equipped item --
----------------------------------------------------
local tpTable = {}
-- Set the forceShield arg
local forceShield
-- if not equipped shield and item is shield then force on
-- if not equipped shield and item is not shield then nil
-- if equipped shield and item is shield then nil
-- if equipped shield and item is not shield then force off
if ((diffTable1.diffItemType1 ~= "INVTYPE_SHIELD") and (diffTable1.diffItemType2 ~= "INVTYPE_SHIELD")) and (itemType == "INVTYPE_SHIELD") then
forceShield = true
elseif ((diffTable1.diffItemType1 == "INVTYPE_SHIELD") or (diffTable1.diffItemType2 == "INVTYPE_SHIELD")) and (itemType ~= "INVTYPE_SHIELD") then
forceShield = false
end
-- Get the tp table
TP:GetSourceData(tpTable, TP_MELEE, forceShield)
-- Build changes table
local changes = TPTips:BuildChanges({}, diffTable1)
-- Alter tp table
TP:AlterSourceData(tpTable, changes, forceShield)
-- Calculate TankPoints from tpTable
TP:GetTankPoints(tpTable, TP_MELEE, forceShield)
-- Calculate tp difference
local diff = tpTable.totalReduction[TP_MELEE] - TP.resultsTable.totalReduction[TP_MELEE]

return diff * 100
end,
})
--[[
-- Avoidance
tinsert(summaryCalcData, {
option = "sumAvoidance",
name = "AVOIDANCE",
ispercent = true,
func = function(diffTable1)
-- Item type
local itemType = diffTable1.itemType
local right
-- Calculate current TankPoints
local tpSource = {}
local TP = TankPoints
local TPTips = TankPointsTooltips
TP:GetSourceData(tpSource, TP_MELEE)
local tpResults = {}
copyTable(tpResults, tpSource)
TP:GetTankPoints(tpResults, TP_MELEE)
-- Update if different
if floor(TP.resultsTable.tankPoints[TP_MELEE]) ~= floor(tpResults.tankPoints[TP_MELEE]) then
copyTable(TP.sourceTable, tpSource)
copyTable(TP.resultsTable, tpResults)
end
----------------------------------------------------
-- Calculate TP difference with 1st equipped item --
----------------------------------------------------
local tpTable = {}
-- Set the forceShield arg
local forceShield
-- if not equipped shield and item is shield then force on
-- if not equipped shield and item is not shield then nil
-- if equipped shield and item is shield then nil
-- if equipped shield and item is not shield then force off
if ((diffTable1.diffItemType1 ~= "INVTYPE_SHIELD") and (diffTable1.diffItemType2 ~= "INVTYPE_SHIELD")) and (itemType == "INVTYPE_SHIELD") then
forceShield = true
elseif ((diffTable1.diffItemType1 == "INVTYPE_SHIELD") or (diffTable1.diffItemType2 == "INVTYPE_SHIELD")) and (itemType ~= "INVTYPE_SHIELD") then
forceShield = false
end
-- Get the tp table
TP:GetSourceData(tpTable, TP_MELEE, forceShield)
-- Build changes table
local changes = TPTips:BuildChanges({}, diffTable1)
-- Alter tp table
TP:AlterSourceData(tpTable, changes, forceShield)
-- Calculate TankPoints from tpTable
TP:GetTankPoints(tpTable, TP_MELEE, forceShield)
-- Calculate tp difference
local diff = tpTable.mobMissChance + tpTable.dodgeChance + tpTable.parryChance - TP.resultsTable.mobMissChance - TP.resultsTable.dodgeChance - TP.resultsTable.parryChance
return diff * 100
end,
})
--]]
end

-- Build summaryFunc
for _, calcData in pairs(summaryCalcData) do
Expand Down Expand Up @@ -3732,31 +3551,7 @@ function RatingBuster:StatSummary(tooltip, name, link)
v[StatLogic.Stats.Spirit] = v[StatLogic.Stats.Spirit] * GSM("MOD_SPI")
end
end
-- Summary Table
--[[
local statData = {
sum = {},
diff1 = {},
diff2 = {},
}
if profileDB.sumHP then
local d = {name = "HEALTH"}
for k, sum in pairs(data) do
d[k] = (sum["HEALTH"] + (sum[StatLogic.Stats.Stamina] * 10)) * GSM("MOD_HEALTH")
end
tinsert(summary, d)
end
local summaryCalcData = {
-- Health - HEALTH, STA
sumHP = {
name = "HEALTH",
func = function(sum)
return (sum["HEALTH"] + (sum[StatLogic.Stats.Stamina] * 10)) * GSM("MOD_HEALTH")
end,
ispercent = false,
},
}
--]]

local summary = {}
for _, calcData in pairs(summaryCalcData) do
if profileDB[calcData.option] then
Expand All @@ -3765,11 +3560,7 @@ function RatingBuster:StatSummary(tooltip, name, link)
ispercent = calcData.ispercent,
}
for statDataType, statTable in pairs(statData) do
if tpSupport and ((calcData.name == "TANKPOINTS") or (calcData.name == "TOTALREDUCTION")) and (statDataType == "sum") then
entry[statDataType] = nil
else
entry[statDataType] = calcData.func(statTable, statDataType, link)
end
entry[statDataType] = calcData.func(statTable, statDataType, link)
end
tinsert(summary, entry)
end
Expand Down Expand Up @@ -3885,21 +3676,7 @@ function RatingBuster:StatSummary(tooltip, name, link)
end
end
if right then
if n == "TANKPOINTS" then
if tpSupport then
left = tpLocale["TankPoints"]
else
left = "TankPoints"
end
elseif n == "TOTALREDUCTION" then
if tpSupport then
left = tpLocale["Total Reduction"]
else
left = "Total Reduction"
end
else
left = StatLogic:GetStatNameFromID(n)
end
left = StatLogic:GetStatNameFromID(n)
tinsert(output, {left, right})
end
end
Expand Down
6 changes: 0 additions & 6 deletions locales/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,6 @@ L["Weapon Skill <- Weapon Skill Rating"] = "Waffenfertigkeit <- Waffenfertigkeit
-- /rb sum statcomp exp -- 2.3.0
L["Sum Expertise"] = "Waffenkunde zusammenrechnen"
L["Expertise <- Expertise Rating"] = "Waffenkunde <- Waffenkundewertung"
-- /rb sum statcomp tp
L["Sum TankPoints"] = "TankPoints zusammenrechnen"
L["TankPoints <- Health Total Reduction"] = "TankPoints <- Leben, Gesamtreduzierung"
-- /rb sum statcomp tr
L["Sum Total Reduction"] = "Gesamtreduzierung zusammenrechnen"
L["Total Reduction <- Armor Dodge, Parry, Block, Block Value, Defense, Resilience, MobMiss, MobCrit, MobCrush, DamageTakenMods"] = "Gesamtreduzierung <- Rüstung, Ausweichen, Parieren, Block, Blockwert, Verteidigung, Abhärtung, MobMiss, MobCrit, MobCrush, DamageTakenMods"
-- /rb sum statcomp avoid
L["Sum Avoidance"] = "Vermeidung zusammenrechnen"
L["Avoidance <- Dodge Parry, MobMiss, Block(Optional)"] = "Vermeidung <- Ausweichen, Parieren, MobMiss, Block(Optional)"
Expand Down
6 changes: 0 additions & 6 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,6 @@ L["Weapon Skill <- Weapon Skill Rating"] = true
-- /rb sum statcomp exp -- 2.3.0
L["Sum Expertise"] = true
L["Expertise <- Expertise Rating"] = true
-- /rb sum statcomp tp
L["Sum TankPoints"] = true
L["TankPoints <- Health, Total Reduction"] = true
-- /rb sum statcomp tr
L["Sum Total Reduction"] = true
L["Total Reduction <- Armor, Dodge, Parry, Block, Block Value, Defense, Resilience, MobMiss, MobCrit, MobCrush, DamageTakenMods"] = true
-- /rb sum statcomp avoid
L["Sum Avoidance"] = true
L["Avoidance <- Dodge, Parry, MobMiss, Block(Optional)"] = true
Expand Down
6 changes: 0 additions & 6 deletions locales/esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,6 @@ L["Weapon Skill <- Weapon Skill Rating"] = "Habilidad Arma <- Índice Habilidad
-- /rb sum statcomp exp -- 2.3.0
L["Sum Expertise"] = "Res. Pericia"
L["Expertise <- Expertise Rating"] = "Pericia <- Índice Pericia"
-- /rb sum statcomp tp
L["Sum TankPoints"] = "Res. Ptos. Tanque"
L["TankPoints <- Health Total Reduction"] = "Ptos. Tanque <- Salud, Total Reduccion"
-- /rb sum statcomp tr
L["Sum Total Reduction"] = "Res. Total Reduccion"
L["Total Reduction <- Armor Dodge, Parry, Block, Block Value, Defense, Resilience, MobMiss, MobCrit, MobCrush, DamageTakenMods"] = "Total Reduccion <- Armadura, Esquivar, Parar, Bloquear, Valor bloqueo, Defensa, Temple, FalloEnemigo, CriticoEnemigo, AplastamientoEnemigo, Modifics.DañoRecibido"
-- /rb sum statcomp avoid
L["Sum Avoidance"] = "Res. Elusion"
L["Avoidance <- Dodge Parry, MobMiss, Block(Optional)"] = "Elusion <- Esquivar, Parar, FalloEnemigo, Bloqueo(Opcional)"
Expand Down
6 changes: 0 additions & 6 deletions locales/frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,6 @@ L["Weapon Skill <- Weapon Skill Rating"] = "Inclure la Compétence d'arme confé
-- /rb sum statcomp exp -- 2.3.0
L["Sum Expertise"] = "Expertise"
L["Expertise <- Expertise Rating"] = "Inclure la valeur d'Expertise conférée par le Score d'expertise."
-- /rb sum statcomp tp
L["Sum TankPoints"] = "TankPoints"
L["TankPoints <- Health, Total Reduction"] = "TankPoints = Points de vie + diminution totale"
-- /rb sum statcomp tr
L["Sum Total Reduction"] = "Diminution complète"
L["Total Reduction <- Armor, Dodge, Parry, Block, Block Value, Defense, Resilience, MobMiss, MobCrit, MobCrush, DamageTakenMods"] = "Inclure la diminution complète conférée par : Armure + Equive + Parade + Blocage + Valeur de blocage + Défense + Résilience + MobMiss + MobCrit + MobCrush + DamageTakenMods."
-- /rb sum statcomp avoid
L["Sum Avoidance"] = "Évitement"
L["Avoidance <- Dodge, Parry, MobMiss, Block(Optional)"] = "Inclure l'Évitement conféré par : Esquive + Parade + Raté + Blocage(optionnel)."
Expand Down
6 changes: 0 additions & 6 deletions locales/koKR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,6 @@ L["Weapon Skill <- Weapon Skill Rating"] = "무기 숙련 <- 무기 숙련도"
-- /rb sum statcomp exp -- 2.3.0
L["Sum Expertise"] = "숙련"
L["Expertise <- Expertise Rating"] = "숙련 <- 숙련도"
-- /rb sum statcomp tp
L["Sum TankPoints"] = "탱킹점수"
L["TankPoints <- Health Total Reduction"] = "탱커점수 <- 체력, 총 감소량"
-- /rb sum statcomp tr
L["Sum Total Reduction"] = "총 감소량"
L["Total Reduction <- Armor Dodge, Parry, Block, Block Value, Defense, Resilience, MobMiss, MobCrit, MobCrush, DamageTakenMods"] = "총 감소량 <- 방어도, 회피, 무기 막기, 방어, 피해 방어량, 방어, 탄력도, 몹회피, 몹치명타, 몹강타, 적용전 데미지"
-- /rb sum statcomp avoid
L["Sum Avoidance"] = "회피량"
L["Avoidance <- Dodge Parry, MobMiss, Block(Optional)"] = "회피량 <- 회피, 무기 막기, 몹빗맞힘, 방어(선택적)"
Expand Down
6 changes: 0 additions & 6 deletions locales/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,6 @@ L["Block Rating Summary"] = "Суммировать рейтинг блока"
-- /rb sum tank res
L["Sum Resilience"] = "Сумма устойчивости"
L["Resilience Summary"] = "Суммировать устойчивость"
-- /rb sum tank tp
L["Sum TankPoints"] = "Самма TankPoints"
L["TankPoints <- Health, Total Reduction"] ="TankPoints <- Здоровье, Общее Cнижение"
-- /rb sum tank tr
L["Sum Total Reduction"] = "Самма общего снижения"
L["Total Reduction <- Armor, Dodge, Parry, Block, MobMiss, MobCrit, MobCrush, DamageTakenMods"] = "Общее снижение <- Броня, Уклонение, Парирование, Блок, ПромахСущества, КритСущества, MobCrush, DamageTakenMods"
-- /rb sum tank avoid
L["Sum Avoidance"] = "Сумма уклонения от удара"
L["Avoidance <- Dodge, Parry, MobMiss, Block(Optional)"] = "Уклонение от удара <- Уклонение, Парирование, ПромахСущества, Блок(дополнительный)"
Expand Down
6 changes: 0 additions & 6 deletions locales/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,6 @@ L["Weapon Skill <- Weapon Skill Rating"] = "武器技能 ← 武器技能等级"
-- /rb sum statcomp exp -- 2.3.0
L["Sum Expertise"] = "统计精准"
L["Expertise <- Expertise Rating"] = "精准 ← 精准等级"
-- /rb sum statcomp tp
L["Sum TankPoints"] = "统计抗打击能力"
L["TankPoints <- Health Total Reduction"] = "抗打击能力 ← 生命值, 所有伤害减免"
-- /rb sum statcomp tr
L["Sum Total Reduction"] = "统计伤害减免"
L["Total Reduction <- Armor Dodge, Parry, Block, Block Value, Defense, Resilience, MobMiss, MobCrit, MobCrush, DamageTakenMods"] = "所有伤害减免 <- 护甲值, 躲闪, 招架, 格挡, 格挡值, 防御技能, 韧性, 怪物未击中几率, 怪物重击几率, 怪物碾压打击几率, 伤害减免"
-- /rb sum statcomp avoid
L["Sum Avoidance"] = "统计躲避"
L["Avoidance <- Dodge Parry, MobMiss, Block(Optional)"] = "躲避 ← 躲闪, 招架, 怪物未命中, 格挡(可选)"
Expand Down
6 changes: 0 additions & 6 deletions locales/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,6 @@ L["Weapon Skill <- Weapon Skill Rating"] = "武器技能 ← 武器技能等級"
-- /rb sum statcomp exp -- 2.3.0
L["Sum Expertise"] = "統計熟練技能"
L["Expertise <- Expertise Rating"] = "熟練技能 ← 熟練等級"
-- /rb sum statcomp tp
L["Sum TankPoints"] = "統計坦克點"
L["TankPoints <- Health Total Reduction"] = "坦克點 ← 生命力、傷害減免總值"
-- /rb sum statcomp tr
L["Sum Total Reduction"] = "統計傷害減免總值"
L["Total Reduction <- Armor Dodge, Parry, Block, Block Value, Defense, Resilience, MobMiss, MobCrit, MobCrush, DamageTakenMods"] = "傷害減免總值 ← 護甲、閃躲、招架、格擋、格檔值、防禦、韌性、怪物未擊中、怪物致命、怪物輾壓、DamageTakenMods (?)"
-- /rb sum statcomp avoid
L["Sum Avoidance"] = "統計傷害迴避"
L["Avoidance <- Dodge Parry, MobMiss, Block(Optional)"] = "傷害迴避 ← 閃躲、招架、怪物未擊中、格擋(選項)"
Expand Down

0 comments on commit dc8cf71

Please sign in to comment.