Quantcast

add comments

Sidoine De Wispelaere [05-24-10 - 10:07]
add comments
bug fix with time on icons

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@249 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
Ovale.lua
Ovale.toc
OvaleIcone.lua
defaut/Druide.lua
defaut/Guerrier.lua
diff --git a/Ovale.lua b/Ovale.lua
index 949fd79..f6c5203 100644
--- a/Ovale.lua
+++ b/Ovale.lua
@@ -999,37 +999,25 @@ function Ovale:GetCD(spellName)
 	end
 end

-
+-- Lance un sort dans le simulateur
+-- spellName : le nom du sort
+-- startCast : temps du cast
+-- endCast : fin du cast
+-- nextCast : temps auquel le prochain sort peut être lancé (>=endCast, avec le GCD)
+-- nocd : le sort ne déclenche pas son cooldown
 function Ovale:AddSpellToStack(spellName, startCast, endCast, nextCast, nocd)
---	self.spellStack.length = self.spellStack.length + 1
---	if not self.spellStack[self.spellStack.length] then
---		self.spellStack[self.spellStack.length] = {}
---	end
---	local newSpell = self.spellStack[self.spellStack.length]
---	newSpell.attenteFinCast = endCast
---	if spellName then
---		newSpell.info = self.spellInfo[spellName]
---	else
---		newSpell.info = nil
---	end
-
-	local newSpellInfo = nil
 	if not spellName then
 		return
 	end

+	local newSpellInfo = nil
 	newSpellInfo = self.spellInfo[spellName]

-	if startCast>Ovale.maintenant then
-		local _, _, _, cost = GetSpellInfo(spellName)
-		if cost then
-			self.state.mana = self.state.mana - cost
-		end
-	end
-
+	--On enregistre les infos sur le sort en cours
 	self.attenteFinCast = nextCast
 	self.currentSpellName = spellName
 	self.startCast = startCast
+	--Temps actuel de la simulation : un peu après le dernier cast (ou maintenant si dans le passé)
 	if startCast>=self.maintenant then
 		self.currentTime = startCast+0.1
 	else
@@ -1040,14 +1028,23 @@ function Ovale:AddSpellToStack(spellName, startCast, endCast, nextCast, nocd)
 		Ovale:Print("add spell "..spellName.." at "..startCast.." currentTime = "..nextCast)
 	end

