diff --git a/Mage.Sets/src/mage/cards/b/BehindTheScenes.java b/Mage.Sets/src/mage/cards/b/BehindTheScenes.java index 49aca371a8..2433120f34 100644 --- a/Mage.Sets/src/mage/cards/b/BehindTheScenes.java +++ b/Mage.Sets/src/mage/cards/b/BehindTheScenes.java @@ -52,7 +52,7 @@ public class BehindTheScenes extends CardImpl { // Creatures you control have skulk. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new GainAbilityControlledEffect(SkulkAbility.getInstance(), Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES))); + new GainAbilityControlledEffect(new SkulkAbility(), Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES))); // {4}{W}: Creatures you control get +1/+1 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, diff --git a/Mage.Sets/src/mage/cards/f/FarbogRevenant.java b/Mage.Sets/src/mage/cards/f/FarbogRevenant.java index 6e4a727a08..3bdfb80d93 100644 --- a/Mage.Sets/src/mage/cards/f/FarbogRevenant.java +++ b/Mage.Sets/src/mage/cards/f/FarbogRevenant.java @@ -49,7 +49,7 @@ public class FarbogRevenant extends CardImpl { this.toughness = new MageInt(3); // Skulk - this.addAbility(SkulkAbility.getInstance()); + this.addAbility(new SkulkAbility()); // Lifelink this.addAbility(LifelinkAbility.getInstance()); diff --git a/Mage.Sets/src/mage/cards/f/Fogwalker.java b/Mage.Sets/src/mage/cards/f/Fogwalker.java index 5ae2894020..eaf42be950 100644 --- a/Mage.Sets/src/mage/cards/f/Fogwalker.java +++ b/Mage.Sets/src/mage/cards/f/Fogwalker.java @@ -60,7 +60,7 @@ public class Fogwalker extends CardImpl { this.toughness = new MageInt(3); // Skulk - this.addAbility(SkulkAbility.getInstance()); + this.addAbility(new SkulkAbility()); // When Fogwalker enters the battlefield, target creature an opponent controls doesn't untap during it controler's next untap step. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DontUntapInControllersNextUntapStepTargetEffect()); ability.addTarget(new TargetCreaturePermanent(filter)); diff --git a/Mage.Sets/src/mage/cards/f/ForgottenCreation.java b/Mage.Sets/src/mage/cards/f/ForgottenCreation.java index f5435fdc02..37bfc59efe 100644 --- a/Mage.Sets/src/mage/cards/f/ForgottenCreation.java +++ b/Mage.Sets/src/mage/cards/f/ForgottenCreation.java @@ -56,7 +56,7 @@ public class ForgottenCreation extends CardImpl { this.toughness = new MageInt(3); // Skulk - this.addAbility(SkulkAbility.getInstance()); + this.addAbility(new SkulkAbility()); // At the beginning of your upkeep, you may discard all the cards in your hand. If you do, draw that many cards. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ForgottenCreationEffect(), TargetController.YOU, true)); } diff --git a/Mage.Sets/src/mage/cards/f/FurtiveHomunculus.java b/Mage.Sets/src/mage/cards/f/FurtiveHomunculus.java index 11fc20bf02..de4abdb094 100644 --- a/Mage.Sets/src/mage/cards/f/FurtiveHomunculus.java +++ b/Mage.Sets/src/mage/cards/f/FurtiveHomunculus.java @@ -48,7 +48,7 @@ public class FurtiveHomunculus extends CardImpl { this.toughness = new MageInt(1); // Skulk (This creature can't be blocked by creatures with greater power.) - this.addAbility(SkulkAbility.getInstance()); + this.addAbility(new SkulkAbility()); } public FurtiveHomunculus(final FurtiveHomunculus card) { diff --git a/Mage.Sets/src/mage/cards/o/OdricLunarchMarshal.java b/Mage.Sets/src/mage/cards/o/OdricLunarchMarshal.java index 353a072d4b..a88797dcdc 100644 --- a/Mage.Sets/src/mage/cards/o/OdricLunarchMarshal.java +++ b/Mage.Sets/src/mage/cards/o/OdricLunarchMarshal.java @@ -171,7 +171,7 @@ class OdricLunarchMarshalEffect extends OneShotEffect { // Skulk if (game.getBattlefield().contains(filterSkulk, source.getControllerId(), 1, game)) { - game.addEffect(new GainAbilityControlledEffect(SkulkAbility.getInstance(), Duration.EndOfTurn, filterCreatures), source); + game.addEffect(new GainAbilityControlledEffect(new SkulkAbility(), Duration.EndOfTurn, filterCreatures), source); } // Trample @@ -185,4 +185,4 @@ class OdricLunarchMarshalEffect extends OneShotEffect { } return true; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/p/PaleRiderOfTrostad.java b/Mage.Sets/src/mage/cards/p/PaleRiderOfTrostad.java index e270688f21..f09cf4f27b 100644 --- a/Mage.Sets/src/mage/cards/p/PaleRiderOfTrostad.java +++ b/Mage.Sets/src/mage/cards/p/PaleRiderOfTrostad.java @@ -50,7 +50,7 @@ public class PaleRiderOfTrostad extends CardImpl { this.toughness = new MageInt(3); // Skulk - this.addAbility(SkulkAbility.getInstance()); + this.addAbility(new SkulkAbility()); // When Pale Rider of Trostad enters the battlefield, discard a card. this.addAbility(new EntersBattlefieldTriggeredAbility(new DiscardControllerEffect(1), false)); diff --git a/Mage.Sets/src/mage/cards/p/PersistentNightmare.java b/Mage.Sets/src/mage/cards/p/PersistentNightmare.java index 59a76bd4ff..efaf3951a0 100644 --- a/Mage.Sets/src/mage/cards/p/PersistentNightmare.java +++ b/Mage.Sets/src/mage/cards/p/PersistentNightmare.java @@ -54,7 +54,7 @@ public class PersistentNightmare extends CardImpl { this.nightCard = true; // Skulk - this.addAbility(SkulkAbility.getInstance()); + this.addAbility(new SkulkAbility()); // When Persistent Nightmare deals combat damage to a player, return it to its owner's hand. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ReturnToHandSourceEffect(), false)); diff --git a/Mage.Sets/src/mage/cards/r/RancidRats.java b/Mage.Sets/src/mage/cards/r/RancidRats.java index 630cf94c5c..4dfdb9d069 100644 --- a/Mage.Sets/src/mage/cards/r/RancidRats.java +++ b/Mage.Sets/src/mage/cards/r/RancidRats.java @@ -50,7 +50,7 @@ public class RancidRats extends CardImpl { this.toughness = new MageInt(1); // Skulk - this.addAbility(SkulkAbility.getInstance()); + this.addAbility(new SkulkAbility()); // Deathtouch this.addAbility(DeathtouchAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/cards/s/SkeletonKey.java b/Mage.Sets/src/mage/cards/s/SkeletonKey.java index dc3774257d..72dc2d91d3 100644 --- a/Mage.Sets/src/mage/cards/s/SkeletonKey.java +++ b/Mage.Sets/src/mage/cards/s/SkeletonKey.java @@ -57,7 +57,7 @@ public class SkeletonKey extends CardImpl { this.subtype.add(SubType.EQUIPMENT); // Equipped creature has skulk. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(SkulkAbility.getInstance(), AttachmentType.EQUIPMENT))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new SkulkAbility(), AttachmentType.EQUIPMENT))); // Whenever equipped creature deals combat damage to a player, you may draw a card. if you do, discard a card. Ability ability = new DealsDamageToAPlayerAttachedTriggeredAbility(new DrawCardSourceControllerEffect(1), "equipped creature", true); diff --git a/Mage.Sets/src/mage/cards/u/UninvitedGeist.java b/Mage.Sets/src/mage/cards/u/UninvitedGeist.java index 037328203e..4dd1c9776e 100644 --- a/Mage.Sets/src/mage/cards/u/UninvitedGeist.java +++ b/Mage.Sets/src/mage/cards/u/UninvitedGeist.java @@ -54,7 +54,7 @@ public class UninvitedGeist extends CardImpl { this.secondSideCardClazz = UnimpededTrespasser.class; // Skulk (This creature can't be blocked by creatures with greater power.) - this.addAbility(SkulkAbility.getInstance()); + this.addAbility(new SkulkAbility()); // When Uninvited Geist deals combat damage to a player, transform it. this.addAbility(new TransformAbility()); diff --git a/Mage.Sets/src/mage/cards/v/VampireCutthroat.java b/Mage.Sets/src/mage/cards/v/VampireCutthroat.java index b57163f93c..a83227695c 100644 --- a/Mage.Sets/src/mage/cards/v/VampireCutthroat.java +++ b/Mage.Sets/src/mage/cards/v/VampireCutthroat.java @@ -50,7 +50,7 @@ public class VampireCutthroat extends CardImpl { this.toughness = new MageInt(1); // Skulk - this.addAbility(SkulkAbility.getInstance()); + this.addAbility(new SkulkAbility()); // Lifelink this.addAbility(LifelinkAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java b/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java index 9c49a67b5d..9e3116fc85 100644 --- a/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java +++ b/Mage.Sets/src/mage/cards/w/WharfInfiltrator.java @@ -62,7 +62,7 @@ public class WharfInfiltrator extends CardImpl { this.toughness = new MageInt(1); // Skulk - this.addAbility(SkulkAbility.getInstance()); + this.addAbility(new SkulkAbility()); // Whenever Wharf Infiltrator deals combat damage to a player, you may draw a card. If you do, discard a card. Effect effect = new DrawDiscardControllerEffect(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/add/GainAbilitiesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/add/GainAbilitiesTest.java index 8096df1ee3..8b519b9416 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/add/GainAbilitiesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/add/GainAbilitiesTest.java @@ -14,34 +14,34 @@ public class GainAbilitiesTest extends CardTestPlayerBase { /* Reported bug: Behind the Scenes grants skulk to all creatures instead of just ones under owner's control - */ + */ @Test public void behindTheScenesShouldOnlyGrantSkulkToCreaturesYouControl() { - + /* Behind the Scenes {2}{B} Enchantment Creatures you control have skulk. (They can't be blocked by creatures with greater power.) {4}{W}: Creatures you control get +1/+1 until end of turn - */ - String bScenes = "Behind the Scenes"; + */ + String bScenes = "Behind the Scenes"; String hGiant = "Hill Giant"; // {3}{R} 3/3 String bSable = "Bronze Sable"; // {2} 2/1 String memnite = "Memnite"; // {0} 1/1 String gBears = "Grizzly Bears"; // {1}{G} 2/2 - + addCard(Zone.BATTLEFIELD, playerA, bScenes); addCard(Zone.BATTLEFIELD, playerA, hGiant); addCard(Zone.BATTLEFIELD, playerA, bSable); addCard(Zone.BATTLEFIELD, playerB, memnite); addCard(Zone.BATTLEFIELD, playerB, gBears); - + setStopAt(1, PhaseStep.PRECOMBAT_MAIN); execute(); - - assertAbility(playerA, hGiant, SkulkAbility.getInstance(), true); - assertAbility(playerA, bSable, SkulkAbility.getInstance(), true); - assertAbility(playerB, memnite, SkulkAbility.getInstance(), false); - assertAbility(playerB, gBears, SkulkAbility.getInstance(), false); + + assertAbility(playerA, hGiant, new SkulkAbility(), true); + assertAbility(playerA, bSable, new SkulkAbility(), true); + assertAbility(playerB, memnite, new SkulkAbility(), false); + assertAbility(playerB, gBears, new SkulkAbility(), false); } } diff --git a/Mage/src/main/java/mage/abilities/keyword/SkulkAbility.java b/Mage/src/main/java/mage/abilities/keyword/SkulkAbility.java index f97d4763a9..2378f0a9db 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SkulkAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SkulkAbility.java @@ -5,12 +5,11 @@ */ package mage.abilities.keyword; -import java.io.ObjectStreamException; import mage.abilities.Ability; -import mage.abilities.EvasionAbility; -import mage.abilities.MageSingleton; +import mage.abilities.StaticAbility; import mage.abilities.effects.RestrictionEffect; import mage.constants.Duration; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; @@ -18,31 +17,26 @@ import mage.game.permanent.Permanent; * * @author LevelX2 */ -public class SkulkAbility extends EvasionAbility implements MageSingleton { +public class SkulkAbility extends StaticAbility { - private static final SkulkAbility instance = new SkulkAbility(); - - private Object readResolve() throws ObjectStreamException { - return instance; + public SkulkAbility() { + super(Zone.BATTLEFIELD, new SkulkEffect(Duration.WhileOnBattlefield)); } - public static SkulkAbility getInstance() { - return instance; - } - - private SkulkAbility() { - this.addEffect(new SkulkEffect(Duration.WhileOnBattlefield)); + public SkulkAbility(final SkulkAbility ability) { + super(ability); } @Override public Ability copy() { - return instance; + return new SkulkAbility(this); } @Override public String getRule() { return "Skulk (This creature can't be blocked by creatures with greater power.)"; } + } class SkulkEffect extends RestrictionEffect { diff --git a/Utils/keywords.txt b/Utils/keywords.txt index f2c980846b..875ab52c00 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -76,7 +76,7 @@ Shadow|instance| Shroud|instance| Soulbond|instance| Soulshift|number| -Skulk|instance| +Skulk|new| Storm|new| Sunburst|new| Swampcycling|cost|