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

Check if source object is still the same as an ability was put on the stack. #4893

Open
LevelX2 opened this issue May 2, 2018 · 7 comments
Assignees
Labels
bug Bugs and errors refactoring Developers topics about code and programming

Comments

@LevelX2
Copy link
Contributor

LevelX2 commented May 2, 2018

I recently fixed a bug of Wall of Deceit. The "Turn face down" ability did not work.

In the fix I added some logic to prevent, that the effect works, if the Wall was Blinked (e.g. with Momentary Blink) between adding the ability to stack and the resolving of the ability.
I guess that way to handle it is correct, if the ability on the stack is related to a previous permanent onto the battlefield.

Also some confirmation for that rule interpretation from rule gurus is appreciated. I 'm pretty sure the ability on the stack does simply nothing (even not fizzle because targets are not involved), if the object the ability was created from is no longer on the battlefield.

But by checking it this way, I realized that there are a ton of abilities related to source (without using a target) that probably need a similar handling.

Take as an example Drudge Sentinel. It has the following ability:
// {3}: Tap Drudge Sentinel. It gains indestructible until end of turn.
If you activate its Tap/get indestructible ability and the Sentinel was blinked before resolution of the ability. The ability should do nothing but currently it resolves and taps the Sentinel and adds indestructible to it.

Am I right, that this kind of abilities are not handled correctly currently?

@LevelX2 LevelX2 added bug Bugs and errors refactoring Developers topics about code and programming labels May 2, 2018
@GitHubMage
Copy link
Contributor

Each time a permanent enters the battlefield it is assigned a unique id. Spells and abilities target permanents via this id and therefor fizzle if the permanent is blinked.
Unfortunately I am not very familiar with the code base, but i would have suspected the program to track its current permanents via ids already. Thus allowing it to detect the availability of targets upon resolution.
Isn't this the case?

@JayDi85
Copy link
Member

JayDi85 commented May 2, 2018

Blink (zone change) will cause NEW and clean permanent to enter battlefield. The old one target will be illegal and spell resolves with nothing. The new permanent must be clear from all added effects/abilities and must have new ID.

https://mtg.gamepedia.com/Flicker

When you "flicker" a permanent, it's treated as a new card that just entered the battlefield. The mechanic appears primary on white and blue, tertiary on black and also on artifacts. "Flickering" removes all counters and auras from a creature, and makes it dodge targeted removal if a spell "flickering" that creature is played in response to the removal spell targeting it.[6]

@LevelX2
Copy link
Contributor Author

LevelX2 commented May 2, 2018

I'm not talking about targeted abilties. Target handling does handle this correctly (at least if TargetHandler are used).

I'm talking about effects that are named xxxSourceEffect.java.
TapSourceEffect, ReturnToHandSourceEffect etc..

We have to check for this effects if the related source is the same like done in the Wall of Deceit effect.

@Plopman
Copy link
Contributor

Plopman commented May 2, 2018

You have to check if the permanent didn't blink like you did for Wall of Deceit for all xxxSourceEffect.
We should use MageObjectReference instead of UUID for those ability.
We had similar issue with ContinuousEffect #434

@theelk801
Copy link
Contributor

This is something that's been changed in some places (like The Scarab God death trigger) but clearly not everywhere. There's definitely a framework in place for it, since you can get the zone change counter from the source, so it's just a matter of making sure it's always done.

LevelX2 added a commit that referenced this issue May 2, 2018
@JayDi85
Copy link
Member

JayDi85 commented May 3, 2018

I'm consulted with mtg judges and they confirmed -- "source effects" without targets like Drudge Sentinel resolves on stack without real effects (e.g. the new blinked card will be new for mtg rule engine and stack process).

@Zerrisx
Copy link

Zerrisx commented Jul 7, 2020

This is still bugged, for sure. Cloudshifting a Drudge Sentinel with an activation on the stack causes it to return and gain indestructible.

@xenohedron xenohedron self-assigned this Sep 1, 2023
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

7 participants