Johnny C. Lam [11-17-13 - 16:30]
diff --git a/conditions/BuffAmount.lua b/conditions/BuffAmount.lua
index 1f9b77d..4a61f88 100644
--- a/conditions/BuffAmount.lua
+++ b/conditions/BuffAmount.lua
@@ -17,6 +17,8 @@ do
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
+
--- Get the value of a buff as a number. Not all buffs return an amount.
-- @name BuffAmount
-- @paramsig number
@@ -43,7 +45,6 @@ do
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
local value = condition.value or 1
- local state = OvaleState.state
local statName = "value1"
if value == 1 then
statName = "value1"
diff --git a/conditions/BuffComboPoints.lua b/conditions/BuffComboPoints.lua
index ca3bbac..2d815e0 100644
--- a/conditions/BuffComboPoints.lua
+++ b/conditions/BuffComboPoints.lua
@@ -16,6 +16,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the player's combo points for the given aura at the time the aura was applied on the target.
-- @name BuffComboPoints
@@ -35,7 +36,6 @@ do
local function BuffComboPoints(condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local start, ending = aura.start, aura.ending
diff --git a/conditions/BuffDamageMultiplier.lua b/conditions/BuffDamageMultiplier.lua
index 6c5264d..e7c27c8 100644
--- a/conditions/BuffDamageMultiplier.lua
+++ b/conditions/BuffDamageMultiplier.lua
@@ -16,6 +16,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the player's damage multiplier for the given aura at the time the aura was applied on the target.
-- @name BuffDamageMultiplier
@@ -35,7 +36,6 @@ do
local function BuffDamageMultiplier(condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local start, ending = aura.start, aura.ending
diff --git a/conditions/BuffDuration.lua b/conditions/BuffDuration.lua
index ee6fdb7..870ac5c 100644
--- a/conditions/BuffDuration.lua
+++ b/conditions/BuffDuration.lua
@@ -16,6 +16,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the total duration of the aura from when it was first applied to when it ended.
-- @name BuffDuration
@@ -33,7 +34,6 @@ do
local function BuffDuration(condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local start, ending = aura.start, aura.ending
diff --git a/conditions/BuffExpires.lua b/conditions/BuffExpires.lua
index 8441d5a..87e3cdc 100644
--- a/conditions/BuffExpires.lua
+++ b/conditions/BuffExpires.lua
@@ -15,9 +15,9 @@ do
local OvaleState = Ovale.OvaleState
local ParseCondition = OvaleCondition.ParseCondition
+ local state = OvaleState.state
local function TimeWithHaste(t, haste)
- local state = OvaleState.state
if not t then
t = 0
end
@@ -59,7 +59,6 @@ do
local function BuffExpires(condition)
local auraId, seconds = condition[1], condition[2]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local start, ending = aura.start, aura.ending
@@ -102,7 +101,6 @@ do
local function BuffPresent(condition)
local auraId, seconds = condition[1], condition[2]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local start, ending = aura.start, aura.ending
diff --git a/conditions/BuffGain.lua b/conditions/BuffGain.lua
index 80daca6..25e845c 100644
--- a/conditions/BuffGain.lua
+++ b/conditions/BuffGain.lua
@@ -16,6 +16,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the time elapsed since the aura was last gained on the target.
-- @paramsig number or boolean
@@ -35,7 +36,6 @@ do
local function BuffGain(condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local gain = aura.gain or 0
diff --git a/conditions/BuffRemains.lua b/conditions/BuffRemains.lua
index d5b2f07..d6ae93e 100644
--- a/conditions/BuffRemains.lua
+++ b/conditions/BuffRemains.lua
@@ -16,6 +16,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the remaining time in seconds on an aura.
-- @name BuffRemains
@@ -39,7 +40,6 @@ do
local function BuffRemains(condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local start, ending = aura.start, aura.ending
diff --git a/conditions/BuffSnapshot.lua b/conditions/BuffSnapshot.lua
index 39f624c..c591bdb 100644
--- a/conditions/BuffSnapshot.lua
+++ b/conditions/BuffSnapshot.lua
@@ -16,12 +16,12 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
-- Return the value of the stat from the aura snapshot at the time the aura was applied.
local function BuffSnapshot(statName, defaultValue, condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local start, ending = aura.start, aura.ending
@@ -35,7 +35,6 @@ do
local function BuffSnapshotCritChance(statName, defaultValue, condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
diff --git a/conditions/BuffStacks.lua b/conditions/BuffStacks.lua
index a786a69..e813d92 100644
--- a/conditions/BuffStacks.lua
+++ b/conditions/BuffStacks.lua
@@ -16,6 +16,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the number of stacks of an aura on the target.
-- @name BuffStacks
@@ -41,7 +42,6 @@ do
local function BuffStacks(condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local start, ending = aura.start, aura.ending
diff --git a/conditions/CanCast.lua b/conditions/CanCast.lua
index 07d18aa..1089d11 100644
--- a/conditions/CanCast.lua
+++ b/conditions/CanCast.lua
@@ -14,6 +14,8 @@ do
local OvaleCondition = Ovale.OvaleCondition
local OvaleState = Ovale.OvaleState
+ local state = OvaleState.state
+
--- Check if the player can cast the given spell (not on cooldown).
-- @name CanCast
-- @paramsig boolean
@@ -22,7 +24,6 @@ do
local function CanCast(condition)
local spellId = condition[1]
- local state = OvaleState.state
local start, duration = state:GetSpellCooldown(spellId)
return start + duration, math.huge
end
diff --git a/conditions/ComboPoints.lua b/conditions/ComboPoints.lua
index 956dbd5..4452e5f 100644
--- a/conditions/ComboPoints.lua
+++ b/conditions/ComboPoints.lua
@@ -14,6 +14,7 @@ do
local OvaleState = Ovale.OvaleState
local Compare = OvaleCondition.Compare
+ local state = OvaleState.state
--- Get the number of combo points on the currently selected target for a feral druid or a rogue.
-- @name ComboPoints
@@ -29,7 +30,6 @@ do
local function ComboPoints(condition)
local comparator, limit = condition[1], condition[2]
- local state = OvaleState.state
local value = state.combo
return Compare(value, comparator, limit)
end
diff --git a/conditions/Counter.lua b/conditions/Counter.lua
index c2a9a2d..1af0357 100644
--- a/conditions/Counter.lua
+++ b/conditions/Counter.lua
@@ -14,6 +14,7 @@ do
local OvaleState = Ovale.OvaleState
local Compare = OvaleCondition.Compare
+ local state = OvaleState.state
--- Get the current value of a script counter.
-- @name Counter
@@ -26,7 +27,6 @@ do
local function Counter(condition)
local counter, comparator, limit = condition[1], condition[2], condition[3]
- local state = OvaleState.state
local value = state:GetCounterValue(counter)
return Compare(value, comparator, limit)
end
diff --git a/conditions/Damage.lua b/conditions/Damage.lua
index ecee004..a6e58d4 100644
--- a/conditions/Damage.lua
+++ b/conditions/Damage.lua
@@ -15,10 +15,10 @@ do
local OvaleState = Ovale.OvaleState
local Compare = OvaleCondition.Compare
+ local state = OvaleState.state
-- Return the non-critical-strike damage of a spell, given the player's current stats.
local function GetDamage(spellId)
- local state = OvaleState.state
-- TODO: Use target's debuffs in this calculation.
local ap = state.snapshot.attackPower or 0
local sp = state.snapshot.spellBonusDamage or 0
diff --git a/conditions/DamageMultiplier.lua b/conditions/DamageMultiplier.lua
index 9610356..1c44fb2 100644
--- a/conditions/DamageMultiplier.lua
+++ b/conditions/DamageMultiplier.lua
@@ -14,6 +14,7 @@ do
local OvaleState = Ovale.OvaleState
local Compare = OvaleCondition.Compare
+ local state = OvaleState.state
--- Get the current damage multiplier of a spell.
-- This currently does not take into account increased damage due to mastery.
@@ -31,7 +32,6 @@ do
local function DamageMultiplier(condition)
local spellId, comparator, limit = condition[1], condition[2], condition[3]
- local state = OvaleState.state
local bdm = state.snapshot.baseDamageMultiplier
local dm = state:GetDamageMultiplier(spellId)
local value = bdm * dm
diff --git a/conditions/Eclipse.lua b/conditions/Eclipse.lua
index 209b326..b67249e 100644
--- a/conditions/Eclipse.lua
+++ b/conditions/Eclipse.lua
@@ -14,6 +14,7 @@ do
local OvaleState = Ovale.OvaleState
local Compare = OvaleCondition.Compare
+ local state = OvaleState.state
--- Get the current amount of Eclipse power for balance druids.
-- A negative amount of power signifies being closer to Lunar Eclipse.
@@ -31,7 +32,6 @@ do
local function Eclipse(condition)
local comparator, limit = condition[1], condition[2]
- local state = OvaleState.state
local value = state.eclipse
return Compare(value, comparator, limit)
end
diff --git a/conditions/EnergyRegen.lua b/conditions/EnergyRegen.lua
index a82bf27..26eac77 100644
--- a/conditions/EnergyRegen.lua
+++ b/conditions/EnergyRegen.lua
@@ -14,6 +14,7 @@ do
local OvaleState = Ovale.OvaleState
local Compare = OvaleCondition.Compare
+ local state = OvaleState.state
--- Get the amount of regenerated energy per second for feral druids, non-mistweaver monks, and rogues.
-- @name EnergyRegen
@@ -27,7 +28,6 @@ do
local function EnergyRegen(condition)
local comparator, limit = condition[1], condition[2]
- local state = OvaleState.state
local value = state.powerRate.energy
return Compare(value, comparator, limit)
end
diff --git a/conditions/FocusRegen.lua b/conditions/FocusRegen.lua
index 4f05fd5..7e6a30f 100644
--- a/conditions/FocusRegen.lua
+++ b/conditions/FocusRegen.lua
@@ -14,6 +14,7 @@ do
local OvaleState = Ovale.OvaleState
local Compare = OvaleCondition.Compare
+ local state = OvaleState.state
--- Get the amount of regenerated focus per second for hunters.
-- @name FocusRegen
@@ -28,7 +29,6 @@ do
local function FocusRegen(condition)
local comparator, limit = condition[1], condition[2]
- local state = OvaleState.state
local value = state.powerRate.focus
return Compare(value, comparator, limit)
end
diff --git a/conditions/IsFeared.lua b/conditions/IsFeared.lua
index d18752d..20d004e 100644
--- a/conditions/IsFeared.lua
+++ b/conditions/IsFeared.lua
@@ -15,6 +15,7 @@ do
local API_HasFullControl = HasFullControl
local TestBoolean = OvaleCondition.TestBoolean
+ local state = OvaleState.state
--- Test if the player is feared.
-- @name IsFeared
@@ -28,7 +29,6 @@ do
local function IsFeared(condition)
local yesno = condition[1]
- local state = OvaleState.state
local boolean = not API_HasFullControl() and state:GetAura("player", "fear", "HARMFUL")
return TestBoolean(boolean, yesno)
end
diff --git a/conditions/IsIncapacitated.lua b/conditions/IsIncapacitated.lua
index f4d2e81..64ef560 100644
--- a/conditions/IsIncapacitated.lua
+++ b/conditions/IsIncapacitated.lua
@@ -15,6 +15,7 @@ do
local API_HasFullControl = HasFullControl
local TestBoolean = OvaleCondition.TestBoolean
+ local state = OvaleState.state
--- Test if the player is incapacitated.
-- @name IsIncapacitated
@@ -28,7 +29,6 @@ do
local function IsIncapacitated(condition)
local yesno = condition[1]
- local state = OvaleState.state
local boolean = not API_HasFullControl() and state:GetAura("player", "incapacitate", "HARMFUL")
return TestBoolean(boolean, yesno)
end
diff --git a/conditions/IsRooted.lua b/conditions/IsRooted.lua
index 9e3b60b..a6305e0 100644
--- a/conditions/IsRooted.lua
+++ b/conditions/IsRooted.lua
@@ -14,6 +14,7 @@ do
local OvaleState = Ovale.OvaleState
local TestBoolean = OvaleCondition.TestBoolean
+ local state = OvaleState.state
--- Test if the player is rooted.
-- @name IsRooted
@@ -27,7 +28,6 @@ do
local function IsRooted(condition)
local yesno = condition[1]
- local state = OvaleState.state
local boolean = state:GetAura("player", "root", "HARMFUL")
return TestBoolean(boolean, yesno)
end
diff --git a/conditions/IsStunned.lua b/conditions/IsStunned.lua
index 08bef3d..58a067a 100644
--- a/conditions/IsStunned.lua
+++ b/conditions/IsStunned.lua
@@ -15,6 +15,7 @@ do
local API_HasFullControl = HasFullControl
local TestBoolean = OvaleCondition.TestBoolean
+ local state = OvaleState.state
--- Test if the player is stunned.
-- @name IsStunned
@@ -28,7 +29,6 @@ do
local function IsStunned(condition)
local yesno = condition[1]
- local state = OvaleState.state
local boolean = not API_HasFullControl() and state:GetAura("player", "stun", "HARMFUL")
return TestBoolean(boolean, yesno)
end
diff --git a/conditions/Level.lua b/conditions/Level.lua
index a9d9c9d..3796c64 100644
--- a/conditions/Level.lua
+++ b/conditions/Level.lua
@@ -16,6 +16,7 @@ do
local API_UnitLevel = UnitLevel
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
+ local state = OvaleState.state
--- Get the level of the target.
-- @name Level
@@ -34,7 +35,6 @@ do
local function Level(condition)
local comparator, limit = condition[1], condition[2]
local target = ParseCondition(condition)
- local state = OvaleState.state
local value
if target == "player" then
value = state.level
diff --git a/conditions/ManaPercent.lua b/conditions/ManaPercent.lua
index 9e4d8d0..c1ae35e 100644
--- a/conditions/ManaPercent.lua
+++ b/conditions/ManaPercent.lua
@@ -19,6 +19,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the current percent level of mana (between 0 and 100) of the target.
-- @name ManaPercent
@@ -37,7 +38,6 @@ do
local function ManaPercent(condition)
local comparator, limit = condition[1], condition[2]
local target = ParseCondition(condition)
- local state = OvaleState.state
if target == "player" then
local powerMax = OvalePower.maxPower.mana or 0
if powerMax > 0 then
diff --git a/conditions/NextTick.lua b/conditions/NextTick.lua
index 4eb4db0..916e68c 100644
--- a/conditions/NextTick.lua
+++ b/conditions/NextTick.lua
@@ -16,6 +16,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the number of seconds until the next tick of a periodic aura on the target.
-- @name NextTick
@@ -36,7 +37,6 @@ do
local function NextTick(condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local start, ending, tick = aura.start, aura.ending, aura.tick
diff --git a/conditions/Power.lua b/conditions/Power.lua
index 8172acc..f8d5ec9 100644
--- a/conditions/Power.lua
+++ b/conditions/Power.lua
@@ -19,6 +19,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
-- Return the maximum power of the given power type on the target.
local function MaxPower(powerType, condition)
@@ -38,7 +39,6 @@ do
local function Power(powerType, condition)
local comparator, limit = condition[1], condition[2]
local target = ParseCondition(condition)
- local state = OvaleState.state
if target == "player" then
local value, origin, rate = state[powerType], state.currentTime, state.powerRate[powerType]
local start, ending = state.currentTime, math.huge
diff --git a/conditions/RelativeLevel.lua b/conditions/RelativeLevel.lua
index 88eaed0..e2c4c6e 100644
--- a/conditions/RelativeLevel.lua
+++ b/conditions/RelativeLevel.lua
@@ -17,6 +17,7 @@ do
local API_UnitLevel = UnitLevel
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
+ local state = OvaleState.state
--- Get the result of the target's level minus the player's level. This number may be negative.
-- @name RelativeLevel
@@ -37,7 +38,6 @@ do
local function RelativeLevel(condition)
local comparator, limit = condition[1], condition[2]
local target = ParseCondition(condition)
- local state = OvaleState.state
local value, level
if target == "player" then
level = state.level
diff --git a/conditions/RuneCount.lua b/conditions/RuneCount.lua
index d67c49d..d0c63da 100644
--- a/conditions/RuneCount.lua
+++ b/conditions/RuneCount.lua
@@ -16,6 +16,7 @@ do
local Compare = OvaleCondition.Compare
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the current number of active runes of the given type for death knights.
-- @name RuneCount
@@ -40,7 +41,6 @@ do
local name, comparator, limit = condition[1], condition[2], condition[3]
local deathCondition = condition.death
- local state = OvaleState.state
local count, startCooldown, endCooldown = state:RuneCount(name, deathCondition)
if startCooldown < math.huge then
local origin = startCooldown
diff --git a/conditions/Runes.lua b/conditions/Runes.lua
index eaddd5b..3a6b5c9 100644
--- a/conditions/Runes.lua
+++ b/conditions/Runes.lua
@@ -16,6 +16,7 @@ do
local OvaleState = Ovale.OvaleState
local RUNE_TYPE = OvaleRunes.RUNE_TYPE
+ local state = OvaleState.state
local ParseRuneCondition = nil
do
@@ -69,7 +70,6 @@ do
local function Runes(condition)
local blood, unholy, frost, death, deathCondition = ParseRuneCondition(condition)
- local state = OvaleState.state
local seconds = state:GetRunesCooldown(blood, unholy, frost, death, deathCondition)
return state.currentTime + seconds, math.huge
end
@@ -94,7 +94,6 @@ do
local function RunesCooldown(condition)
local blood, unholy, frost, death, deathCondition = ParseRuneCondition(condition)
- local state = OvaleState.state
local seconds = state:GetRunesCooldown(blood, unholy, frost, death, deathCondition)
return 0, state.currentTime + seconds, seconds, state.currentTime, -1
end
diff --git a/conditions/Snapshot.lua b/conditions/Snapshot.lua
index d38b02e..88760d3 100644
--- a/conditions/Snapshot.lua
+++ b/conditions/Snapshot.lua
@@ -14,11 +14,11 @@ do
local OvaleState = Ovale.OvaleState
local Compare = OvaleCondition.Compare
+ local state = OvaleState.state
-- Returns the value of the given snapshot stat.
local function Snapshot(statName, defaultValue, condition)
local comparator, limit = condition[1], condition[2]
- local state = OvaleState.state
local value = state.snapshot[statName] or defaultValue
return Compare(value, comparator, limit)
end
@@ -26,7 +26,6 @@ do
-- Returns the critical strike chance of the given snapshot stat.
local function SnapshotCritChance(statName, defaultValue, condition)
local comparator, limit = condition[1], condition[2]
- local state = OvaleState.state
local value = state.snapshot[statName] or defaultValue
if condition.unlimited ~= 1 and value > 100 then
value = 100
diff --git a/conditions/SpellCooldown.lua b/conditions/SpellCooldown.lua
index fd7a50b..e8977a4 100644
--- a/conditions/SpellCooldown.lua
+++ b/conditions/SpellCooldown.lua
@@ -19,6 +19,7 @@ do
local type = type
local Compare = OvaleCondition.Compare
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the cooldown in seconds before a spell is ready for use.
-- @name SpellCooldown
@@ -34,7 +35,6 @@ do
local function SpellCooldown(condition)
local spellId, comparator, limit = condition[1], condition[2], condition[3]
- local state = OvaleState.state
local start, duration
if type(spellId) == "string" then
local sharedCd = state.cd[spellId]
diff --git a/conditions/StaggerRemains.lua b/conditions/StaggerRemains.lua
index 5666d67..6a81f63 100644
--- a/conditions/StaggerRemains.lua
+++ b/conditions/StaggerRemains.lua
@@ -17,6 +17,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
local LIGHT_STAGGER = 124275
local MODERATE_STAGGER = 124274
@@ -38,7 +39,6 @@ do
local function StaggerRemains(condition)
local comparator, limit = condition[1], condition[2]
local target = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, HEAVY_STAGGER, "HARMFUL")
if not aura or aura.stacks == 0 then
aura = state:GetAura(target, MODERATE_STAGGER, "HARMFUL")
diff --git a/conditions/TickTime.lua b/conditions/TickTime.lua
index aface98..8f07312 100644
--- a/conditions/TickTime.lua
+++ b/conditions/TickTime.lua
@@ -17,6 +17,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
+ local state = OvaleState.state
--- Get the number of seconds between ticks of a periodic aura on a target.
-- @name TickTime
@@ -37,7 +38,6 @@ do
local function TickTime(condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local value = aura.tick or OvaleAura:GetTickLength(auraId)
diff --git a/conditions/Ticks.lua b/conditions/Ticks.lua
index 38e620f..fb35227 100644
--- a/conditions/Ticks.lua
+++ b/conditions/Ticks.lua
@@ -18,6 +18,7 @@ do
local select = select
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
+ local state = OvaleState.state
--- Get the total number of ticks of a periodic aura.
-- @name Ticks
@@ -32,7 +33,6 @@ do
local function Ticks(condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
local numTicks
if aura then
diff --git a/conditions/TicksAdded.lua b/conditions/TicksAdded.lua
index 43a336f..e70f8ba 100644
--- a/conditions/TicksAdded.lua
+++ b/conditions/TicksAdded.lua
@@ -17,6 +17,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the number of ticks that would be added if the dot were refreshed.
-- Not implemented, always returns 0.
@@ -31,7 +32,6 @@ do
local function TicksAdded(condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local start, ending, tick = aura.start, aura.ending, aura.tick
diff --git a/conditions/TicksRemain.lua b/conditions/TicksRemain.lua
index 35d9705..d5e024c 100644
--- a/conditions/TicksRemain.lua
+++ b/conditions/TicksRemain.lua
@@ -17,6 +17,7 @@ do
local Compare = OvaleCondition.Compare
local ParseCondition = OvaleCondition.ParseCondition
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the remaining number of ticks of a periodic aura on a target.
-- @name TicksRemain
@@ -40,7 +41,6 @@ do
local function TicksRemain(condition)
local auraId, comparator, limit = condition[1], condition[2], condition[3]
local target, filter, mine = ParseCondition(condition)
- local state = OvaleState.state
local aura = state:GetAura(target, auraId, filter, mine)
if aura then
local start, ending, tick = aura.start, aura.ending, aura.tick
diff --git a/conditions/TimeToMaxEnergy.lua b/conditions/TimeToMaxEnergy.lua
index d3e588a..7c2acad 100644
--- a/conditions/TimeToMaxEnergy.lua
+++ b/conditions/TimeToMaxEnergy.lua
@@ -16,6 +16,7 @@ do
local Compare = OvaleCondition.Compare
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the number of seconds before the player reaches maximum energy for feral druids, non-mistweaver monks and rogues.
-- @name TimeToMaxEnergy
@@ -31,7 +32,6 @@ do
local function TimeToMaxEnergy(condition)
local comparator, limit = condition[1], condition[2]
local maxEnergy = OvalePower.maxPower.energy or 0
- local state = OvaleState.state
local energy = state.energy or 0
local energyRegen = state.powerRate.energy or 10
local t = (maxEnergy - energy) / energyRegen
diff --git a/conditions/TimeToPowerFor.lua b/conditions/TimeToPowerFor.lua
index 5968432..77ae867 100644
--- a/conditions/TimeToPowerFor.lua
+++ b/conditions/TimeToPowerFor.lua
@@ -18,6 +18,7 @@ do
local API_GetSpellInfo = GetSpellInfo
local Compare = OvaleCondition.Compare
local TestValue = OvaleCondition.TestValue
+ local state = OvaleState.state
--- Get the number of seconds before the player has enough primary resources to cast the given spell.
-- @name TimeToPowerFor
@@ -33,7 +34,6 @@ do
local spellId, comparator, limit = condition[1], condition[2], condition[3]
local cost, _, powerToken = select(4, API_GetSpellInfo(spellId))
local powerType = OvalePower.POWER_TYPE[powerToken]
- local state = OvaleState.state
local currentPower = state[powerType]
local powerRate = state.powerRate[powerType]
cost = cost or 0
diff --git a/conditions/TimeWithHaste.lua b/conditions/TimeWithHaste.lua
index 6a4af7a..0496c95 100644
--- a/conditions/TimeWithHaste.lua
+++ b/conditions/TimeWithHaste.lua
@@ -14,6 +14,7 @@ do
local OvaleState = Ovale.OvaleState
local Compare = OvaleCondition.Compare
+ local state = OvaleState.state
--- Get the time scaled by the specified haste type, defaulting to spell haste.
--- For example, if a DoT normally ticks every 3 seconds and is scaled by spell haste, then it ticks every TimeWithHaste(3 haste=spell) seconds.
@@ -34,7 +35,6 @@ do
local function TimeWithHaste(condition)
local seconds, comparator, limit = condition[1], condition[2], condition[3]
local haste = condition.haste or "spell"
- local state = OvaleState.state
seconds = seconds or 0
local value = seconds
if haste == "spell" then
diff --git a/conditions/WeaponDamage.lua b/conditions/WeaponDamage.lua
index b01b272..8b3a5a0 100644
--- a/conditions/WeaponDamage.lua
+++ b/conditions/WeaponDamage.lua
@@ -14,6 +14,7 @@ do
local OvaleState = Ovale.OvaleState
local Compare = OvaleCondition.Compare
+ local state = OvaleState.state
--- The normalized weapon damage of the weapon in the given hand.
-- @name WeaponDamage
@@ -33,7 +34,6 @@ do
local function WeaponDamage(condition)
local hand = condition[1]
local comparator, limit
- local state = OvaleState.state
local value = 0
if hand == "offhand" or hand == "off" then
comparator, limit = condition[2], condition[3]