Rework flip cards (from Kamigawa block) to robust implementation
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 940
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 160
Description
[710.](https://yawgatog.com/resources/magic-rules/#R710) [Flip Cards](https://yawgatog.com/resources/magic-rules/#flip_cards)
710.1. Flip cards have a two-part card frame on a single card. The text that appears right side up on the card defines the card's normal characteristics. Additional alternative characteristics appear upside down on the card. The back of a flip card is the normal Magic card back.
710.1a. The top half of a flip card contains the card's normal name, text box, type line, power, and toughness. The text box usually contains an ability that causes the permanent to "flip" if certain conditions are met.
710.1b. The bottom half of a flip card contains an alternative name, text box, type line, power, and toughness. These characteristics are used only if the permanent is on the battlefield and only if the permanent is flipped.
710.1c. A flip card's color and mana cost don't change if the permanent is flipped. Also, any changes to it by external effects will still apply.
710.2. In every zone other than the battlefield, and also on the battlefield before the permanent flips, a flip card has only the normal characteristics of the card. Once a permanent is flipped, its normal name, text box, type line, power, and toughness don't apply and the alternative versions of those characteristics apply instead.
Example: Akki Lavarunner is a nonlegendary creature that flips into a legendary creature named Tok-Tok, Volcano Born. An effect that says "Search your library for a legendary card" can't find this flip card. An effect that says "Legendary creatures get +2/+2" doesn't affect Akki Lavarunner, but it does affect Tok-Tok.
710.3. You must ensure that it's clear at all times whether a permanent you control is flipped or not, both when it's untapped and when it's tapped. Common methods for distinguishing between flipped and unflipped permanents include using coins or dice to mark flipped objects.
710.4. Flipping a permanent is a one-way process. Once a permanent is flipped, it's impossible for it to become unflipped. However, if a flipped permanent leaves the battlefield, it retains no memory of its status. See rule 110.5.
710.5. If an effect instructs a player to choose a card name and the player wants to choose a flip card's alternative name, the player may do so.
[Scryfall search for 20 affected cards](https://scryfall.com/search?q=o%3Aflip+b%3Achk+-o%3Acoin&unique=cards&as=grid&order=name)
Because flipped status is a physical state, it ought to be applied fundamentally in the engine, similar to transforming double faced cards. However, the current implementation applies a continuous effect to copy from a token as part of the action of flipping. This brittle implementation needs to be reworked in order to produce the right game state in edge cases.
Followup vaguely related to #14900 (two ignored tests in MutateTest)
Related bug #4061
Related GUI enhancement request #12892
Tangentially related PR #14570
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.