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

Fix HideawayPlayEffect to allow you to attempt to play everything #13009

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

Conversation

Grath
Copy link
Contributor

@Grath Grath commented Oct 18, 2024

Per rule 607.3, if you copy the Hideaway effect, the linked ability (HideawayPlayEffect in XMage) can attempt to cast all of the exiled cards as "you may play the exiled card" refers to each card exiled by Hideaway abilities of that permanent.

This allows users to (attempt to) play all of the cards, and they choose which order in which to attempt to play them.

if (!controller.playCard(card, game, true, new ApprovingObject(source, game))) {
if (card.getZoneChangeCounter(game) == zcc) {
card.setFaceDown(true, game);
if (!controller.chooseUse(Outcome.PlayForFree, "Play " + card.getIdName() + " for free?", source, game)) {
Copy link
Member

Choose a reason for hiding this comment

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

  1. You can filter compatible cards before any choices (e.g. remove bad lands from a playable list);
  2. No needs in yes/no dialogs cause user already choose cards to cast (also chosen targets returned in chosen order);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Is there a good way to make it do "you can target any number of nonlands but only up to the number of lands you can still play this turn"? I'm open to doing that if there's an easy way to do that but otherwise, seems simpler to let them target each thing and then just not attempt to play extra lands.
  2. I copied this flow from [[Arcane Bombardment]], should I also make that try to cast everything that the player targeted rather than target and then prompt? (And yes, the chosen order of targets is precisely why I made this use targeting rather than just iterating through the Set returned by zone.getCards(game) because we need to allow players to choose the order in which the cards are played.)
  3. Bonus question: Should I add support for [[Evercoat Ursine]] (I'm thinking an optional boolean parameter 'playOne' which sets the max targets to 1 on the TargetCard, since Evercoat Ursine's hideaway play effect was made knowing that you would hideaway multiple times) while I'm refactoring this ability anyways?

Copy link
Member

@JayDi85 JayDi85 Oct 18, 2024

Choose a reason for hiding this comment

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

  1. Is there a good way to make it do "you can target any number of nonlands but only up to the number of lands you can still play this turn"?

Nope, you can't find precise amount before cast. Some effects can allow to play additional lands and add some restrictions. Hmm. I see. You can't filter non playable lands before choice cause some of the choice can allow to play next land and vice versa.

  1. I copied this flow from [[Arcane Bombardment]]

If it depends on choice order. If it like hideaway code then yes -- it must use be used same way (allow to choose all and filter non-playable before cast)

  1. 'playOne' which sets the max targets to 1 on the TargetCard

Yes, it's fine -- if it allow to play only one card from a list then allow to choose only one. If player select non playable card/land then it's a problem of the player (it's optional effect).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Updated the existing tests, wrote new tests for 607.3 playing multiple cards in chosen order and playing one or more lands. Updated Arcane Bombardment to not ask if you want to play the cards you already chose you want to play. Also added the optional boolean for Evercoat Ursine support in the future ("if there are cards exiled with it, you may play one of them without paying its mana cost.")

…play the cards you chose.

Update tests, add tests for
- Select the order in which to play cards
- Attempt to play two lands with only one land drop available, only the first land enters play
- Play two lands with extra land drops available.
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