mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Added a corrected condition for Return to Dust to account for card ruling on copies.
This commit is contained in:
parent
9fbdede64b
commit
1a205eb146
1 changed files with 22 additions and 3 deletions
|
|
@ -14,8 +14,9 @@ import mage.players.Player;
|
|||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.condition.common.ControllerMainPhaseCondition;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
/**
|
||||
* @author emerald000
|
||||
|
|
@ -28,8 +29,8 @@ public final class ReturnToDust extends CardImpl {
|
|||
// Exile target artifact or enchantment
|
||||
this.getSpellAbility().addEffect(new ReturnToDustExileEffect());
|
||||
// If you cast this spell during your main phase, you may exile up to one other target artifact or enchantment
|
||||
ConditionalOneShotEffect returnToDustConditionalExileEffect =
|
||||
new ConditionalOneShotEffect(new ReturnToDustConditionalExileEffect(), ControllerMainPhaseCondition.instance);
|
||||
ConditionalOneShotEffect returnToDustConditionalExileEffect
|
||||
= new ConditionalOneShotEffect(new ReturnToDustConditionalExileEffect(), ReturnToDustCondition.instance);
|
||||
returnToDustConditionalExileEffect.setText("If you cast this spell during your main phase, you may exile up to one other target artifact or enchantment");
|
||||
this.getSpellAbility().addEffect(returnToDustConditionalExileEffect);
|
||||
this.getSpellAbility().addTarget(new TargetPermanent(1, 2, StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT));
|
||||
|
|
@ -112,3 +113,21 @@ class ReturnToDustConditionalExileEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
enum ReturnToDustCondition implements Condition {
|
||||
|
||||
/*If a spell or ability copies Return to Dust, the copy exiles
|
||||
only the first target artifact or enchantment.
|
||||
This is because the copy wasn't cast at all. (2021-03-19)
|
||||
*/
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Spell spell = game.getSpell(source.getSourceId());
|
||||
return (game.isActivePlayer(source.getControllerId())
|
||||
&& game.getTurnPhaseType().isMain())
|
||||
&& spell != null
|
||||
&& !spell.isCopy();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue