-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: check for time to Runes when computing Time to Power. (#752)
* fix: 'extraPower' parameter of TimeToPower() not used correctly Generalize the parameter to be table whose keys "extra_energy" and "extra_focus" are checked for extra amounts of the power type when calculating the number of seconds until that power threshold is met. This removes the need to infer the pooled resource/power type. * refactor: extract getTimeToPowerAt() from getTimeToPowerStateAt() getTimeToPowerat() is a state method that returns the number of seconds until a power level is reached for the given power type. * refactor: import 'huge' as INFINITY in conditions Save needing to use a constant definition for INFINITY by directly importing 'huge' as INFINITY, and use in place of 'huge' in conditions. * refactor: simplify TimeToPower() condition using getTimeToPowerAt() Use getTimeToPowerAt() to determine the number of seconds until a power level is reached instead of repeating the same code with minor differences in the return type. * refactor: extract TimeToPowerForSpell() into Spells module Move Power:getTimetoPowerStateAt() to Spells:TimeToPowerForSpell() and change all references from the old function to the new one. Spells:TimeToPowerForSpell() also replaces Power:TimeToPower(). Remove unused Power functions TimeToPower() and hasPowerFor(). * refactor: make TimeToPowerForSpell() honor rune requirements Runes are a type of power, so check that rune requirements are met in Spells:TimeToPowerForSpell(). Remove runes check from BestAction module since it is now encapsulated within Spells:TimeToPowerForSpell().
- Loading branch information
1 parent
bc3a3e1
commit 3ddb48a
Showing
6 changed files
with
172 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.