-
Notifications
You must be signed in to change notification settings - Fork 895
Rework Aetherspouts to use non-targeting permanent selection #14616
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
Merged
+119
−62
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
Mage.Tests/src/test/java/org/mage/test/cards/single/mic/AetherspoutsTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| package org.mage.test.cards.single.mic; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit, original printing m15 |
||
|
|
||
| import mage.constants.PhaseStep; | ||
| import mage.constants.Zone; | ||
| import org.junit.Test; | ||
| import org.mage.test.serverside.base.CardTestPlayerBase; | ||
|
|
||
| public class AetherspoutsTest extends CardTestPlayerBase { | ||
|
|
||
| // https://github.com/magefree/mage/issues/14351 | ||
| @Test | ||
| public void testAllToTop() { | ||
| addCard(Zone.HAND, playerB, "Aetherspouts"); | ||
| addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears"); | ||
| addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears"); | ||
| addCard(Zone.BATTLEFIELD, playerA, "Kalonian Behemoth"); | ||
| addCard(Zone.BATTLEFIELD, playerB, "Island", 5); | ||
| addCard(Zone.HAND, playerA, "Beast Attack"); | ||
| addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); | ||
|
|
||
| castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Beast Attack"); | ||
| attack(3, playerA, "Balduvian Bears", playerB); | ||
| attack(3, playerA, "Grizzly Bears", playerB); | ||
| attack(3, playerA, "Beast Token", playerB); | ||
| attack(3, playerA, "Kalonian Behemoth", playerB); | ||
| castSpell(3, PhaseStep.DECLARE_BLOCKERS, playerB, "Aetherspouts"); | ||
| setChoice(playerA, true); // yes, send Balduvian Bears to top | ||
| setChoice(playerA, true); // yes, send Grizzly Bears to top | ||
| setChoice(playerA, true); // yes, send Kalonian Behemoth to top | ||
| addTarget(playerA, "Balduvian Bears"); | ||
| addTarget(playerA, "Grizzly Bears"); | ||
|
|
||
| setStrictChooseMode(true); | ||
| setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); | ||
| execute(); | ||
|
|
||
| assertPermanentCount(playerA, "Balduvian Bears", 0); | ||
| assertPermanentCount(playerA, "Grizzly Bears", 0); | ||
| assertPermanentCount(playerA, "Kalonian Behemoth", 0); | ||
| assertPermanentCount(playerA, "Beast Token", 0); | ||
| assertLibraryCount(playerA, "Balduvian Bears", 1); | ||
| assertLibraryCount(playerA, "Grizzly Bears", 1); | ||
| assertLibraryCount(playerA, "Kalonian Behemoth", 1); | ||
| assertLibraryCount(playerA, "Beast Token", 0); | ||
| } | ||
|
|
||
| @Test | ||
| public void testSomeToBottom() { | ||
| addCard(Zone.HAND, playerB, "Aetherspouts"); | ||
| addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears"); | ||
| addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears"); | ||
| addCard(Zone.BATTLEFIELD, playerA, "Kalonian Behemoth"); | ||
| addCard(Zone.BATTLEFIELD, playerB, "Island", 5); | ||
| addCard(Zone.HAND, playerA, "Beast Attack"); | ||
| addCard(Zone.BATTLEFIELD, playerA, "Forest", 5); | ||
|
|
||
| castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Beast Attack"); | ||
| attack(3, playerA, "Balduvian Bears", playerB); | ||
| attack(3, playerA, "Grizzly Bears", playerB); | ||
| attack(3, playerA, "Beast Token", playerB); | ||
| attack(3, playerA, "Kalonian Behemoth", playerB); | ||
| castSpell(3, PhaseStep.DECLARE_BLOCKERS, playerB, "Aetherspouts"); | ||
| setChoice(playerA, true); // yes, send Balduvian Bears to top | ||
| setChoice(playerA, false); // no, send Grizzly Bears to bottom | ||
| setChoice(playerA, false); // no, send Kalonian Behemoth to bottom | ||
| addTarget(playerA, "Grizzly Bears"); | ||
|
|
||
| setStrictChooseMode(true); | ||
| setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); | ||
| execute(); | ||
|
|
||
| assertPermanentCount(playerA, "Balduvian Bears", 0); | ||
| assertPermanentCount(playerA, "Grizzly Bears", 0); | ||
| assertPermanentCount(playerA, "Kalonian Behemoth", 0); | ||
| assertPermanentCount(playerA, "Beast Token", 0); | ||
| assertLibraryCount(playerA, "Balduvian Bears", 1); | ||
| assertLibraryCount(playerA, "Grizzly Bears", 1); | ||
| assertLibraryCount(playerA, "Kalonian Behemoth", 1); | ||
| assertLibraryCount(playerA, "Beast Token", 0); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are existing
PutOnTopOrBottomLibraryTargetEffectwith support of any amount and any object type. It also support puts by owner. It's require only one thing - sorted targets list in player order (I recommend to modifyPutOnLibraryTargetEffectto support players order due paper rules anyway).So final logic for current card:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's require little modification to start cycle by getPlayersInRange, collect cards list and call choose dialog to process it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PutOnTopOrBottomLibraryTargetEffectdoesn't seem to support multiple targets in the sense the Aetherspouts needs, because it only prompts the player once. Aetherspouts needs to prompt each player for each card where they want it to go.We could use
PutOnLibraryTargetEffect, but it barely saves us any code, as most of the logic here is looping to split the cards into one list for the top and one list for the bottom, andPutOnLibraryTargetEffectonly supports sending all cards to top or all cards to bottom.