From a92e6591fc6378bb310b26bc4fe59e4cb10937f1 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 23 Mar 2013 16:43:52 +0100 Subject: [PATCH] Implemented optional execution for some replacement effects. --- Mage.Sets/src/mage/sets/innistrad/EvilTwin.java | 3 ++- Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java | 3 ++- .../src/mage/sets/newphyrexia/PhyrexianMetamorph.java | 6 +++++- .../mage/sets/planechase2012/SakashimasStudent.java | 10 +++++----- Mage.Sets/src/mage/sets/tenth/Clone.java | 5 ++++- Mage.Sets/src/mage/sets/tenth/SculptingSteel.java | 5 ++++- Mage.Sets/src/mage/sets/timespiral/Vesuva.java | 5 ++++- .../src/mage/sets/worldwake/JwariShapeshifter.java | 9 +++++++-- 8 files changed, 33 insertions(+), 13 deletions(-) diff --git a/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java b/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java index 743f8740c8d..ef626d119c8 100644 --- a/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java +++ b/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java @@ -71,7 +71,8 @@ public class EvilTwin extends CardImpl { this.addAbility(new SimpleStaticAbility( Zone.BATTLEFIELD, new EntersBattlefieldEffect(new CopyPermanentEffect(new EvilTwinApplyToPermanent()), - "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature\""))); + "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature\"", + true))); } public EvilTwin(final EvilTwin card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java b/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java index 6058c8ae476..332a23446e4 100644 --- a/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java +++ b/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java @@ -65,7 +65,8 @@ public class PhantasmalImage extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new PhantasmalImageCopyEffect(), abilityText)); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( + new PhantasmalImageCopyEffect(), abilityText, true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java index 929c73c2f91..3bb96fe5767 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java @@ -62,7 +62,11 @@ public class PhyrexianMetamorph extends CardImpl { this.color.setBlue(true); this.power = new MageInt(0); this.toughness = new MageInt(0); - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new PhyrexianMetamorphEffect(), "You may have {this} enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types")); + + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( + new PhyrexianMetamorphEffect(), + "You may have {this} enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types", + true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java b/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java index fa7104defd0..984394eef5d 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java +++ b/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java @@ -28,9 +28,9 @@ package mage.sets.planechase2012; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -61,10 +61,10 @@ public class SakashimasStudent extends CardImpl { // Ninjutsu {1}{U} this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{U}"))); // You may have Sakashima's Student enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. - this.addAbility(new SimpleStaticAbility( - Constants.Zone.BATTLEFIELD, - new EntersBattlefieldEffect(new CopyPermanentEffect(new SakashimasStudentApplyToPermanent()), - "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,new EntersBattlefieldEffect( + new CopyPermanentEffect(new SakashimasStudentApplyToPermanent()), + "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types", + true))); } diff --git a/Mage.Sets/src/mage/sets/tenth/Clone.java b/Mage.Sets/src/mage/sets/tenth/Clone.java index 3107d0d7f59..3b130f692ca 100644 --- a/Mage.Sets/src/mage/sets/tenth/Clone.java +++ b/Mage.Sets/src/mage/sets/tenth/Clone.java @@ -53,7 +53,10 @@ public class Clone extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new CopyPermanentEffect(), "You may have {this} enter the battlefield as a copy of any creature on the battlefield")); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( + new CopyPermanentEffect(), + "You may have {this} enter the battlefield as a copy of any creature on the battlefield", + true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/tenth/SculptingSteel.java b/Mage.Sets/src/mage/sets/tenth/SculptingSteel.java index cf57c76d90b..100a4482d7b 100644 --- a/Mage.Sets/src/mage/sets/tenth/SculptingSteel.java +++ b/Mage.Sets/src/mage/sets/tenth/SculptingSteel.java @@ -56,7 +56,10 @@ public class SculptingSteel extends CardImpl { this.expansionSetCode = "10E"; // You may have Sculpting Steel enter the battlefield as a copy of any artifact on the battlefield. - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new CopyPermanentEffect(filter), "You may have {this} enter the battlefield as a copy of any artifact on the battlefield")); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( + new CopyPermanentEffect(filter), + "You may have {this} enter the battlefield as a copy of any artifact on the battlefield", + true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/timespiral/Vesuva.java b/Mage.Sets/src/mage/sets/timespiral/Vesuva.java index 3617786d9df..9e06877aa60 100644 --- a/Mage.Sets/src/mage/sets/timespiral/Vesuva.java +++ b/Mage.Sets/src/mage/sets/timespiral/Vesuva.java @@ -56,7 +56,10 @@ public class Vesuva extends CardImpl { this.expansionSetCode = "TSP"; // You may have Vesuva enter the battlefield tapped as a copy of any land on the battlefield. - EntersBattlefieldEffect effect = new EntersBattlefieldEffect(new TapSourceEffect(true), "You may have {this} enter the battlefield tapped as a copy of any land on the battlefield"); + EntersBattlefieldEffect effect = new EntersBattlefieldEffect( + new TapSourceEffect(true), + "You may have {this} enter the battlefield tapped as a copy of any land on the battlefield", + true); effect.addEffect(new CopyPermanentEffect(filter)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/sets/worldwake/JwariShapeshifter.java b/Mage.Sets/src/mage/sets/worldwake/JwariShapeshifter.java index 840d2b0263a..84f80566f6b 100644 --- a/Mage.Sets/src/mage/sets/worldwake/JwariShapeshifter.java +++ b/Mage.Sets/src/mage/sets/worldwake/JwariShapeshifter.java @@ -28,9 +28,9 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -40,6 +40,7 @@ import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; /** * @@ -52,6 +53,7 @@ public class JwariShapeshifter extends CardImpl { static { filter.add(new SubtypePredicate("Ally")); filter.add(new CardTypePredicate(CardType.CREATURE)); + filter.add(new AnotherPredicate()); // needed because during enters_the_battlefield event the creature is already targetable although it shouldn't } public JwariShapeshifter(UUID ownerId) { @@ -65,7 +67,10 @@ public class JwariShapeshifter extends CardImpl { this.toughness = new MageInt(0); // You may have Jwari Shapeshifter enter the battlefield as a copy of any Ally creature on the battlefield. - Ability ability = new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new EntersBattlefieldEffect(new CopyPermanentEffect(filter), "You may have {this} enter the battlefield as a copy of any Ally creature on the battlefield")); + Ability ability = new SimpleStaticAbility( + Zone.BATTLEFIELD, + new EntersBattlefieldEffect(new CopyPermanentEffect(filter), null, + "You may have {this} enter the battlefield as a copy of any Ally creature on the battlefield", true, true)); this.addAbility(ability); }