From 35b3cb54e678ee36a9bb76c436ba034fde6dc18d Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Sun, 13 Nov 2011 18:18:22 +0000 Subject: [PATCH] - added damage function - added text icons git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@432 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Condition.lua | 31 ++++++++++++++++++++++++++++++- OvaleFrame.lua | 2 +- OvaleIcone.lua | 3 ++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Condition.lua b/Condition.lua index 3fe217c..5fb594c 100644 --- a/Condition.lua +++ b/Condition.lua @@ -503,6 +503,35 @@ Ovale.conditions= end return nil end, + damage = function(condition) + local spellInfo = Ovale:GetSpellInfo(condition[1]) + if not spellInfo then + return nil + end + local ret = (spellInfo.base or 0) + if spellInfo.bonuscp then + ret = ret + (Ovale.state.combo * spellInfo.bonuscp) + end + if spellInfo.bonusholy then + ret = ret + (Ovale.state.holy * spellInfo.bonusholy) + end + if spellInfo.bonusap then + ret = ret + spellInfo.bonusap * UnitAttackPower("player") + end + if spellInfo.bonusapcp then + ret = ret + spellInfo.bonusapcp * UnitAttackPower("player") * Ovale.state.combo + end + if spellInfo.bonusapholy then + ret = ret + spellInfo.bonusapholy * UnitAttackPower("player") * Ovale.state.holy + end + if spellInfo.bonussp then + ret = ret + spellInfo.bonussp * GetSpellBonusDamage(2) + end + if spellInfo.bonusspholy then + ret = ret + spellInfo.bonusspholy * GetSpellBonusDamage(2) * Ovale.state.holy + end + return ret * Ovale.damageMultiplier + end, damageMultiplier = function(condition) return self.damageMultiplier, 0, 0 end, @@ -963,7 +992,7 @@ Ovale.conditions= return actionCooldownDuration, actionCooldownStart, -1 end, spellPower = function(condition) - return GetSpellBonusDamage("player", 0, 0) + return GetSpellBonusDamage(2), 0, 0 end, -- Test if the player is in a given stance -- 1 : the stance diff --git a/OvaleFrame.lua b/OvaleFrame.lua index 13e28bf..f730a5b 100644 --- a/OvaleFrame.lua +++ b/OvaleFrame.lua @@ -303,7 +303,7 @@ do newScale = Ovale.db.profile.apparence.iconScale width =newScale * 36 + margin height = newScale * 36 + margin - if Ovale.db.profile.apparence.predictif then + if Ovale.db.profile.apparence.predictif and node.params.type ~= "value" then nbIcons = 2 else nbIcons = 1 diff --git a/OvaleIcone.lua b/OvaleIcone.lua index b37ba38..639b269 100644 --- a/OvaleIcone.lua +++ b/OvaleIcone.lua @@ -6,9 +6,10 @@ local function SetValue(self, value, actionTexture) self.icone:SetTexture(actionTexture); self.icone:SetAlpha(1.0) self.cd:Hide() + self.focusText:Hide() self.aPortee:Hide() self.shortcut:Hide() - self.remains:SetText("TOTO") --string.format("%.1f", value)) + self.remains:SetText(string.format("%.1f", value)) self.remains:Show() self:Show() end -- 1.7.9.5