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

[MKM] Implement Kaya, Spirits' Justice and new zone change batch event #11753

Merged
merged 6 commits into from
Feb 22, 2024

Conversation

DominionSpy
Copy link
Contributor

@JayDi85 JayDi85 changed the title [MKM] Implement Kaya, Spirits' Justice [MKM] Implement Kaya, Spirits' Justice and new zone change batch event Feb 3, 2024
@DominionSpy DominionSpy requested a review from JayDi85 February 7, 2024 10:51
@xenohedron
Copy link
Contributor

xenohedron commented Feb 15, 2024

So what is the difference between ZONE_CHANGE_GROUP and ZONE_CHANGE_BATCH?

Code looks fine now, just want to make sure documentation is clear for future devs.

@DominionSpy
Copy link
Contributor Author

So what is the difference between ZONE_CHANGE_GROUP and ZONE_CHANGE_BATCH?

Code looks fine now, just want to make sure documentation is clear for future devs.

ZONE_CHANGE_BATCH contains all zone changes that occurred in a single action, whereas ZONE_CHANGE_GROUP only contains changes that occurred between the same two zones.

For example, paying a Craft cost by exiling a creature permanent and a card from your graveyard would fire 1 ZONE_CHANGE_BATCH event but 2 ZONE_CHANGE_GROUP events. In this instance, Kaya's ability should only trigger once.


for (UUID playerId : game.getState().getPlayersInRange(ability.getControllerId(), game)) {
Player player = game.getPlayer(playerId);
if (player == null || player == controller) {
Copy link
Contributor

Choose a reason for hiding this comment

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

compare UUID with equals rather than player objects

@JayDi85
Copy link
Member

JayDi85 commented Feb 15, 2024

ZONE_CHANGE_GROUP and related usages will be replaced by ZONE_CHANGE_BATCH in the future (group event has buggy/wrong logic and duplicate events in some use cases). Batch logic is correct.

@xenohedron xenohedron merged commit 9bad12e into magefree:master Feb 22, 2024
1 of 2 checks passed
@DominionSpy DominionSpy deleted the kaya-spirits-justice branch February 22, 2024 06:07
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