Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for time to Runes when computing Time to Power. #752

Merged
merged 6 commits into from
Dec 19, 2020

Conversation

johnnylam88
Copy link
Contributor

No description provided.

The commit 18d7714 did not
correctly handle the optional extraPower paramter of
Power:TimeToPower().

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.
getTimeToPowerat() is a state method that returns the number of
seconds until a power level is reached for the given power type.
Save needing to use a constant definition for INFINITY by directly
importing 'huge' as INFINITY, and use in place of 'huge' in
conditions.
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.
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().
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().
@Sidoine Sidoine merged commit 3ddb48a into Sidoine:master Dec 19, 2020
@johnnylam88 johnnylam88 deleted the refactor/time-to-power-runes branch December 19, 2020 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants