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

fix: rewrite demon hunter modules to correctly handle state #1015

Merged
merged 4 commits into from Sep 18, 2021

Conversation

johnnylam88
Copy link
Contributor

The demon hunter modules were not handling state correctly. In a
state module, the module registers for events to track what is
currently happening "live" in-game, and updates the current state
of the game based on those events. A state module also implements
the StateModule interface and does two things:

  1. Update the simulator state from the current state each time
    resetState() is called.
  2. Modify the simulator state after various applySpell*()
    functions are called.

Lastly, script conditions that query information from state modules
should query that information from the simulator state, not the
current state.

Make these changes to the three demon hunter modules that track the
Demonic talent, sigils, and Soul Fragments, respectively.

The `DemonHunterDemonic` module doesn't have to gain or lose fake
auras to correctly track Demonic in Shadowlands. Only add a
Metamorphosis buff of the correct duration within the simulator
if a Demonic trigger spell was cast, for either Havoc or Vengeance
specializations.
Keep track of current sigils that are charging (before activation)
and also keep track of sigils in the simulator that are charging
due to a spell cast within the simulator.

Don't look for an activation spell because if a sigil doesn't hit
anything, then it'll never seem like it activated. Just assume that
it will activate after the charging time has ended.

Also add Elysian Decree to the sigils that are tracked.
Keep track of pending Soul Fragments that have not yet spawned and
also keep track of the total number of Soul Fragments after spells
have been cast within the simulator.
@johnnylam88
Copy link
Contributor Author

I just noticed a typo in one of these commits. I will fix and push a new change in this branch to fix the issue.

@johnnylam88
Copy link
Contributor Author

This pullup should be ready to go. I've tested it in both Havoc and Vengeance specs on my demon hunter.

As a side note, the Warlock module needs the same treatment as these three demon hunter modules, but I don't have a level 60 warlock to test with yet, so I'll hold off on those changes for now.

@Sidoine Sidoine merged commit cc3923d into Sidoine:master Sep 18, 2021
@johnnylam88 johnnylam88 deleted the fix/dh-state branch September 18, 2021 15:59
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.

None yet

2 participants