Quantcast

Don't consider spells waiting on the GCD to be on cooldown.

Author Johnny C. Lam <jlam88@gmail.com>
Author date 2014-12-12 20:41:01
Author local date 2014-12-12 15:41:01 -0500
Committer Johnny C. Lam <jlam88@gmail.com>
Committer date 2014-12-12 20:51:06
Committer local date 2014-12-12 15:51:06 -0500
Commit 81b634acf58683299a57370ce39829d26e48fd69
Tree 9be73a6b74cbcce80f48e2c0538d3f46a8a1eecf
Parent f27d1c7d7770900cb79cf30f757ecacdda7c96a0
Don't consider spells waiting on the GCD to be on cooldown.

This differs from the return value of Blizzard's GetSpellCooldown() but
makes more sense from the point of view of a player.

Adjust OvaleCooldown:GetSpellCooldown() to check for whether the GCD is
active and to consider a spell that is waiting on the GCD to just be ready
when the GCD is over.  A spell is on cooldown only if the duration
returned by OvaleCooldown:GetSpellCooldown() is greater than zero.

Introduce a new state method GetTimeToSpell() that returns the time until
the spell is ready to cast, accounting for cooldowns and resource
requirements, and use it instead of very similar code in
OvaleBestAction:GetActionInfo() and the TimeToSpell() script condition.

Note that OvaleRunes is a core Ovale module since it provides state
methods that are needed for these computations to work.

This is the rest of the fix for ticket 494 by @Reason2012.