-
Notifications
You must be signed in to change notification settings - Fork 745
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
Rework more Prevention Effects involving counters. Add [PIP] Bloatfly Swarm #12205
Conversation
Mage/src/main/java/mage/abilities/effects/PreventDamageAndRemoveCountersEffect.java
Show resolved
Hide resolved
Mage/src/main/java/mage/abilities/dynamicvalue/common/SavedCounterRemovedValue.java
Outdated
Show resolved
Hide resolved
Mage/src/main/java/mage/abilities/dynamicvalue/common/SavedCounterRemovedValue.java
Outdated
Show resolved
Hide resolved
Mage/src/main/java/mage/abilities/effects/PreventDamageAndRemoveCountersEffect.java
Show resolved
Hide resolved
Apart for the line break, everything has been addressed. |
Perhaps @JayDi85 has a better idea for [[Magma Pummeler]]? Everything else in this PR looks good. |
Magma Pummeler - (Gatherer) (Scryfall) (EDHREC)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, forget to publish review. See detailed comment about SubAbilities - it can’t be used such way and must be reworked to game state values.
Mage/src/main/java/mage/abilities/dynamicvalue/common/SavedCounterRemovedValue.java
Show resolved
Hide resolved
Mage/src/main/java/mage/abilities/effects/PreventDamageAndRemoveCountersEffect.java
Show resolved
Hide resolved
I gave Magma Pummeler another look, using a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new technique for Magma Pummeler.
this.fireEvent(GameEvent.getEvent(GameEvent.EventType.OPTION_USED, source.getOriginalId(), source, source.getControllerId())); | ||
GameEvent event = GameEvent.getEvent(GameEvent.EventType.OPTION_USED, source.getOriginalId(), source, source.getControllerId()); | ||
if (fireAsSimultaneousEvent) { | ||
this.getState().addSimultaneousEvent(event, this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smells bed. Reflexive trigger fires immediately due rules. Why you need to change it to simulate normal trigger?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
603.12a Normally, if the trigger event or events occur multiple times during the resolution of the spell or ability that created it, the reflexive triggered ability will trigger once for each of those times. However, if a resolving spell or ability includes a choice to pay a cost “any number of times” and creates a triggered ability that triggers “when [a player] pays [that cost] one or more times,” paying that cost one or more times causes the reflexive triggered ability to trigger only once.
OPTION_USED need to execute it immediately.
If your use case generates multiple reflexive triggers then must execute only once (see rules above). So that’s looks like a game engine bug and simultaneous event must be used in all reflexive triggers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must be a workable test (it’s not covered by swarm tests):
If an amount of damage would be dealt to Magma Pummeler greater than the number of +1/+1 counters on it, all of that damage is prevented, and all of those counters are removed. In most cases, this will result in Magma Pummeler having 0 toughness, so it will be put into its owner's graveyard. Its reflexive triggered ability still triggers and it will still deal that much damage to any target.
(2021-11-19)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smells bed. Reflexive trigger fires immediately due rules. Why you need to change it to simulate normal trigger?
It's still a reflexive trigger and it is fired at the appropriate time. Simultaneous event used for batching. There is no batch for replacement events, so this is necessary for Magma Pummeler to function correctly (it must only fire after all simultaneous replacements have been processed).
(Whether all reflexive triggers should fire as simultaneous events is a separate question but a larger scope than this PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway magma die use case must be covered by test (see above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, added 2 tests, dealing more than the amount of removed counters was never the issue there.
And xeno's answer is on point, the reflexive is created with first replacement effect, but there might be more simultaneous ones waiting, and we can't fire the event triggering the reflexive effect until all are done. Using the simultaneousEvent queue does delay the firing trigger until after all replacement are done.
A full rework of prevention effect could in theory wait for them all before firing resulting reflexive trigger, but that's huge amount of work, and probably not worth it for the single Pummeler card. The ad hoc solution here works.
So this PR started simply on implementing [PIP] Bloatfly Swarm
But I did realize quickly the previous work on Phantom creatures needed to be combined with some others replacement effect. So here is the rework, with the card on top.