-	if startCast>=0 then
+	--Coût du sort (uniquement si dans le futur, dans le passé l'énergie est déjà dépensée)
+	if startCast > Ovale.maintenant then
+		--Mana
+		local _, _, _, cost = GetSpellInfo(spellName)
+		if cost then
+			self.state.mana = self.state.mana - cost
+		end
+
 		if newSpellInfo then
+			--Points de combo
 			if newSpellInfo.combo then
 				self.state.combo = self.state.combo + newSpellInfo.combo
 				if self.state.combo<0 then
 					self.state.combo = 0
 				end
 			end
+			--Runes
 			if newSpellInfo.frost then
 				self:AddRune(startCast, 3, newSpellInfo.frost)
 			end
@@ -1063,14 +1060,18 @@ function Ovale:AddSpellToStack(spellName, startCast, endCast, nextCast, nocd)
 		end
 	end

+	-- Effets du sort
 	if newSpellInfo then
+		-- Cooldown du sort
 		local cd = self:GetCD(spellName)
 		if cd then
 			cd.start = startCast
 			cd.duration = newSpellInfo.cd
+			--Pas de cooldown
 			if nocd then
 				cd.duration = 0
 			end
+			--On vérifie si le buff "buffnocd" est présent, auquel cas le CD du sort n'est pas déclenché
 			if newSpellInfo.buffnocd and not nocd then
 				local buffAura = self:GetAura("player", "HELPFUL", newSpellInfo.buffnocd)
 				if self.traceAura then
@@ -1091,6 +1092,8 @@ function Ovale:AddSpellToStack(spellName, startCast, endCast, nextCast, nocd)
 				cd.toggled = 1
 			end
 		end
+
+		--Auras causés par le sort
 		if newSpellInfo.aura then
 			for target, targetInfo in pairs(newSpellInfo.aura) do
 				for filter, filterInfo in pairs(targetInfo) do
@@ -1099,16 +1102,21 @@ function Ovale:AddSpellToStack(spellName, startCast, endCast, nextCast, nocd)
 						newAura.mine = true
 						local duration = spellData
 						local stacks = duration
-						local spellName = self:GetSpellInfoOrNil(spell)
-						if spellName and self.spellInfo[spellName] and self.spellInfo[spellName].duration then
-							duration = self.spellInfo[spellName].duration
+						local auraSpellName = self:GetSpellInfoOrNil(spell)
+						--Optionnellement, on va regarder la durée du buff
+						if auraSpellName and self.spellInfo[auraSpellName] and self.spellInfo[auraSpellName].duration then
+							duration = self.spellInfo[auraSpellName].duration
 						end
 						if stacks<0 and newAura.ending then
 							newAura.stacks = newAura.stacks + stacks
+							if Ovale.trace then
+								self:Print("removing aura "..auraSpellName.." because of ".. spellName)
+							end
+							--Plus de stacks, on supprime l'aura
 							if newAura.stacks<=0 then
 								newAura.stacks = 0
 								newAura.ending = 0
-							end
+							end
 						elseif newAura.ending and newAura.ending >= endCast then
 							newAura.ending = endCast + duration
 							newAura.stacks = newAura.stacks + 1
@@ -1118,8 +1126,8 @@ function Ovale:AddSpellToStack(spellName, startCast, endCast, nextCast, nocd)
 							newAura.stacks = 1
 						end
 						if Ovale.trace then
-							if spellName then
-								self:Print("adding aura "..spellName.." to "..target.." "..newAura.start..","..newAura.ending)
+							if auraSpellName then
+								self:Print("adding "..stacks.." aura "..auraSpellName.." to "..target.." "..newAura.start..","..newAura.ending)
 							else
 								self:Print("adding nil aura")
 							end
diff --git a/Ovale.toc b/Ovale.toc
index 1a5be44..4497658 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: 3.3.33
+## Version: 3.3.34
 ## OptionalDeps: Ace3, ButtonFacade, Recount, LibBabble-CreatureType-3.0
 ## SavedVariables: OvaleDB
 ## SavedVariablesPerCharacter: OvaleDBPC
diff --git a/OvaleIcone.lua b/OvaleIcone.lua
index 72423c7..e31f463 100644
--- a/OvaleIcone.lua
+++ b/OvaleIcone.lua
@@ -83,7 +83,7 @@ local function Update(self, element, minAttente, actionTexture, actionInRange, a
 		end

 		-- Le temps restant
-		if (Ovale.db.profile.apparence.numeric) then
+		if (Ovale.db.profile.apparence.numeric and minAttente > Ovale.maintenant) then
 			self.remains:SetText(string.format("%.1f", minAttente - Ovale.maintenant))
 			self.remains:Show()
 		else
diff --git a/defaut/Druide.lua b/defaut/Druide.lua
index 064089d..78bbcdf 100644
--- a/defaut/Druide.lua
+++ b/defaut/Druide.lua
@@ -61,6 +61,7 @@ SpellInfo(RIP combo=-5 duration=12)
 SpellInfo(FEROCIOUSBITE combo=-5)
 SpellInfo(RIP glyph=GLYPHOFSHRED addduration=6)
 SpellInfo(RIP glyph=GLYPHOFRIP addduration=4)
+SpellInfo(CLAW combo=1)

 AddIcon help=main
 {
@@ -122,6 +123,7 @@ AddIcon help=main
 			if ComboPoints(less 5) and TargetDebuffExpires(RIP 3 mine=1) Spell(SHRED)
 			if ComboPoints(less 1) and BuffExpires(SAVAGEROAR 2) Spell(SHRED)
 		}
+		if CheckBoxOff(shred) Spell(CLAW)
 	}

 	unless Stance(1) or Stance(3)
diff --git a/defaut/Guerrier.lua b/defaut/Guerrier.lua
index 5e26f79..e446c43 100644
--- a/defaut/Guerrier.lua
+++ b/defaut/Guerrier.lua
@@ -99,6 +99,7 @@ AddIcon help=main
         Spell(REVENGE usable=1)
         Spell(SHIELDSLAM)
         Spell(BLOODTHIRST)
+		Spell(MORTALSTRIKE)

         if Mana(more 10) Spell(DEVASTATE)
      }
@@ -117,8 +118,8 @@ AddIcon help=main
         {
 			if BuffExpires(SLAMBUFF 2.5)
       			Spell(SLAM nored=1)
-			if BuffDuration(SLAMBUFF more 6) and 1s before Spell(BLOODTHIRST) and 1s before Spell(WHIRLWIND)
-				Spell(SLAM)
+			if BuffDuration(SLAMBUFF more 6) and 1s before Spell(BLOODTHIRST) and { 1s before Spell(WHIRLWIND) or CheckBoxOff(whirlwind) }
+				Spell(SLAM nored=1)
       		Spell(SLAM priority=2 nored=1)
       	}