Quantcast

Most buff script conditions should be allowed to return non-active auras.

Johnny C. Lam [12-09-13 - 02:15]
Most buff script conditions should be allowed to return non-active auras.

The script evaluation engine (OvaleBestAction) handles expired auras just
fine since it works in intersections and unions of time spans, but this
will allow the engine to properly deal with auras that are applied in the
future, e.g., after the current spellcast.  This fixes the balance druid
scripts that recommend applying DoTs once an Eclipse state is reached.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1252 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
conditions/BuffAmount.lua
conditions/BuffComboPoints.lua
conditions/BuffDamageMultiplier.lua
conditions/BuffDuration.lua
conditions/BuffExpires.lua
conditions/BuffRemains.lua
conditions/BuffSnapshot.lua
conditions/BuffStacks.lua
conditions/TickTime.lua
conditions/TicksRemain.lua
diff --git a/conditions/BuffAmount.lua b/conditions/BuffAmount.lua
index f3a2eca..4a61f88 100644
--- a/conditions/BuffAmount.lua
+++ b/conditions/BuffAmount.lua
@@ -54,7 +54,7 @@ do
 			statName = "value3"
 		end
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) then
+		if aura then
 			local start, ending = aura.start, aura.ending
 			local value = aura[statName] or 0
 			return TestValue(start, ending, value, start, 0, comparator, limit)
diff --git a/conditions/BuffComboPoints.lua b/conditions/BuffComboPoints.lua
index a4689ab..2d815e0 100644
--- a/conditions/BuffComboPoints.lua
+++ b/conditions/BuffComboPoints.lua
@@ -37,7 +37,7 @@ do
 		local auraId, comparator, limit = condition[1], condition[2], condition[3]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) then
+		if aura then
 			local start, ending = aura.start, aura.ending
 			local value = aura and aura.combo or 0
 			return TestValue(start, ending, value, start, 0, comparator, limit)
diff --git a/conditions/BuffDamageMultiplier.lua b/conditions/BuffDamageMultiplier.lua
index 7955e81..e7c27c8 100644
--- a/conditions/BuffDamageMultiplier.lua
+++ b/conditions/BuffDamageMultiplier.lua
@@ -37,7 +37,7 @@ do
 		local auraId, comparator, limit = condition[1], condition[2], condition[3]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) then
+		if aura then
 			local start, ending = aura.start, aura.ending
 			local baseDamageMultiplier = aura.snapshot and aura.snapshot.baseDamageMultiplier or 1
 			local damageMultiplier = aura.damageMultiplier or 1
diff --git a/conditions/BuffDuration.lua b/conditions/BuffDuration.lua
index e92b08e..870ac5c 100644
--- a/conditions/BuffDuration.lua
+++ b/conditions/BuffDuration.lua
@@ -35,7 +35,7 @@ do
 		local auraId, comparator, limit = condition[1], condition[2], condition[3]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) then
+		if aura then
 			local start, ending = aura.start, aura.ending
 			local value = ending - start
 			return TestValue(start, ending, value, start, 0, comparator, limit)
diff --git a/conditions/BuffExpires.lua b/conditions/BuffExpires.lua
index 66d3975..87e3cdc 100644
--- a/conditions/BuffExpires.lua
+++ b/conditions/BuffExpires.lua
@@ -60,7 +60,7 @@ do
 		local auraId, seconds = condition[1], condition[2]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) then
+		if aura then
 			local start, ending = aura.start, aura.ending
 			seconds = TimeWithHaste(seconds or 0, condition.haste)
 			if ending - seconds <= start then
@@ -102,7 +102,7 @@ do
 		local auraId, seconds = condition[1], condition[2]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) then
+		if aura then
 			local start, ending = aura.start, aura.ending
 			seconds = TimeWithHaste(seconds or 0, condition.haste)
 			if ending - seconds <= start then
diff --git a/conditions/BuffRemains.lua b/conditions/BuffRemains.lua
index 1033e89..d6ae93e 100644
--- a/conditions/BuffRemains.lua
+++ b/conditions/BuffRemains.lua
@@ -41,7 +41,7 @@ do
 		local auraId, comparator, limit = condition[1], condition[2], condition[3]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) then
+		if aura then
 			local start, ending = aura.start, aura.ending
 			return TestValue(start, ending, ending - start, start, -1, comparator, limit)
 		end
diff --git a/conditions/BuffSnapshot.lua b/conditions/BuffSnapshot.lua
index 4aeb7e7..0322d39 100644
--- a/conditions/BuffSnapshot.lua
+++ b/conditions/BuffSnapshot.lua
@@ -23,7 +23,7 @@ do
 		local auraId, comparator, limit = condition[1], condition[2], condition[3]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) then
+		if aura then
 			local start, ending = aura.start, aura.ending
 			local value = aura.snapshot and aura.snapshot[statName] or defaultValue
 			return TestValue(start, ending, value, start, 0, comparator, limit)
@@ -36,7 +36,7 @@ do
 		local auraId, comparator, limit = condition[1], condition[2], condition[3]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) then
+		if aura then
 			local start, ending = aura.start, aura.ending
 			local value = aura.snapshot and aura.snapshot[statName] or defaultValue
 			if condition.unlimited ~= 1 and value > 100 then
diff --git a/conditions/BuffStacks.lua b/conditions/BuffStacks.lua
index 5568b63..e813d92 100644
--- a/conditions/BuffStacks.lua
+++ b/conditions/BuffStacks.lua
@@ -43,7 +43,7 @@ do
 		local auraId, comparator, limit = condition[1], condition[2], condition[3]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) then
+		if aura then
 			local start, ending = aura.start, aura.ending
 			local value = aura.stacks or 0
 			return TestValue(start, ending, value, start, 0, comparator, limit)
diff --git a/conditions/TickTime.lua b/conditions/TickTime.lua
index 5bfd6be..5b09fe5 100644
--- a/conditions/TickTime.lua
+++ b/conditions/TickTime.lua
@@ -38,7 +38,7 @@ do
 		local auraId, comparator, limit = condition[1], condition[2], condition[3]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) and aura.tick then
+		if aura and aura.tick then
 			local value = aura.tick
 			return Compare(value, comparator, limit)
 		end
diff --git a/conditions/TicksRemain.lua b/conditions/TicksRemain.lua
index b37c04e..d5e024c 100644
--- a/conditions/TicksRemain.lua
+++ b/conditions/TicksRemain.lua
@@ -42,7 +42,7 @@ do
 		local auraId, comparator, limit = condition[1], condition[2], condition[3]
 		local target, filter, mine = ParseCondition(condition)
 		local aura = state:GetAura(target, auraId, filter, mine)
-		if state:IsActiveAura(aura) then
+		if aura then
 			local start, ending, tick = aura.start, aura.ending, aura.tick
 			if tick and tick > 0 then
 				return TestValue(start, ending, 1, ending, -1/tick, comparator, limit)