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

[UI][CORE] Add ability to item swap all gear #1253

Open
wants to merge 153 commits into
base: master
Choose a base branch
from

Conversation

1337LutZ
Copy link
Contributor

@1337LutZ 1337LutZ commented Dec 7, 2024

When adding this I realised that when swapping items they are never actually "unequipped" (for the sim) since we only check for the existence of spells and disable proc auras for enchants. However for actual on-use items this didn't work because the spell just exists and the Sim keeps thinking it can use it.

Also fixed that the Activate Aura APL would not trigger the actual ICD of the aura.

Update 2024/01/11

  • Changed set bonuses to be auras
  • Added aura helpers to more easily register effects to a parent Aura
  • Refactored the way a ProcMask is assigned by making it dynamic to support Item Swapping ootb
  • Added a variety of ItemSwap callbacks for all possible scenarios (atm)

@Polynomix
Copy link
Contributor

Here's some thought : trinkets can only be swapped during prepull/you need to trigger ICDs for trinkets that are procs

If you want to take a look at what i was doing : https://github.com/Polynomix/wowsims-cata/tree/itemswap. Its not so differnt from what you did. The part where i changed the Armor Spec talent is what i was last trying to fix and can be ignored. I probably wont be working on this until my PoE hype dies down.

@1337LutZ 1337LutZ marked this pull request as draft December 8, 2024 06:43
@1337LutZ
Copy link
Contributor Author

1337LutZ commented Dec 8, 2024

@Polynomix Thanks so much. I will take your ideas, esp the limitation of not being able to swap non-weapon slots during combat.

@github-actions github-actions bot added the Rogue label Dec 9, 2024
@1337LutZ
Copy link
Contributor Author

1337LutZ commented Dec 9, 2024

@Polynomix I migrated your changes into here.
Removed the weapon swap check since we can just ignore everything else when it's outside of pre-pull. That way you can still swap weapons if you want with other items in the initial prepull. And added a fix for on use trinkets not disabling active auras.

@1337LutZ 1337LutZ marked this pull request as ready for review December 10, 2024 16:34
@1337LutZ
Copy link
Contributor Author

@Polynomix @NerdEgghead I think this is ready for review 👍

sim/core/item_swaps.go Outdated Show resolved Hide resolved
sim/core/item_swaps.go Outdated Show resolved Hide resolved
sim/core/item_swaps.go Outdated Show resolved Hide resolved
@1337LutZ 1337LutZ requested a review from Polynomix December 10, 2024 21:05
@1337LutZ 1337LutZ requested a review from NerdEgghead January 12, 2025 21:56
sim/common/wotlk/enchant_effects.go Outdated Show resolved Hide resolved
sim/common/shared/shared_utils.go Outdated Show resolved Hide resolved
sim/core/attack.go Show resolved Hide resolved
sim/core/item_swaps.go Outdated Show resolved Hide resolved
sim/core/item_swaps.go Outdated Show resolved Hide resolved
sim/core/item_swaps.go Outdated Show resolved Hide resolved
sim/rogue/items.go Outdated Show resolved Hide resolved
sim/rogue/items.go Outdated Show resolved Hide resolved
sim/warlock/demonology/metamorphosis.go Outdated Show resolved Hide resolved
sim/warlock/items.go Outdated Show resolved Hide resolved
@1337LutZ 1337LutZ requested a review from NerdEgghead January 13, 2025 21:46
proto/shaman.proto Outdated Show resolved Hide resolved
sim/common/cata/enchant_effects.go Show resolved Hide resolved
sim/core/item_swaps.go Outdated Show resolved Hide resolved
sim/core/item_swaps.go Outdated Show resolved Hide resolved
sim/core/item_swaps.go Outdated Show resolved Hide resolved
sim/core/item_swaps.go Outdated Show resolved Hide resolved
sim/mage/talents_arcane.go Outdated Show resolved Hide resolved
sim/shaman/items.go Outdated Show resolved Hide resolved
ui/warlock/demonology/presets.ts Outdated Show resolved Hide resolved
@1337LutZ 1337LutZ requested a review from NerdEgghead January 14, 2025 17:30
Copy link
Contributor

@NerdEgghead NerdEgghead left a comment

Choose a reason for hiding this comment

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

Thought we'd be done for sure this time, but found another scenario that might be broken and needs investigation :(

sim/common/cata/enchant_effects.go Show resolved Hide resolved
sim/core/item_swaps.go Show resolved Hide resolved
Comment on lines +182 to +184
if !swap.ItemExistsInSwapSet(itemID, slots) {
return
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm now also questioning whether this will behave correctly as well. In the reverse scenario where you swap from a gear set with an on-use trinket to a pre-pull set without any, I think this code would allow the APL to activate the unequipped on-use trinket from the main set even after the swap, since no callback was registered for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, corect.

if !swap.CanRegisterItemCallback(itemID, slots) {
    return
}

This will check both equips, however doesn't the code only register items part of your equip regardless? 🤔 Thus making this check obsolete?

Comment on lines +286 to 288
if !swap.IsEnabled() || !swap.IsValidSwap(swapSet) {
return
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If the issue I pointed out with missing possible callbacks for unequipped items is real, then a potential solution would be

if !swap.IsValidSwap(swapSet) && isReset {
    swap.runAllCallbacks()
}

if !swap.IsEnabled() || !swap.IsValidSwap(swapSet) {
    return
}

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.

4 participants