diff --git a/RatingBuster.lua b/RatingBuster.lua index c4d470c..0441b52 100644 --- a/RatingBuster.lua +++ b/RatingBuster.lua @@ -2154,13 +2154,13 @@ do end end if profileDB.showCritFromAgi then - local effect = StatLogic:GetCritFromAgi(value, class, calcLevel) + local effect = value * StatLogic:GetCritPerAgi(class, calcLevel) if effect > 0 then tinsert(infoTable, (L["$value% Crit"]:gsub("$value", ("%+.2f"):format(effect)))) end end if profileDB.showDodgeFromAgi and (calcLevel == playerLevel) then - local effect = StatLogic:GetDodgeFromAgi(value) + local effect = value * StatLogic:GetDodgePerAgi() if effect > 0 then tinsert(infoTable, (L["$value% Dodge"]:gsub("$value", ("%+.2f"):format(effect)))) end @@ -2252,7 +2252,7 @@ do end end if profileDB.showSpellCritFromInt then - local effect = StatLogic:GetSpellCritFromInt(value, class, calcLevel) + local effect = value * StatLogic:GetSpellCritPerInt(class, calcLevel) if effect > 0 then tinsert(infoTable, (L["$value% Spell Crit"]:gsub("$value", ("%+.2f"):format(effect)))) end @@ -2716,7 +2716,7 @@ local summaryCalcData = { func = function(sum) return sum[StatLogic.Stats.MeleeCrit] + StatLogic:GetEffectFromRating(sum["MELEE_CRIT_RATING"], "MELEE_CRIT_RATING", calcLevel) - + StatLogic:GetCritFromAgi(sum[StatLogic.Stats.Agility], class, calcLevel) + + sum[StatLogic.Stats.Agility] * StatLogic:GetCritPerAgi(class, calcLevel) end, ispercent = true, }, @@ -2735,7 +2735,7 @@ local summaryCalcData = { func = function(sum) return sum[StatLogic.Stats.RangedCrit] + StatLogic:GetEffectFromRating(sum["RANGED_CRIT_RATING"], "RANGED_CRIT_RATING", calcLevel) - + StatLogic:GetCritFromAgi(sum[StatLogic.Stats.Agility], class, calcLevel) + + sum[StatLogic.Stats.Agility] * StatLogic:GetCritPerAgi(class, calcLevel) end, ispercent = true, }, @@ -2973,7 +2973,7 @@ local summaryCalcData = { func = function(sum) return sum[StatLogic.Stats.SpellCrit] + StatLogic:GetEffectFromRating(summaryFunc["SPELL_CRIT_RATING"](sum), "SPELL_CRIT_RATING", calcLevel) - + StatLogic:GetSpellCritFromInt(sum[StatLogic.Stats.Intellect], class, calcLevel) + + sum[StatLogic.Stats.Intellect] * StatLogic:GetSpellCritPerInt(class, calcLevel) end, ispercent = true, }, @@ -3033,7 +3033,7 @@ local summaryCalcData = { return sum[StatLogic.Stats.Dodge] + StatLogic:GetEffectFromRating(sum["DODGE_RATING"], "DODGE_RATING", calcLevel) + summaryFunc[StatLogic.Stats.Defense](sum) * DODGE_PARRY_BLOCK_PERCENT_PER_DEFENSE - + StatLogic:GetDodgeFromAgi(sum[StatLogic.Stats.Agility]) + + sum[StatLogic.Stats.Agility] * StatLogic:GetDodgePerAgi() end, ispercent = true, }, diff --git a/libs/StatLogic/StatLogic.lua b/libs/StatLogic/StatLogic.lua index 64f7df2..c5eb077 100644 --- a/libs/StatLogic/StatLogic.lua +++ b/libs/StatLogic/StatLogic.lua @@ -1389,62 +1389,6 @@ function StatLogic:GetDodgePerAgi() return dodgeFromAgi / agility end ---[[--------------------------------- -{ :GetDodgeFromAgi(agi) -------------------------------------- --- Description - Calculates the dodge chance from agility for your current class and level. --- Args - agi - number - agility --- Returns - [dodge] - number - dodge percentage - [statid] - Stat - StatLogic.Stats.Dodge --- Remarks - Only works for your currect class and current level, does not support class and level args. --- Examples - StatLogic:GetDodgeFromAgi(1) -- GetDodgePerAgi - StatLogic:GetDodgeFromAgi(10) -} ------------------------------------]] - -function StatLogic:GetDodgeFromAgi(agi) - -- argCheck for invalid input - self:argCheck(agi, 2, "number") - -- Calculate - return agi * self:GetDodgePerAgi(), StatLogic.Stats.Dodge -end - ---[[--------------------------------- -{ :GetCritFromAgi(agi, [class], [level]) -------------------------------------- --- Description - Calculates the melee/ranged crit chance from agility for any class or level. --- Args - agi - number - agility - [class] - (defaults: PlayerClass) - string - english class name - number - class id - [level] - (defaults: PlayerLevel) - number - player level used for calculation --- Returns - [crit] - number - melee/ranged crit percentage - [statid] - Stat - StatLogic.Stats.MeleeCrit --- Remarks --- Examples - StatLogic:GetCritFromAgi(1) -- GetCritPerAgi - StatLogic:GetCritFromAgi(10) - StatLogic:GetCritFromAgi(10, "WARRIOR") - StatLogic:GetCritFromAgi(10, nil, 70) - StatLogic:GetCritFromAgi(10, "WARRIOR", 70) -} ------------------------------------]] - function StatLogic:GetCritPerAgi(class, level) -- argCheck for invalid input self:argCheck(class, 3, "nil", "string", "number") @@ -1467,48 +1411,6 @@ function StatLogic:GetCritPerAgi(class, level) end end -function StatLogic:GetCritFromAgi(agi, class, level) - -- argCheck for invalid input - self:argCheck(agi, 2, "number") - self:argCheck(class, 3, "nil", "string", "number") - self:argCheck(level, 4, "nil", "number") - class = self:ValidateClass(class) - -- if level is invalid input, default to player level - if type(level) ~= "number" or level < 1 or level > GetMaxPlayerLevel() then - level = UnitLevel("player") - end - -- Calculate - return agi * self:GetCritPerAgi(class, level), StatLogic.Stats.MeleeCrit -end - ---[[--------------------------------- -{ :GetSpellCritFromInt(int, [class], [level]) -------------------------------------- --- Description - Calculates the spell crit chance from intellect for any class or level. --- Args - int - number - intellect - [class] - (defaults: PlayerClass) - string - english class name - number - class id - [level] - (defaults: PlayerLevel) - number - player level used for calculation --- Returns - [spellcrit] - number - spell crit percentage - [statid] - Stat - StatLogic.Stats.SpellCrit --- Remarks --- Examples - StatLogic:GetSpellCritFromInt(1) -- GetSpellCritPerInt - StatLogic:GetSpellCritFromInt(10) - StatLogic:GetSpellCritFromInt(10, "MAGE") - StatLogic:GetSpellCritFromInt(10, nil, 70) - StatLogic:GetSpellCritFromInt(10, "MAGE", 70) -} ------------------------------------]] - function StatLogic:GetSpellCritPerInt(class, level) -- argCheck for invalid input self:argCheck(class, 3, "nil", "string", "number") @@ -1530,20 +1432,6 @@ function StatLogic:GetSpellCritPerInt(class, level) end end -function StatLogic:GetSpellCritFromInt(int, class, level) - -- argCheck for invalid input - self:argCheck(int, 2, "number") - self:argCheck(class, 3, "nil", "string", "number") - self:argCheck(level, 4, "nil", "number") - class = self:ValidateClass(class) - -- if level is invalid input, default to player level - if type(level) ~= "number" or level < 1 or level > GetMaxPlayerLevel() then - level = UnitLevel("player") - end - -- Calculate - return int * StatLogic:GetSpellCritPerInt(class, level), StatLogic.Stats.SpellCrit -end - ---------------------------------- -- Stat Summary Ignore Settings -- ----------------------------------