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

Allow Apparatus of Khaz'goroth to be used at any stack size #918

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

hillerstorm
Copy link
Contributor

No description provided.

Comment on lines 643 to 650
buffAuraOnGain := func(aura *core.Aura, sim *core.Simulation) {
aura.SetStacks(sim, stacks)
character.AddStatsDynamic(sim, buffs)
}
buffAuraOnExpire := func(aura *core.Aura, sim *core.Simulation) {
character.AddStatsDynamic(sim, buffs.Invert())
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be cleaner to create a shared utility similar to NewTemporaryStatsAura(), which we can name something like NewTemporaryStatBuffWithStacks(). This helper could take in the label, spellID, max stacks, stat type, and stat bonus per stack, and then automatically register an OnStacksChange callback to perform the multiplication on the bonusPerStack and call AddStatDynamic() with the stat type. Then you simply register the three types of buff auras below with the helper, and you only need to call SetStacks() after Activate() within the trinket activation spell, without needing to do all the multiplications here.

Your version works fine, but making it reusable is cleaner in case there are other such trinkets in the future. Doing it this way also means you don't need to rely on outer scope variables for stacks and buffs, since everything you need will be contained within the Aura structs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, there's already a MakeStackingAura() helper in sim/core/aura_helpers.go that you can take advantage of when creating the NewTemporaryStatBuffWithStacks() helper.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like 4b011af ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like 4b011af ?

Sorry for the delayed review, just came back from vacation. Yes this looks much cleaner now, thanks! Feel free to merge it into master now, or alternatively I can merge it into the stats_refactor branch and fix the conflicts to ship the two changes together once the refactor is ready. Whichever way you prefer is fine, I'll have to fix merge conflicts on my end either way so doesn't matter to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing as the refactor is ready for review and the trinket still is "unusable" for rets until that one is merged, you can go ahead and merge it into stats_refactor and ship both 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've merged in the stats refactor today, so I'll now fix this PR and ship it either later today or tomorrow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a PR on your fork for merging in stats_refactor, once you approve that then I believe this current PR should be merge-able.

NerdEgghead and others added 2 commits August 18, 2024 17:22
 On branch remove_restrictions
 Changes to be committed:
	modified:   sim/common/cata/other_effects.go
	modified:   sim/death_knight/frost/TestFrost.results
	modified:   sim/death_knight/unholy/TestUnholy.results
	modified:   sim/paladin/retribution/TestRetribution.results
	modified:   sim/rogue/assassination/TestAssassination.results
	modified:   sim/rogue/combat/TestCombat.results
	modified:   sim/rogue/subtlety/TestSubtlety.results
	modified:   sim/shaman/enhancement/TestEnhancement.results
@hillerstorm hillerstorm merged commit bfa9af8 into wowsims:master Aug 19, 2024
2 checks passed
@hillerstorm hillerstorm deleted the remove_restrictions branch August 19, 2024 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants