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

[CLU] Implement Amzu, Swarm's Hunger and batches for zone change events #12686

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

Conversation

jimga150
Copy link
Contributor

Copy link
Contributor

@xenohedron xenohedron left a comment

Choose a reason for hiding this comment

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

would you be willing to rework the triggered ability to ZONE_CHANGE_BATCH?

// Fire batch event for cards moving to stack as well
ZoneChangeBatchEvent batchEvent = new ZoneChangeBatchEvent();
batchEvent.addEvent(info.event);
game.fireEvent(batchEvent);
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmmm.... why is this needed? That is, why does the ZoneChangeBatchEvent code from #11753 not cover it?

Any thoughts @JayDi85 or @DominionSpy ? It was previously stated that batch logic was correct and ZONE_CHANGE_GROUP should be deprecated in favor of ZONE_CHANGE_BATCH (see #11895 and #8009), but seems like it may have been incomplete. Is this change sufficient to cover all necessary usages?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this specific case, i found that the batch event wasn't being fired. I know there's code to collect simultaneous events and generate batch events for them, but they wouldn't apply here since things can't be cast simultaneously as far as i know.

Maybe some test cases should be written to check for batch zone change events firing 1:1 with single zone change events covering each instance of making a new zone change event? I could take a shot, but it sounds out of scope for this PR.

Copy link
Member

@JayDi85 JayDi85 Aug 23, 2024

Choose a reason for hiding this comment

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

// create a group zone change event if a card is moved to stack for casting (it's always only one card, but some effects check for group events (one or more xxx))

Need more research, I remember there were some use case with not fired batch or like that. Current code looks like a workaround, but it can be a more deep problem with firing and batching events logic (if same event can be called directly and simultaneously in diff use cases). I’ll try to research it.

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, can split this PR and implement the card without reworking the trigger to the batch event. Sorry that ended up being nontrivial.

Copy link
Member

@JayDi85 JayDi85 left a comment

Choose a reason for hiding this comment

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

Need research

// Fire batch event for cards moving to stack as well
ZoneChangeBatchEvent batchEvent = new ZoneChangeBatchEvent();
batchEvent.addEvent(info.event);
game.fireEvent(batchEvent);
Copy link
Member

@JayDi85 JayDi85 Aug 23, 2024

Choose a reason for hiding this comment

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

// create a group zone change event if a card is moved to stack for casting (it's always only one card, but some effects check for group events (one or more xxx))

Need more research, I remember there were some use case with not fired batch or like that. Current code looks like a workaround, but it can be a more deep problem with firing and batching events logic (if same event can be called directly and simultaneously in diff use cases). I’ll try to research it.

@JayDi85 JayDi85 changed the title [CLU] Implement Amzu, Swarm's Hunger [CLU] Implement Amzu, Swarm's Hunger and batches for zone change events Aug 23, 2024
@JayDi85 JayDi85 self-assigned this Aug 23, 2024
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.

3 participants