Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 59 additions & 19 deletions Modules/Config/DefenseSection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function _Config:LoadDefenseSection()
},
meleeCritReduction = {
type = "toggle",
order = 1.81,
order = 2,
name = function() return i18n("Melee Crit Reduction") end,
desc = function() return i18n("Shows/Hides the reduction percentage of being critically hit by melee attacks.") end,
width = 1.5,
Expand All @@ -55,7 +55,7 @@ function _Config:LoadDefenseSection()
},
rangedCritReduction = {
type = "toggle",
order = 1.82,
order = 2.1,
name = function() return i18n("Ranged Crit Reduction") end,
desc = function() return i18n("Shows/Hides the reduction percentage of being critically hit by ranged attacks.") end,
width = 1.5,
Expand All @@ -68,7 +68,7 @@ function _Config:LoadDefenseSection()
},
spellCritReduction = {
type = "toggle",
order = 1.83,
order = 2.2,
name = function() return i18n("Spell Crit Reduction") end,
desc = function() return i18n("Shows/Hides the reduction percentage of being critically hit by spells.") end,
width = 1.5,
Expand All @@ -81,7 +81,7 @@ function _Config:LoadDefenseSection()
},
avoidance = {
type = "toggle",
order = 1.85,
order = 3,
name = function() return i18n("Avoidance") end,
desc = function() return i18n("Shows/Hides the total avoidance.") end,
width = 1.5,
Expand All @@ -94,7 +94,7 @@ function _Config:LoadDefenseSection()
},
avoidanceBoss = {
type = "toggle",
order = 1.86,
order = 3.1,
name = function() return i18n("Avoidance (Lvl +3)") end,
desc = function() return i18n("Shows/Hides the total avoidance (Lvl +3).") end,
width = 1.5,
Expand All @@ -107,7 +107,7 @@ function _Config:LoadDefenseSection()
},
defenseRating = {
type = "toggle",
order = 1.9,
order = 4,
name = function() return i18n("Defense Rating") end,
desc = function() return i18n("Shows/Hides the defense rating.") end,
width = 1.5,
Expand All @@ -123,7 +123,7 @@ function _Config:LoadDefenseSection()
},
defense = {
type = "toggle",
order = 2,
order = 4.1,
name = function() return i18n("Defense") end,
desc = function() return i18n("Shows/Hides the defense value.") end,
width = 1.5,
Expand All @@ -134,9 +134,23 @@ function _Config:LoadDefenseSection()
Stats.RebuildStatInfos()
end,
},
blockRating = {
type = "toggle",
order = 5,
name = function() return i18n("Block Rating") end,
desc = function() return i18n("Shows/Hides the block rating.") end,
width = 1.5,
hidden = function() return ECS.IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.blockRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.blockRating.display = value
Stats.RebuildStatInfos()
end,
},
blockChance = {
type = "toggle",
order = 3,
order = 5.1,
name = function() return i18n("Block Chance") end,
desc = function() return i18n("Shows/Hides the block chance.") end,
width = 1.5,
Expand All @@ -149,7 +163,7 @@ function _Config:LoadDefenseSection()
},
blockValue = {
type = "toggle",
order = 4,
order = 5.2,
name = function() return i18n("Block Value") end,
desc = function() return i18n("Shows/Hides the block value.") end,
width = 1.5,
Expand All @@ -160,9 +174,23 @@ function _Config:LoadDefenseSection()
Stats.RebuildStatInfos()
end,
},
parryRating = {
type = "toggle",
order = 6,
name = function() return i18n("Parry Rating") end,
desc = function() return i18n("Shows/Hides the parry rating.") end,
width = 1.5,
hidden = function() return ECS.IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.parryRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.parryRating.display = value
Stats.RebuildStatInfos()
end,
},
parry = {
type = "toggle",
order = 5,
order = 6.1,
name = function() return i18n("Parry Chance") end,
desc = function() return i18n("Shows/Hides the parry chance.") end,
width = 1.5,
Expand All @@ -173,9 +201,23 @@ function _Config:LoadDefenseSection()
Stats.RebuildStatInfos()
end,
},
dodgeRating = {
type = "toggle",
order = 7,
name = function() return i18n("Dodge Rating") end,
desc = function() return i18n("Shows/Hides the dodge rating.") end,
width = 1.5,
hidden = function() return ECS.IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.dodgeRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.dodgeRating.display = value
Stats.RebuildStatInfos()
end,
},
dodge = {
type = "toggle",
order = 6,
order = 7.1,
name = function() return i18n("Dodge Chance") end,
desc = function() return i18n("Shows/Hides the dodge chance.") end,
width = 1.5,
Expand All @@ -188,17 +230,15 @@ function _Config:LoadDefenseSection()
},
resilience = {
type = "toggle",
order = 7,
name = function() return i18n("Resilience") end,
desc = function() return i18n("Shows/Hides the resilience value.") end,
order = 8,
name = function() return i18n("Resilience Rating") end,
desc = function() return i18n("Shows/Hides the resilience rating.") end,
width = 1.5,
hidden = function()
return (not ECS.IsWotlk)
end,
hidden = function() return ECS.IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.defense.display); end,
get = function () return ExtendedCharacterStats.profile.defense.resilience.display; end,
get = function () return ExtendedCharacterStats.profile.defense.resilienceRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.defense.resilience.display = value
ExtendedCharacterStats.profile.defense.resilienceRating.display = value
Stats.RebuildStatInfos()
end,
},
Expand Down
16 changes: 15 additions & 1 deletion Modules/Config/MeleeSection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,23 @@ function _Config:LoadMeleeSection()
Stats.RebuildStatInfos()
end,
},
meleeCrit = {
meleeCritRating = {
type = "toggle",
order = 2,
name = function() return i18n("Melee Crit. Rating") end,
desc = function() return i18n("Shows/Hides the melee crit. rating.") end,
width = 1.5,
hidden = function() return ECS.IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.melee.display); end,
get = function () return ExtendedCharacterStats.profile.melee.critRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.melee.critRating.display = value
Stats.RebuildStatInfos()
end,
},
meleeCrit = {
type = "toggle",
order = 2.1,
name = function() return i18n("Melee Crit") end,
desc = function() return i18n("Shows/Hides the melee crit chance.") end,
width = 1.5,
Expand Down
16 changes: 15 additions & 1 deletion Modules/Config/RangeSection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,23 @@ function _Config:LoadRangeSection()
Stats.RebuildStatInfos()
end,
},
rangeCrit = {
rangedCritRating = {
type = "toggle",
order = 2,
name = function() return i18n("Ranged Crit. Rating") end,
desc = function() return i18n("Shows/Hides the ranged crit. rating.") end,
width = 1.5,
hidden = function() return ECS.IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.ranged.display); end,
get = function () return ExtendedCharacterStats.profile.ranged.critRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.ranged.critRating.display = value
Stats.RebuildStatInfos()
end,
},
rangeCrit = {
type = "toggle",
order = 2.1,
name = function() return i18n("Ranged Crit") end,
desc = function() return i18n("Shows/Hides the ranged crit chance.") end,
width = 1.5,
Expand Down
16 changes: 15 additions & 1 deletion Modules/Config/SpellSection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,23 @@ function _Config:LoadSpellSection()
Stats.RebuildStatInfos()
end,
},
spellCrit = {
spellCritRating = {
type = "toggle",
order = 1,
name = function() return i18n("Spell Crit. Rating") end,
desc = function() return i18n("Shows/Hides the spell crit. rating.") end,
width = 1.5,
hidden = function() return ECS.IsClassic end,
disabled = function() return (not ExtendedCharacterStats.profile.spell.display); end,
get = function () return ExtendedCharacterStats.profile.spell.critRating.display; end,
set = function (_, value)
ExtendedCharacterStats.profile.spell.critRating.display = value
Stats.RebuildStatInfos()
end,
},
spellCrit = {
type = "toggle",
order = 1.1,
name = function() return i18n("Spell Crit") end,
desc = function() return i18n("Shows/Hides the spell crit chance.") end,
width = 1.5,
Expand Down
14 changes: 7 additions & 7 deletions Modules/Data/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dataFunctionRefs = {
["MovementSpeed"] = function() return Data:GetMovementSpeed() end,
-- Melee
["MeleeAttackPower"] = function() return Data:GetMeleeAttackPower() end,
["MeleeCritRating"] = function() return ECS.IsClassic and 0 or Data:GetMeleeCritRating() end,
["MeleeCritChance"] = function() return Data:MeleeCrit() end,
["Expertise"] = function()
if ECS.IsWotlk then
Expand Down Expand Up @@ -85,6 +86,7 @@ dataFunctionRefs = {
["MeleeAttackSpeedOffHand"] = function() return Data:GetMeleeAttackSpeedOffHand() end,
-- Ranged
["RangeAttackpower"] = function() return Data:GetRangeAttackPower() end,
["RangedCritRating"] = function() return ECS.IsClassic and 0 or Data:GetRangedCritRating() end,
["RangedCritChance"] = function() return Data:RangedCrit() end,
["RangedHitRating"] = function()
if ECS.IsWotlk then
Expand Down Expand Up @@ -140,17 +142,14 @@ dataFunctionRefs = {
end
end,
["DefenseValue"] = function() return Data:GetDefenseValue() end,
["DodgeRating"] = function() return ECS.IsClassic and 0 or Data:GetDodgeRating() end,
["DodgeChance"] = function() return Data:GetDodgeChance() end,
["ParryRating"] = function() return ECS.IsClassic and 0 or Data:GetParryRating() end,
["ParryChance"] = function() return Data:GetParryChance() end,
["BlockRating"] = function() return ECS.IsClassic and 0 or Data:GetBlockRating() end,
["BlockChance"] = function() return Data:GetBlockChance() end,
["BlockValue"] = function() return Data:GetBlockValue() end,
["ResilienceValue"] = function()
if ECS.IsWotlk then
return Data:GetResilienceRating()
else
return 0
end
end,
["ResilienceRating"] = function() return ECS.IsClassic and 0 or Data:GetResilienceRating() end,
-- Spell
["SpellHitRating"] = function()
if ECS.IsWotlk then
Expand All @@ -162,6 +161,7 @@ dataFunctionRefs = {
["SpellHitBonus"] = function() return Data.SpellHitBonus(Data.HOLY_SCHOOL) end,
["SpellHitSameLevel"] = function() return Data:SpellMissChanceSameLevel(Data.HOLY_SCHOOL) end,
["SpellHitBossLevel"] = function() return Data:SpellMissChanceBossLevel(Data.HOLY_SCHOOL) end,
["SpellCritRating"] = function() return ECS.IsClassic and 0 or Data:GetSpellCritRating() end,
["SpellCritChance"] = function() return Data:GetSpellCrit(Data.HOLY_SCHOOL) end,
["SpellHasteRating"] = function()
if ECS.IsWotlk then
Expand Down
15 changes: 15 additions & 0 deletions Modules/Data/Defense.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,21 @@ function Data:GetResilienceRating()
return DataUtils:Round(GetCombatRating(15), 2)
end

---@return number
function Data:GetParryRating()
return DataUtils:Round(GetCombatRating(CR_PARRY), 2)
end

---@return number
function Data:GetDodgeRating()
return DataUtils:Round(GetCombatRating(CR_DODGE), 2)
end

---@return number
function Data:GetBlockRating()
return DataUtils:Round(GetCombatRating(CR_BLOCK), 2)
end

---@return number
function _Defense:GetEnchantsBlockValue()
local mod = 0
Expand Down
6 changes: 6 additions & 0 deletions Modules/Data/Melee.lua
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ function Data:GetMeleeHasteRating()
return DataUtils:Round(hasteRating, 0)
end

---@return number
function Data:GetMeleeCritRating()
local critRating = GetCombatRating(CR_CRIT_MELEE)
return DataUtils:Round(critRating, 0)
end

---@return string
function Data:GetMeleeHasteBonus()
local hasteBonus = GetCombatRatingBonus(CR_HASTE_MELEE)
Expand Down
6 changes: 6 additions & 0 deletions Modules/Data/Ranged.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,10 @@ function Data.RangeMissChanceBossLevel()
return DataUtils:Round(missChance, 2) .. "%"
end

---@return number
function Data:GetRangedCritRating()
local critRating = GetCombatRating(CR_CRIT_RANGED)
return DataUtils:Round(critRating, 0)
end

return Data
6 changes: 6 additions & 0 deletions Modules/Data/SpellCrit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,9 @@ end
function Data:GetSpellPenetration()
return DataUtils:Round(GetSpellPenetration(), 2)
end

---@return number
function Data:GetSpellCritRating()
local critRating = GetCombatRating(CR_CRIT_SPELL)
return DataUtils:Round(critRating, 0)
end
10 changes: 5 additions & 5 deletions Modules/Profile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ local function GetDefaultStatsProfile()
statColor = colors.ATTACK_SPEED_PRIMARY,
},
expertise = {display = true, isTbcOnly = true, refName = "Expertise", text = "Expertise"},
expertiseRating = {display = true, isTbcOnly = true, refName = "ExpertiseRating", text = "Expertise Rating"},
expertiseRating = {display = true, isTbcOnly = true, refName = "ExpertiseRating", text = "Expertise rating"},
hasteRating = {
display = true,
isTbcOnly = true,
refName = "MeleeHasteRating",
text = "Haste Rating",
text = "Haste rating",
textColor = colors.HASTE_RATING_SECONDARY,
statColor = colors.HASTE_RATING_PRIMARY
},
Expand Down Expand Up @@ -236,15 +236,15 @@ local function GetDefaultStatsProfile()
display = true,
isTbcOnly = true,
refName = "RangedArmorPenetrationRating",
text = "Armor Pen. Rating",
text = "Armor pen. rating",
textColor = colors.ATTACK_SPEED_SECONDARY,
statColor = colors.ATTACK_SPEED_PRIMARY,
},
hasteRating = {
display = true,
isTbcOnly = true,
refName = "RangedHasteRating",
text = "Haste Rating",
text = "Haste rating",
textColor = colors.HASTE_RATING_SECONDARY,
statColor = colors.HASTE_RATING_PRIMARY
},
Expand Down Expand Up @@ -542,7 +542,7 @@ local function GetDefaultStatsProfile()
display = true,
isTbcOnly = true,
refName = "SpellHasteRating",
text = "Haste Rating",
text = "Haste rating",
textColor = colors.HASTE_RATING_SECONDARY,
statColor = colors.HASTE_RATING_PRIMARY
},
Expand Down
Loading
Loading