From 549103a2f02eb2707aa935066c26a602e9a1cc84 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 2 Oct 2017 16:32:36 -0400 Subject: [PATCH] some more changes to CDA effects, tested and working correctly --- Mage.Sets/src/mage/cards/a/ApocalypseDemon.java | 14 +++++++------- Mage/src/main/java/mage/MageObject.java | 5 +---- Mage/src/main/java/mage/MageObjectImpl.java | 1 + .../main/java/mage/designations/Designation.java | 3 +++ .../src/main/java/mage/game/command/Commander.java | 3 +++ .../main/java/mage/game/stack/StackObjImpl.java | 3 +++ .../src/main/java/mage/game/stack/StackObject.java | 2 +- 7 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/ApocalypseDemon.java b/Mage.Sets/src/mage/cards/a/ApocalypseDemon.java index d0c539f2fd..085df8bada 100644 --- a/Mage.Sets/src/mage/cards/a/ApocalypseDemon.java +++ b/Mage.Sets/src/mage/cards/a/ApocalypseDemon.java @@ -17,11 +17,11 @@ import mage.filter.predicate.permanent.AnotherPredicate; import mage.target.common.TargetControlledPermanent; public class ApocalypseDemon extends CardImpl { - + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("nother creature"); - - static { - filter.add(new CardTypePredicate(CardType.CREATURE)); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new AnotherPredicate()); } @@ -37,10 +37,10 @@ public class ApocalypseDemon extends CardImpl { // At the beginning of your upkeep, tap Apocalypse Demon unless you sacrifice another creature. TapSourceUnlessPaysEffect tapEffect = new TapSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(filter))); - tapEffect.setText("At the beginning of your upkeep, tap Apocalypse Demon unless you sacrifice another creature."); + tapEffect.setText("tap {this} unless you sacrifice another creature."); this.addAbility(new BeginningOfUpkeepTriggeredAbility(tapEffect, TargetController.YOU, false)); - } - + } + public ApocalypseDemon(final ApocalypseDemon apocalypseDemon) { super(apocalypseDemon); } diff --git a/Mage/src/main/java/mage/MageObject.java b/Mage/src/main/java/mage/MageObject.java index 9982250353..567b0dca0e 100644 --- a/Mage/src/main/java/mage/MageObject.java +++ b/Mage/src/main/java/mage/MageObject.java @@ -17,11 +17,8 @@ import mage.util.SubTypeList; import java.io.Serializable; import java.util.EnumSet; -import java.util.Iterator; import java.util.List; import java.util.UUID; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; public interface MageObject extends MageItem, Serializable { @@ -201,7 +198,7 @@ public interface MageObject extends MageItem, Serializable { TextPart addTextPart(TextPart textPart); - public void removePTCDA(); + void removePTCDA(); default void changeSubType(SubType fromSubType, SubType toSubType) { diff --git a/Mage/src/main/java/mage/MageObjectImpl.java b/Mage/src/main/java/mage/MageObjectImpl.java index 44f5f42feb..879bb06b58 100644 --- a/Mage/src/main/java/mage/MageObjectImpl.java +++ b/Mage/src/main/java/mage/MageObjectImpl.java @@ -342,6 +342,7 @@ public abstract class MageObjectImpl implements MageObject { } } + @Override public void removePTCDA() { for (Iterator iter = this.getAbilities().iterator(); iter.hasNext();) { Ability ability = iter.next(); diff --git a/Mage/src/main/java/mage/designations/Designation.java b/Mage/src/main/java/mage/designations/Designation.java index e1ba4ab45a..7d3d842a9c 100644 --- a/Mage/src/main/java/mage/designations/Designation.java +++ b/Mage/src/main/java/mage/designations/Designation.java @@ -215,4 +215,7 @@ public abstract class Designation implements MageObject { throw new UnsupportedOperationException("Unsupported operation"); } + @Override + public void removePTCDA() { + } } diff --git a/Mage/src/main/java/mage/game/command/Commander.java b/Mage/src/main/java/mage/game/command/Commander.java index b0ee9693df..7d7e0c9c6d 100644 --- a/Mage/src/main/java/mage/game/command/Commander.java +++ b/Mage/src/main/java/mage/game/command/Commander.java @@ -249,4 +249,7 @@ public class Commander implements CommandObject { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } + @Override + public void removePTCDA() { + } } diff --git a/Mage/src/main/java/mage/game/stack/StackObjImpl.java b/Mage/src/main/java/mage/game/stack/StackObjImpl.java index 4f21e40ce1..25a3088eab 100644 --- a/Mage/src/main/java/mage/game/stack/StackObjImpl.java +++ b/Mage/src/main/java/mage/game/stack/StackObjImpl.java @@ -268,4 +268,7 @@ public abstract class StackObjImpl implements StackObject { return name; } + @Override + public void removePTCDA() { + } } diff --git a/Mage/src/main/java/mage/game/stack/StackObject.java b/Mage/src/main/java/mage/game/stack/StackObject.java index b90d5a7a2f..7268f9ab03 100644 --- a/Mage/src/main/java/mage/game/stack/StackObject.java +++ b/Mage/src/main/java/mage/game/stack/StackObject.java @@ -50,7 +50,7 @@ public interface StackObject extends MageObject, Controllable { // int getConvertedManaCost(); boolean chooseNewTargets(Game game, UUID playerId, boolean forceChange, boolean onlyOneTarget, FilterPermanent filterNewTarget); - + StackObject createCopyOnStack(Game game, Ability source, UUID newControllerId, boolean chooseNewTargets); @Override