Teach Ovale that consuming runes generates runic power.
Johnny C. Lam [11-15-13 - 19:57]
Teach Ovale that consuming runes generates runic power.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1174 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/Ovale.toc b/Ovale.toc
index e211cf4..2162fe2 100644
--- a/Ovale.toc
+++ b/Ovale.toc
@@ -49,7 +49,6 @@ OvaleCooldown.lua
OvaleOptions.lua
OvalePower.lua
OvaleRecount.lua
-OvaleRunes.lua
OvaleSkada.lua
#
OvaleCompile.lua
@@ -57,6 +56,7 @@ OvaleEclipse.lua
OvaleFuture.lua
OvaleIcone.lua
OvaleIcone.xml
+OvaleRunes.lua
#
conditions\conditions.xml
OvaleBestAction.lua
diff --git a/OvaleRunes.lua b/OvaleRunes.lua
index dbe8ef7..a680b98 100644
--- a/OvaleRunes.lua
+++ b/OvaleRunes.lua
@@ -19,6 +19,7 @@ Ovale.OvaleRunes = OvaleRunes
--<private-static-properties>
local OvaleData = Ovale.OvaleData
local OvalePaperDoll = Ovale.OvalePaperDoll
+local OvalePower = Ovale.OvalePower
local OvaleSpellBook = Ovale.OvaleSpellBook
local OvaleStance = Ovale.OvaleStance
local OvaleState = Ovale.OvaleState
@@ -164,11 +165,13 @@ end
--[[----------------------------------------------------------------------------
State machine for simulator.
+
+ AFTER: OvalePower
--]]----------------------------------------------------------------------------
--<public-static-properties>
OvaleRunes.statePrototype = {
- rune = nil, -- indexed by slot (1 through 6)
+ rune = nil, -- indexed by slot (1 through 6)
}
--</public-static-properties>
@@ -283,6 +286,16 @@ do
consumedRune.startCooldown = start
consumedRune.endCooldown = start + duration
consumedRune.active = false
+
+ -- Each rune consumed generates 10 (12, if in Frost Presence) runic power.
+ local runicpower = state.runicpower
+ if OvaleStance:IsStance("death_knight_frost_presence") then
+ runicpower = runicpower + 12
+ else
+ runicpower = runicpower + 10
+ end
+ local maxi = OvalePower.maxPower.runicpower
+ state.runicpower = (runicpower < maxi) and runicpower or maxi
else
Ovale:Errorf("No %s rune available to consume!", RUNE_NAME[runeType])
end