magefree / mage

Magic Another Game Engine
http://xmage.today
MIT License
1.91k stars 779 forks source link

Meld cards unsupported by blink effects? #12084

Open JayDi85 opened 7 months ago

JayDi85 commented 7 months ago

Found a strange code in [[Essence Flux]] and another few cards, search problem code by instanceof meldcard:

shot_240407_183830

Most of the exile and return effects like ExileThenReturnTargetEffect uses a simple return code (main card usage): shot_240407_183942

Need to research:

github-actions[bot] commented 7 months ago

Essence Flux - (Gatherer) (Scryfall) (EDHREC)

{U} Instant Exile target creature you control, then return that card to the battlefield under its owner's control. If it's a Spirit, put a +1/+1 counter on it.

Susucre commented 7 months ago

this seems to be part of the meld/mutate problem of having multiple card making up a single permanent? Both sides of the meld return, and each one is affected by further effect (here, each one has a +1/+1 on it if Spirit)

Susucre commented 7 months ago

11482 for reference

JayDi85 commented 7 months ago

That code needs to support that rules:

When a pair of cards are melded, the result is a single creature that's represented by two cards. If the melded creature dies, both cards are put into your graveyard. As it leaves the battlefield, both of those cards are turned face up again. If the cards are put on the top or bottom of your library, you choose their relative order. (2022-10-14)

If an effect moves a melded permanent to a new zone and then affects "that card," it affects both cards. (2022-10-14)

JayDi85 commented 7 months ago

this seems to be part of the meld/mutate problem of having multiple card

Yes, looks like it’s a part of “mutate problem” — xmage engine do not support work with multiple objects as one. So such workaround required. But it’s impossible to modify all potential effects with that code.

JayDi85 commented 4 months ago

It’s a global problem for all “move objects + do something with it” effects. Code example from starting topic is workaround to fix it. But it hard to use in every effects.

Better solution: “move to zone” method must return really moved ids, not true/false or original zone events like current code (that’s data already collected inside move code). So related effects can use it to find really moved objects.