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

new feature: Emblem Cards #10498

Merged
merged 21 commits into from
Sep 27, 2023
Merged

Conversation

artemiswkearney
Copy link
Contributor

Allows match/tournament creator to specify cards to give each player emblem versions of (or just the starting player for symmetric effects).

Technical details:

  • new UI for specifying emblem cards (.dck files)
    • available for all match/tournament types
  • new class EmblemOfCard
  • new method copyWithZone on AbilityImpl (used to make abilities work from command zone)
  • new fields on GameOptions and MatchOptions for emblem cards
  • emblems are granted after mulligans, before first turn (technically after Planechase starting plane creation)
  • EC indicator in table info, with explanation in the tooltip alongside all the other explanations

I've tested this with the most perverse cards I could think of, and it never crashed the server and usually did something reasonable. (Since the emblems aren't permanents, anything that retrieves the permanent for its source and null checks it will usually do nothing.)
List of cards tested during development:

  • [[Omniscience]], [[Griselbrand]], [[Paradox Engine]], [[Yurlok of Scorch Thrash]], [[Doubling Season]] (all do what you'd hope; Yurlok's tap ability can't be activated)
  • [[Key to the Archive]] (doesn't ETB, no effect)
  • [[Animar, Soul of Elements]] (triggers but no counters or cost reduction)
  • [[Wizard Class]] (no max hand size, can't be leveled up)
  • [[Mogg Fanatic]] (can't be activated)
  • [[Bonesplitter]] (can be activated to target a creature you control, but doesn't do anything)
  • [[Experiment Kraj]] (no effect)
  • [[Emblem of the Warmind]] (grants haste, no effect from enchant creature you control)
  • [[Essence of the Wild]] (no effect)
  • [[Gond Gate]] (no effect, likely due to code that makes sure it isn't untapping itself; I consider this less than ideal but out of scope for the moment, as who knows how many cards do something similar)

Allows match/tournament creator to specify cards to give each player
emblem versions of (or just the starting player for symmetric effects).

Technical details:
- new UI for specifying emblem cards (.dck files)
  - available for all match/tournament types
- new class `EmblemOfCard`
- new method `copyWithZone` on `AbilityImpl` (used to make abilities
  work from command zone)
- new fields on `GameOptions` and `MatchOptions` for emblem cards
- emblems are granted after mulligans, before first turn (technically
  after Planechase starting plane creation)
@xenohedron
Copy link
Contributor

@artemiswkearney are you willing to implement the new custom dialog as described in #10551 as part of this enhancement? Or do you think a different strategy could be better?

@artemiswkearney
Copy link
Contributor Author

artemiswkearney commented Jul 7, 2023 via email

@xenohedron
Copy link
Contributor

Alright. @JayDi85 do you think this PR is good to merge as is?

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

Omniscience - (Gatherer) (Scryfall) (EDHREC)

{7}{U}{U}{U}
Enchantment
You may cast spells from your hand without paying their mana costs.

Griselbrand - (Gatherer) (Scryfall) (EDHREC)

{4}{B}{B}{B}{B}
Legendary Creature — Demon
7/7
Flying, lifelink
Pay 7 life: Draw seven cards.

Paradox Engine - (Gatherer) (Scryfall) (EDHREC)

{5}
Legendary Artifact
Whenever you cast a spell, untap all nonland permanents you control.

Yurlok of Scorch Thrash - (Gatherer) (Scryfall) (EDHREC)

{1}{B}{R}{G}
Legendary Creature — Viashino Shaman
4/4
Vigilance
A player losing unspent mana causes that player to lose that much life.
{1}, {T}: Each player adds {B}{R}{G}.

Doubling Season - (Gatherer) (Scryfall) (EDHREC)

{4}{G}
Enchantment
If an effect would create one or more tokens under your control, it creates twice that many of those tokens instead.
If an effect would put one or more counters on a permanent you control, it puts twice that many of those counters on that permanent instead.

Key to the Archive - (Gatherer) (Scryfall) (EDHREC)

{4}
Artifact
Key to the Archive enters the battlefield tapped.
When Key to the Archive enters the battlefield, draft a card from Key to the Archive's spellbook, then discard a card.
{T}: Add two mana in any combination of colors.

Animar, Soul of Elements - (Gatherer) (Scryfall) (EDHREC)

{G}{U}{R}
Legendary Creature — Elemental
1/1
Protection from white and from black
Whenever you cast a creature spell, put a +1/+1 counter on Animar, Soul of Elements.
Creature spells you cast cost {1} less to cast for each +1/+1 counter on Animar.

Wizard Class - (Gatherer) (Scryfall) (EDHREC)

{U}
Enchantment — Class
(Gain the next level as a sorcery to add its ability.)
You have no maximum hand size.
{2}{U}: Level 2
When this Class becomes level 2, draw two cards.
{4}{U}: Level 3
Whenever you draw a card, put a +1/+1 counter on target creature you control.

Mogg Fanatic - (Gatherer) (Scryfall) (EDHREC)

{R}
Creature — Goblin
1/1
Sacrifice Mogg Fanatic: It deals 1 damage to any target.

Bonesplitter - (Gatherer) (Scryfall) (EDHREC)

{1}
Artifact — Equipment
Equipped creature gets +2/+0.
Equip {1}

Experiment Kraj - (Gatherer) (Scryfall) (EDHREC)

{2}{G}{G}{U}{U}
Legendary Creature — Ooze Mutant
4/6
Experiment Kraj has all activated abilities of each other creature with a +1/+1 counter on it.
{T}: Put a +1/+1 counter on target creature.

Emblem of the Warmind - (Gatherer) (Scryfall) (EDHREC)

{1}{R}
Enchantment — Aura
Enchant creature you control
Creatures you control have haste.

Essence of the Wild - (Gatherer) (Scryfall) (EDHREC)

{3}{G}{G}{G}
Creature — Avatar
6/6
Creatures you control enter the battlefield as a copy of Essence of the Wild.

Gond Gate - (Gatherer) (Scryfall) (EDHREC)

Land — Gate
Gates you control enter the battlefield untapped.
{T}: Add {C}.
{T}: Add one mana of any color that a Gate you control could produce.

@JayDi85
Copy link
Member

JayDi85 commented Jul 7, 2023

What's the purpose of that feature (emblem cards)? Are there plans to use it in other features or game modes? It's looks like Momir game mode but with any possible cards in command zone.

@JayDi85 JayDi85 added the GUI label Jul 7, 2023
@JayDi85 JayDi85 self-assigned this Jul 7, 2023
@artemiswkearney
Copy link
Contributor Author

It's designed to be open-ended. The inspiration was the events Arena runs with custom emblems (including Omniscience draft), but it can also be used to enable mana burn ([[Yurlok of Scorch Thrash]] emblem) for historically accurate drafts of older sets. I have no idea what else the XDHS community will come up with using it, but I bet it'll be cool.

@github-actions
Copy link

github-actions bot commented Jul 8, 2023

Yurlok of Scorch Thrash - (Gatherer) (Scryfall) (EDHREC)

{1}{B}{R}{G}
Legendary Creature — Viashino Shaman
4/4
Vigilance
A player losing unspent mana causes that player to lose that much life.
{1}, {T}: Each player adds {B}{R}{G}.

@alexander-novo
Copy link
Contributor

alexander-novo commented Jul 8, 2023

So I know that yurlok has been brought up before as an example of adding mana burn, but some of these Arena events have had activatable emblems before. Does it not make sense to keep the activated abilities of these emblems as they are? There is precedent for activatable "emblems" in the system with the planes.

@artemiswkearney
Copy link
Contributor Author

artemiswkearney commented Jul 8, 2023 via email

@alexander-novo
Copy link
Contributor

Oh I see, the {T} cost makes sense.

@artemiswkearney
Copy link
Contributor Author

Updated to use the new Custom Options dialog (which also means no more duplicated code for emblem cards across table/tournament dialogs!)

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.

It's can be useful feature and can be approved after some fixes and improves:

  1. User's notification about that feature;
  2. More stable implementation (if possible), see comment about commander and source object;
  3. Needs some unit tests for that feature. Test framework doesn't support direct emblems usage like addPlane, so it must be added -- I'll add it later in the master.

@artemiswkearney
Copy link
Contributor Author

Any other issues, or is this ready for merge? (I'd like to do some other UI work like removing the broken "Seats" option in tournament creation and adding mnemonics to various parts of the UI, but merge conflicts in forms are hell so I'm holding off for now.)

@artemiswkearney
Copy link
Contributor Author

(I'd be happy to try writing some unit tests, if you can point me to documentation about how things are tested, or at least some existing integration tests for other table/tournament options)

ssk97 added a commit to ssk97/mage that referenced this pull request Aug 23, 2023
@xenohedron
Copy link
Contributor

I'd like this to get merged soon. There are other UI improvements to be made and they kinda have to be done sequentially to avoid merge conflicts in the form files. It seems that all the requested improvements have been made aside from unit tests for the new functionality, and without a test framework it's unclear to me what the expectation is there.

@artemiswkearney
Copy link
Contributor Author

Any objections to xenohedron merging this?

@Susucre Susucre mentioned this pull request Sep 16, 2023
@Susucre
Copy link
Contributor

Susucre commented Sep 16, 2023

@JayDi85 was #11164 what you had in mind for

Needs some unit tests for that feature. Test framework doesn't support direct emblems usage like addPlane, so it must be added -- I'll add it later in the master.

With that, it is possible to add a few tests on the EmblemCard from this PR.

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.

Test framework updated in a3f787b to provide addEmblem method for unit tests- should allow you to make a unit test that adds EmblemOfCard to confirm functionality in a test game.

@artemiswkearney
Copy link
Contributor Author

Okay, good thing you had me test - turns out Ability.copy() doesn't actually "return a fresh copy" as the documentation suggests for some niche abilities like flying, and copyWithZone was changing those abilities' zones globally.

@artemiswkearney
Copy link
Contributor Author

artemiswkearney commented Sep 20, 2023

Anyway, added some tests for all the emblem cards mentioned in the original post that should do things. Let me know if you want anything else tested. (I don't really want tests saying "this should do nothing relevant", especially for cards like Gond Gate that might someday work properly as emblems, but I'm happy to test that emblems of certain cards don't break specific other things, whether in the same test or globally as with the previous bug.)

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.

I believe all feedback is addressed now that the unit tests are present. I will merge this next week unless any further issues can be found in the meantime.

@xenohedron xenohedron merged commit 41874b0 into magefree:master Sep 27, 2023
2 checks passed
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.

None yet

5 participants