From d2fbce712adf1a523e7de7891fcefc2afed30298 Mon Sep 17 00:00:00 2001 From: coolmodi <7333074+coolmodi@users.noreply.github.com> Date: Wed, 23 Oct 2019 22:28:05 +0200 Subject: [PATCH] small tooltip improvement --- UI/TooltipDisplay.lua | 10 ++--- core/core.lua | 3 ++ data/classes/druid_spell.lua | 81 ++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 5 deletions(-) diff --git a/UI/TooltipDisplay.lua b/UI/TooltipDisplay.lua index d34cf44..706c5fb 100644 --- a/UI/TooltipDisplay.lua +++ b/UI/TooltipDisplay.lua @@ -72,15 +72,15 @@ local function AppendEfficiency(calcData, effectNum, isHeal, showTime) local effectData = calcData[effectNum]; local unitPart = isHeal and "HEAL" or "DAMAGE"; - if effectNum == 1 and SpellCalc_settings.ttEffCost then + if effectNum == 1 and SpellCalc_settings.ttEffCost and calcData.effectiveCost ~= calcData.baseCost then GameTooltip:AddLine(("%s: %.1f"):format(L["TT_EFFCOST"], calcData.effectiveCost), TTCOLOR, TTCOLOR, TTCOLOR); end - if SpellCalc_settings.ttPerMana then + if SpellCalc_settings.ttPerMana and effectData.perMana > 0 then GameTooltip:AddLine(("%s: %.2f"):format(L["TT_PER_MANA_"..unitPart], effectData.perMana), TTCOLOR, TTCOLOR, TTCOLOR); end - if SpellCalc_settings.ttToOom then + if SpellCalc_settings.ttToOom and effectData.doneToOom > 0 then if showTime then GameTooltip:AddLine(("%s: %d (%.1fs, %.1f casts)"):format(L["TT_UNTILOOM_"..unitPart], effectData.doneToOom, calcData.timeToOom, calcData.castsToOom), TTCOLOR, TTCOLOR, TTCOLOR); else @@ -186,14 +186,14 @@ local function AppendDmgShieldEffect(calcData, effectNum) if effectData.charges > 0 then GameTooltip:AddLine(("%s: %dx %d | %d total"):format(L["TT_DAMAGE"], effectData.charges, effectData.perCharge, effectData.hitAvg), TTCOLOR, TTCOLOR, TTCOLOR); else - GameTooltip:AddLine(("%s: %d"):format(L["TT_DAMAGE"], effectData.ticks, effectData.perTick, effectData.hitAvg), TTCOLOR, TTCOLOR, TTCOLOR); + GameTooltip:AddLine(("%s: %.1f"):format(L["TT_DAMAGE"], effectData.perCharge), TTCOLOR, TTCOLOR, TTCOLOR); end end AppendCoefData(calcData, effectData); AppendMitigation(calcData); - if SpellCalc_settings.ttPerSecond then + if SpellCalc_settings.ttPerSecond and effectData.perSecond > 0 then GameTooltip:AddLine(("%s: %.1f"):format(L["TT_PERSECC_DAMAGE"], effectData.perSecond), TTCOLOR, TTCOLOR, TTCOLOR); end diff --git a/core/core.lua b/core/core.lua index df92f42..a6ff7e2 100644 --- a/core/core.lua +++ b/core/core.lua @@ -39,6 +39,7 @@ local function MakeSpellTable(spellType, primaryType, secondaryType) }; if spellType == SPELL_TYPE.SPELL then + st.baseCost = 0; st.effectiveCost = 0; st.castsToOom = 0; st.timeToOom = 0; @@ -282,6 +283,8 @@ function _addon:CalcSpell(spellId) -------------------------- -- Ressource stuff + calcData.baseCost = spellCost; + if spellCost == 0 then calcData.effectiveCost = -1; if spellType == SPELL_TYPE.SPELL then diff --git a/data/classes/druid_spell.lua b/data/classes/druid_spell.lua index 9bbf1f9..4bc3d4d 100644 --- a/data/classes/druid_spell.lua +++ b/data/classes/druid_spell.lua @@ -10,6 +10,9 @@ _addon.spellBaseInfo = { [GetSpellInfo(339)] = { -- Entangling Roots school = 4, }, + [GetSpellInfo(467)] = { -- Thorns + school = 4, + }, [GetSpellInfo(774)] = { -- Rejuvenation school = 4, }, @@ -54,6 +57,19 @@ _addon.spellRankInfo = { }, } }, + [467] = { -- Thorns(Rank 1) + spellLevel = 6, + maxLevel = 0, + duration = 600, + effects = { + [1] = { + isDmgShield = true, + charges = 0, + min = 3, + coef = 0, + }, + } + }, [774] = { -- Rejuvenation(Rank 1) spellLevel = 4, maxLevel = 9, @@ -68,6 +84,19 @@ _addon.spellRankInfo = { }, } }, + [782] = { -- Thorns(Rank 2) + spellLevel = 14, + maxLevel = 0, + duration = 600, + effects = { + [1] = { + isDmgShield = true, + charges = 0, + min = 6, + coef = 0, + }, + } + }, [1058] = { -- Rejuvenation(Rank 2) spellLevel = 10, maxLevel = 15, @@ -95,6 +124,19 @@ _addon.spellRankInfo = { }, } }, + [1075] = { -- Thorns(Rank 3) + spellLevel = 24, + maxLevel = 0, + duration = 600, + effects = { + [1] = { + isDmgShield = true, + charges = 0, + min = 9, + coef = 0, + }, + } + }, [1430] = { -- Rejuvenation(Rank 3) spellLevel = 16, maxLevel = 21, @@ -391,6 +433,19 @@ _addon.spellRankInfo = { }, } }, + [8914] = { -- Thorns(Rank 4) + spellLevel = 34, + maxLevel = 0, + duration = 600, + effects = { + [1] = { + isDmgShield = true, + charges = 0, + min = 12, + coef = 0, + }, + } + }, [8921] = { -- Moonfire(Rank 1) spellLevel = 4, maxLevel = 9, @@ -686,6 +741,19 @@ _addon.spellRankInfo = { }, } }, + [9756] = { -- Thorns(Rank 5) + spellLevel = 44, + maxLevel = 0, + duration = 600, + effects = { + [1] = { + isDmgShield = true, + charges = 0, + min = 15, + coef = 0, + }, + } + }, [9758] = { -- Healing Touch(Rank 8) spellLevel = 44, maxLevel = 49, @@ -937,6 +1005,19 @@ _addon.spellRankInfo = { }, } }, + [9910] = { -- Thorns(Rank 6) + spellLevel = 54, + maxLevel = 0, + duration = 600, + effects = { + [1] = { + isDmgShield = true, + charges = 0, + min = 18, + coef = 0, + }, + } + }, [9912] = { -- Wrath(Rank 8) spellLevel = 54, maxLevel = 60,