diff --git a/Condition.lua b/Condition.lua index 5fb594c..bb64213 100644 --- a/Condition.lua +++ b/Condition.lua @@ -489,9 +489,15 @@ Ovale.conditions= local points = Ovale.state.combo return compare(points, condition[1], condition[2]) end, + comboPoints = function(condition) + return Ovale.state.combo, 0, 0 + end, Counter = function(condition) return compare(Ovale:GetCounterValue(condition[1]), condition[2], condition[3]) end, + counter = function(condition) + return Ovale:GetCounterValue(condition[1]), 0, 0 + end, CreatureFamily = function(condition) return testbool(UnitCreatureFamily(getTarget(condition.target)) == LBCT[condition[1]], condition[2]) end, @@ -530,7 +536,7 @@ Ovale.conditions= if spellInfo.bonusspholy then ret = ret + spellInfo.bonusspholy * GetSpellBonusDamage(2) * Ovale.state.holy end - return ret * Ovale.damageMultiplier + return ret * Ovale.damageMultiplier, 0, 0 end, damageMultiplier = function(condition) return self.damageMultiplier, 0, 0 @@ -543,6 +549,9 @@ Ovale.conditions= return addTime(deadAt, -condition[2]), nil end end, + deadIn = function(condition) + return getTargetDead(getTarget(condition.target)), 0, -1 + end, -- Test if a debuff will expire on the target after a given time, or if there is less than the -- given number of stacks (if stackable) -- 1 : buff spell id @@ -589,10 +598,20 @@ Ovale.conditions= end end end, + distance = function(condition) + if LRC then + return LRC:GetRange(getTarget(condition.target)) + else + return nil + end + end, --Compare to eclipse power. <0 lunar, >0 solar Eclipse = function(condition) return compare(Ovale.state.eclipse, condition[1], condition[2]) end, + eclipse = function(condition) + return Ovale.state.eclipse + end, EffectiveMana = function(condition) local limit = GetManaTime(condition[2], true) if condition[1]=="more" then @@ -601,6 +620,9 @@ Ovale.conditions= return 0,limit end end, + effectiveMana = function(condition) + return GetManaAndRate(true) + end, EndCastTime = function(condition) local name, rank, icon, cost, isFunnel, powerType, castTime = Ovale:GetSpellInfoOrNil(condition[1]) local actionCooldownStart, actionCooldownDuration, actionEnable = Ovale:GetComputedSpellCD(condition[1]) @@ -642,6 +664,9 @@ Ovale.conditions= HolyPower = function(condition) return compare(Ovale.state.holy, condition[1], condition[2]) end, + holyPower = function(condition) + return Ovale.state.holy, 0, 0 + end, InCombat = function(condition) return testbool(Ovale.enCombat, condition[1]) end, @@ -656,6 +681,13 @@ Ovale.conditions= return compare(GetItemCount(condition[1]), condition[2], condition[3]) end end, + itemCount = function(condition) + if condition.charges == 1 then + return GetItemCount(condition[1], false, true), 0, 0 + else + return GetItemCount(condition[1]), 0, 0 + end + end, IsCasting = function(condition) local casting local target = getTarget(condition.target) @@ -718,6 +750,9 @@ Ovale.conditions= end return compare(Ovale.spellDamage[spellId], condition[2], condition[3]) end, + lastSpellDamage = function(condition) + return Ovale.spellDamage(condition[1]) + end, lastSpellDamageMultiplier = function(condition) return Ovale.lastSpellDM[condition[1]], 0, 0 end, @@ -743,14 +778,25 @@ Ovale.conditions= Level = function(condition) return compare(UnitLevel(getTarget(condition.target)), condition[1], condition[2]) end, + level = function(condition) + return UnitLevel(condition.target) + end, Life = function(condition) local target = getTarget(condition.target) return compare(UnitHealth(target), condition[1], condition[2]) end, + life = function(condition) + local target = getTarget(condition.target) + return UnitHealth(target), 0, 0 + end, LifeMissing = function(condition) local target = getTarget(condition.target) return compare(UnitHealthMax(target)-UnitHealth(target), condition[1], condition[2]) end, + lifeMissing = function(condition) + local target = getTarget(condition.target) + return UnitHealthMax(target)-UnitHealth(target), 0, 0 + end, -- Test if the player life is bellow/above a given value in percent -- 1 : "less" or "more" -- 2 : the limit, in percent @@ -984,9 +1030,15 @@ Ovale.conditions= SoulShards = function(condition) return compare(Ovale.state.shard, condition[1], condition[2]) end, + soulShards = function(condition) + return Ovale.state.shard + end, Speed = function(condition) return compare(GetUnitSpeed(getTarget(condition.target))*100/7, condition[1], condition[2]) end, + speed = function(condition) + return GetUnitSpeed(getTarget(condition.target))*100/7 + end, spell = function(condition) local actionCooldownStart, actionCooldownDuration, actionEnable = Ovale:GetComputedSpellCD(condition[1]) return actionCooldownDuration, actionCooldownStart, -1 @@ -1017,6 +1069,13 @@ Ovale.conditions= end return compare(Ovale.pointsTalent[condition[1]], condition[2], condition[3]) end, + talentPoints = function(condition) + if (not Ovale.listeTalentsRemplie) then + Ovale:RemplirListeTalents() + return nil + end + return Ovale.pointsTalent[condition[1]], 0, 0 + end, -- Test if the target's target is the player (or is not) -- 1 : "yes" (it should be the player) or "no" TargetIsPlayer = function(condition) @@ -1026,6 +1085,10 @@ Ovale.conditions= local isTanking, status, threatpct = UnitDetailedThreatSituation("player", getTarget(condition.target)) return compare(threatpct, condition[1], condition[2]) end, + threat = function(condition) + local isTanking, status, threatpct = UnitDetailedThreatSituation("player", getTarget(condition.target)) + return threatpct + end, TimeInCombat = function(condition) if not Ovale.combatStartTime then return nil @@ -1035,6 +1098,9 @@ Ovale.conditions= return 0, Ovale.combatStartTime + condition[2] end end, + timeInCombat = function(condition) + return Ovale.maintenant - Ovale.combatStartTime, Ovale.maintenant, 1 + end, timeToDie = function(condition) return 0, getTargetDead(getTarget(condition.target)), -1 end, @@ -1098,4 +1164,10 @@ Ovale.conditions= end end end, -} \ No newline at end of file +} + +Ovale.conditions.health = Ovale.conditions.life +Ovale.conditions.Health = Ovale.conditions.Life +Ovale.conditions.healthPercent = Ovale.conditions.lifePercent +Ovale.conditions.HealthPercent = Ovale.conditions.LifePercent +Ovale.conditions.HealthMissing = Ovale.conditions.LifeMissing diff --git a/Ovale.toc b/Ovale.toc index 40eb3f0..0641c8b 100644 --- a/Ovale.toc +++ b/Ovale.toc @@ -3,7 +3,7 @@ ## Notes: Show the icon of the next spell to cast ## Notes-frFR: Affiche l'icône du prochain sort à lancer ## Author: Sidoine -## Version: 4.2.6 +## Version: 4.2.7 ## OptionalDeps: Ace3, ButtonFacade, Recount, Skada, LibBabble-CreatureType-3.0, LibRangeCheck-2.0 ## SavedVariables: OvaleDB ## SavedVariablesPerCharacter: OvaleDBPC diff --git a/OvaleFrame.lua b/OvaleFrame.lua index 94cb27d..e229b41 100644 --- a/OvaleFrame.lua +++ b/OvaleFrame.lua @@ -174,7 +174,14 @@ do if node.params.texture then actionTexture = GetSpellTexture(node.params.texture) end - action.icons[1]:SetValue(start, actionTexture) + local value + if ending and priorite and start then + value = start + (Ovale.maintenant - ending) * priorite + end + action.icons[1]:SetValue(value, actionTexture) + if #action.icons > 1 then + action.icons[2]:Update(element, nil) + end else local actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellId, actionTarget, noRed = Ovale:GetActionInfo(element) @@ -219,32 +226,32 @@ do action.icons[2]:SetPoint("TOPLEFT",self.frame,"TOPLEFT",(action.left + (top+1)*action.dx)/action.scale,(action.top - (top+1)*action.dy)/action.scale) end end - end - if (node.params.size ~= "small" and not node.params.nocd and Ovale.db.profile.apparence.predictif and node.params.type ~= "value") then - if start then - local castTime=0 - if spellId then - local _, _, _, _, _, _, _castTime = GetSpellInfo(spellId) - if _castTime and _castTime>0 then - castTime = _castTime/1000 + if (node.params.size ~= "small" and not node.params.nocd and Ovale.db.profile.apparence.predictif) then + if start then + local castTime=0 + if spellId then + local _, _, _, _, _, _, _castTime = GetSpellInfo(spellId) + if _castTime and _castTime>0 then + castTime = _castTime/1000 + end end - end - local gcd = Ovale:GetGCD(spellId) - local nextCast - if (castTime>gcd) then - nextCast = start + castTime + local gcd = Ovale:GetGCD(spellId) + local nextCast + if (castTime>gcd) then + nextCast = start + castTime + else + nextCast = start + gcd + end + if Ovale.trace then + Ovale:Print("****Second icon " .. start) + end + Ovale:AddSpellToStack(spellId, start, start + castTime, nextCast) + start, ending, priorite, element = Ovale:CalculerMeilleureAction(node) + action.icons[2]:Update(element, start, Ovale:GetActionInfo(element)) else - nextCast = start + gcd - end - if Ovale.trace then - Ovale:Print("****Second icon " .. start) + action.icons[2]:Update(element, nil) end - Ovale:AddSpellToStack(spellId, start, start + castTime, nextCast) - start, ending, priorite, element = Ovale:CalculerMeilleureAction(node) - action.icons[2]:Update(element, start, Ovale:GetActionInfo(element)) - else - action.icons[2]:Update(element, nil) end end end diff --git a/OvaleIcone.lua b/OvaleIcone.lua index 639b269..a1286f6 100644 --- a/OvaleIcone.lua +++ b/OvaleIcone.lua @@ -9,7 +9,16 @@ local function SetValue(self, value, actionTexture) self.focusText:Hide() self.aPortee:Hide() self.shortcut:Hide() - self.remains:SetText(string.format("%.1f", value)) + if value then + if value<10 then + value = string.format("%.1f", value) + else + value = string.format("%d", value) + end + self.remains:SetText(value) + else + self.remains:SetText() + end self.remains:Show() self:Show() end