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

Primal Clay (and the like) need a rework #9444

Open
Alex-Vasile opened this issue Aug 31, 2022 · 4 comments
Open

Primal Clay (and the like) need a rework #9444

Alex-Vasile opened this issue Aug 31, 2022 · 4 comments
Labels
bug Bugs and errors refactoring Developers topics about code and programming

Comments

@Alex-Vasile
Copy link
Contributor

[[Primal Clay]]

See discussion here for starting point.

There are a few issues:

  1. The power toughness values that are picked as it ETBs are only valid on the battlefield it becomes as 0/0 elsewhere. While on the battlefield it is considered as having those values printed on the card for copy effects. Getting this to work properly may require (another) change to how power and toughness are stored. The picked values cannot be stored as the "modified base value" since that will not interact well with effects which further change the base values (e.g. [[Biomass Mutation]]) since the information of what it should be reset to after Biomass Mutation ends will be lost.
  2. Same issues with the ability it gains. That ability should be gained by anything that copies it, but this is not consistent.
@github-actions
Copy link

Primal Clay - (Gatherer) (Scryfall) (EDHREC)

{4}
Artifact Creature — Shapeshifter
/
As Primal Clay enters the battlefield, it becomes your choice of a 3/3 artifact creature, a 2/2 artifact creature with flying, or a 1/6 Wall artifact creature with defender in addition to its other types. (A creature with defender can't attack.)

Biomass Mutation - (Gatherer) (Scryfall) (EDHREC)

{X}{G/U}{G/U}
Instant
Creatures you control have base power and toughness X/X until end of turn.

@Alex-Vasile Alex-Vasile added bug Bugs and errors refactoring Developers topics about code and programming labels Aug 31, 2022
@awjackson
Copy link
Contributor

The layer system as implemented in xmage can't really handle copiable characteristics of a permanent that are acquired from effects. They are instead handled as three special cases: copies of copies, copies of transformed DFCs, and copies of face-down permanents. I think we need to bite the bullet and add a fourth special case for Primal Clay and friends (which means encapsulating all cards with this kind of ability into a common Ability class that the special case code can search for). I think we would also like to refactor copying itself, because there are currently at least three completely separate implementations--one that uses Game.copyPermanent, one that uses CopyTokenFunction, and a third ad-hoc one in Metamorphic Alteration.

Note that having a permanent that's already on the battlefield become a copy of a Primal Clay works differently from having a permanent enter the battlefield as a copy of a Primal Clay, and it's only the former case that needs special handling. For example, if a Clone ETBs as a copy of a Primal Clay that was chosen to be 2/2 flying, you get to choose a new size for the Clone as per the Clay's ETB ability. If you choose 3/3 or 1/6, the Clone will not have the flying ability of the original Primal Clay. I imagine we'll need a boolean argument to the new encapsulated copy function that indicates whether we're having a new permanent enter as a copy or we're transforming an existing permanent into a copy.

@xenohedron
Copy link
Contributor

xenohedron commented Jul 23, 2023

Other potential issues:

  1. If the permanent leaves the battlefield, the effects must end.
  2. The effects should apply in layer 7b [Edit: layer 1a], not 7a as currently implemented, by my interpretation of 604.3a:

604.3a. A static ability is a characteristic-defining ability if it meets the following criteria: (1) It defines an object's colors, subtypes, power, or toughness; (2) it is printed on the card it affects, it was granted to the token it affects by the effect that created the token, or it was acquired by the object it affects as the result of a copy effect or text-changing effect; (3) it does not directly affect the characteristics of any other objects; (4) it is not an ability that an object grants to itself; and (5) it does not set the values of such characteristics only if certain conditions are met.

Affected cards:

  • Primal Clay
  • [[Primal Plasma]]
  • [[Molten Sentry]]
  • [[Aquamorph Entity]]

There's also this interesting ruling:

If an object enters the battlefield as a copy of Primal Plasma, it copies the values determined by its enters-the-battlefield replacement effect, but its power and toughness are determined by the copy’s own enters-the-battlefield replacement effect. This can cause you to have a 3/3 creature with flying, or a 1/6 creature with flying and defender, for example. (2021-03-19)

@github-actions
Copy link

Primal Plasma - (Gatherer) (Scryfall) (EDHREC)

{3}{U}
Creature — Elemental Shapeshifter
/
As Primal Plasma enters the battlefield, it becomes your choice of a 3/3 creature, a 2/2 creature with flying, or a 1/6 creature with defender.

Molten Sentry - (Gatherer) (Scryfall) (EDHREC)

{3}{R}
Creature — Elemental
/
As Molten Sentry enters the battlefield, flip a coin. If the coin comes up heads, Molten Sentry enters the battlefield as a 5/2 creature with haste. If it comes up tails, Molten Sentry enters the battlefield as a 2/5 creature with defender.

Aquamorph Entity - (Gatherer) (Scryfall) (EDHREC)

{2}{U}{U}
Creature — Shapeshifter
/
As Aquamorph Entity enters the battlefield or is turned face up, it becomes your choice of 5/1 or 1/5.
Morph {2}{U} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and errors refactoring Developers topics about code and programming
Projects
None yet
Development

No branches or pull requests

3 participants